> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tetherai.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a department

> Update mutable fields of a department. Renaming to a name already in use within the organization returns 409. Manager/user lists are replaced atomically.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/departments/{id}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/departments/{id}:
    put:
      tags:
        - Departments
      summary: Update a department
      description: >-
        Update mutable fields of a department. Renaming to a name already in use
        within the organization returns 409. Manager/user lists are replaced
        atomically.
      operationId: put_departments_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDepartmentRequest'
      responses:
        '200':
          description: Department updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentErrorResponse'
        '404':
          description: Department not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentErrorResponse'
        '409':
          description: Department with this name already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateDepartmentRequest:
      type: object
      properties:
        name:
          type: string
          description: Department display name; unique within the organization.
        description:
          type: string
          description: Free-text description of the department's purpose.
        managerIds:
          type: array
          items:
            type: string
          description: User `_id`s with MANAGER role inside this department.
        userIds:
          type: array
          items:
            type: string
          description: All members of the department (managers + agents).
      additionalProperties: true
      example:
        description: All sales reps, NA + EMEA
        userIds:
          - 65b1f0a2c3d4e5f6a7b8c9d0
          - 65b1f0a2c3d4e5f6a7b8c9d1
          - 65b1f0a2c3d4e5f6a7b8c9d2
    DepartmentResponse:
      type: object
      properties:
        department:
          $ref: '#/components/schemas/DepartmentDto'
      additionalProperties: true
      example:
        department:
          _id: 65c1a0b0c0d0e0f0a0b0c0d1
          name: Sales
          description: Inbound + outbound sales reps
          organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
          createdAt: '2026-01-12T09:00:00.000Z'
          updatedAt: '2026-04-04T12:30:00.000Z'
    DepartmentErrorResponse:
      type: object
      properties:
        error:
          type: string
      additionalProperties: true
      example:
        error: Department with this name already exists
    DepartmentDto:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        description:
          type: string
        organizationId:
          type: string
        managerIds:
          type: array
          items:
            $ref: '#/components/schemas/DepartmentUserDto'
          description: Populated user objects or string IDs
        userIds:
          type: array
          items:
            $ref: '#/components/schemas/DepartmentUserDto'
          description: Populated user objects or string IDs
        createdBy:
          type: object
          description: Populated user object with fullName and email
          additionalProperties: true
        updatedBy:
          type: object
          description: Populated user object with fullName and email
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 65c1a0b0c0d0e0f0a0b0c0d1
        name: Sales
        description: Inbound + outbound sales reps
        organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
        managerIds:
          - _id: 65b1f0a2c3d4e5f6a7b8c9e0
            fullName: Brenda Lee
            email: brenda@example.com
            accessRole: ADMIN
        userIds:
          - _id: 65b1f0a2c3d4e5f6a7b8c9d0
            fullName: Alice Rivera
            email: alice@example.com
            accessRole: AGENT
        createdBy:
          _id: 65b1f0a2c3d4e5f6a7b8c9e0
          fullName: Brenda Lee
          email: brenda@example.com
        updatedBy:
          _id: 65b1f0a2c3d4e5f6a7b8c9e0
          fullName: Brenda Lee
          email: brenda@example.com
        createdAt: '2026-01-12T09:00:00.000Z'
        updatedAt: '2026-04-04T12:30:00.000Z'
    DepartmentUserDto:
      type: object
      properties:
        _id:
          type: string
        fullName:
          type: string
        email:
          type: string
        accessRole:
          type: string
        departmentId:
          type: string
        phoneNumber:
          type: string
        designation:
          type: string
      additionalProperties: true
      example:
        _id: 65b1f0a2c3d4e5f6a7b8c9d0
        fullName: Alice Rivera
        email: alice@example.com
        accessRole: AGENT
        departmentId: 65c1a0b0c0d0e0f0a0b0c0d1
        phoneNumber: '+14155550100'
        designation: Sales Rep
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````