> ## 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.

# Execute a user transfer using mappings from a scan

> Apply the assignments returned by `/scan` or `/scan-bulk`. The supplied `scanVersion` must still match the live state — a stale scan returns 400 and the caller must re-scan. Optionally deletes the source department after a successful bulk move. Returns 202 with a `transferId` for status polling.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/departments/transfer/execute
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/transfer/execute:
    post:
      tags:
        - DepartmentTransfer
      summary: Execute a user transfer using mappings from a scan
      description: >-
        Apply the assignments returned by `/scan` or `/scan-bulk`. The supplied
        `scanVersion` must still match the live state — a stale scan returns 400
        and the caller must re-scan. Optionally deletes the source department
        after a successful bulk move. Returns 202 with a `transferId` for status
        polling.
      operationId: post_departments_transfer_execute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferExecuteRequest'
      responses:
        '202':
          description: Transfer accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferStatusResponse'
        '400':
          description: Validation error / stale scan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferErrorResponse'
        '409':
          description: Conflict (e.g. another transfer in progress)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    TransferExecuteRequest:
      type: object
      properties:
        scanVersion:
          type: string
          description: >-
            Token from the prior scan; rejected if stale to prevent applying an
            out-of-date plan.
        assignments:
          type: array
          description: >-
            Per-user transfer plan: source userId -> target department / new
            role / re-assignee.
          items:
            type: object
            additionalProperties: true
        deleteSourceDepartmentId:
          type: string
          description: >-
            When set, the source department is deleted after the transfer
            succeeds (must be empty).
      required:
        - scanVersion
        - assignments
      additionalProperties: true
      example:
        scanVersion: v2026-05-18T12:00:00Z-abc123
        assignments:
          - userId: 65b1f0a2c3d4e5f6a7b8c9d0
            targetDepartmentId: 65c1a0b0c0d0e0f0a0b0c0d1
        deleteSourceDepartmentId: 65c1a0b0c0d0e0f0a0b0c0d0
    TransferStatusResponse:
      type: object
      properties:
        transferId:
          type: string
        status:
          type: string
      additionalProperties: true
      example:
        transferId: 65d0a0b0c0d0e0f0a0b0c0d0
        status: running
        progress:
          processed: 5
          total: 24
    TransferErrorResponse:
      type: object
      properties:
        error:
          type: string
      additionalProperties: true
      example:
        error: Scan version is stale; please re-scan
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````