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

# Deep scan dependencies for a single-user department transfer

> Compute the dependency manifest for moving one user to a new department: prompts, automations, conversations, contacts and approval policies that need remapping. Returns a `scanVersion` token that must be echoed on `/execute` to detect stale plans.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/departments/transfer/scan
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/scan:
    post:
      tags:
        - DepartmentTransfer
      summary: Deep scan dependencies for a single-user department transfer
      description: >-
        Compute the dependency manifest for moving one user to a new department:
        prompts, automations, conversations, contacts and approval policies that
        need remapping. Returns a `scanVersion` token that must be echoed on
        `/execute` to detect stale plans.
      operationId: post_departments_transfer_scan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferScanRequest'
      responses:
        '200':
          description: Scan completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResultResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferErrorResponse'
        '403':
          description: Forbidden
          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:
    TransferScanRequest:
      type: object
      properties:
        userId:
          type: string
          description: User `_id` being moved out of their current department.
        targetDepartmentId:
          type: string
          description: Destination department `_id` the user should be reassigned to.
      required:
        - userId
        - targetDepartmentId
      additionalProperties: false
      example:
        userId: 65b1f0a2c3d4e5f6a7b8c9d0
        targetDepartmentId: 65c1a0b0c0d0e0f0a0b0c0d1
    ScanResultResponse:
      type: object
      additionalProperties: true
      example:
        scanVersion: v2026-05-18T12:00:00Z-abc123
        summary:
          prompts: 4
          automations: 2
          conversations: 17
          approvalPolicies: 1
        conflicts: []
    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

````