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

# List historical escalation assignments (paginated)

> Returns paginated EscalationAssignment records (an audit log of every queue → agent or direct assignment), enriched with contact, assignee, and department names. Supports filtering by assignee, automation, date range, and free-text contact search.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/escalation-dashboard/assignments
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/escalation-dashboard/assignments:
    get:
      tags:
        - Escalation Dashboard
      summary: List historical escalation assignments (paginated)
      description: >-
        Returns paginated EscalationAssignment records (an audit log of every
        queue → agent or direct assignment), enriched with contact, assignee,
        and department names. Supports filtering by assignee, automation, date
        range, and free-text contact search.
      operationId: get_assignment_history
      parameters:
        - in: query
          name: departmentId
          required: false
          schema:
            type: string
          description: >-
            Optional department filter. ADMIN/SUPERADMIN may pass any
            departmentId; DEPARTMENT_HEAD is implicitly scoped to their own
            department and any other value is ignored.
        - in: query
          name: page
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            description: 1-based page number.
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
            description: Page size. Clamped to [1, 100].
        - in: query
          name: assigneeId
          required: false
          schema:
            type: string
        - in: query
          name: automationId
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          required: false
          schema:
            type: string
            format: date-time
        - in: query
          name: endDate
          required: false
          schema:
            type: string
            format: date-time
        - in: query
          name: search
          required: false
          schema:
            type: string
          description: >-
            Case-insensitive substring match against contact firstName,
            lastName, or phoneNumber.value.
      responses:
        '200':
          description: Assignment history returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignmentHistoryResponse'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EscalationDashboardError'
        '500':
          description: Error fetching assignment history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EscalationDashboardError'
      security:
        - bearerAuth: []
components:
  schemas:
    AssignmentHistoryResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            assignments:
              type: array
              items:
                $ref: '#/components/schemas/AssignmentHistoryItem'
            pagination:
              $ref: '#/components/schemas/EscalationPagination'
          required:
            - assignments
            - pagination
          additionalProperties: false
      required:
        - success
        - data
      additionalProperties: false
      example:
        success: true
        data:
          assignments:
            - _id: ab12cd34ef56789012345678
              conversationId: 8c3d4e0f9a1b3c4d5e6f7a8b9c01
              contactId: 9d4e5f1a2b3c4d5e6f7a8b9c0d12
              contactName: Alex Morgan
              assigneeId: 5f7b1c2e8a1d4e0012c3b4a5
              assigneeName: Sam Patel
              automationId: 5f7b1c2e8a1d4e0012c3b4a5
              automationName: Inbound Support
              source: queue
              assignedAt: '2026-05-18T14:31:02.000Z'
              hasAccess: true
          pagination:
            page: 1
            limit: 20
            total: 143
            totalPages: 8
    EscalationDashboardError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
      required:
        - success
        - message
      additionalProperties: true
      example:
        success: false
        message: Access denied
    AssignmentHistoryItem:
      type: object
      properties:
        _id:
          type: string
        conversationId:
          type: string
        contactId:
          type: string
        contactName:
          type: string
        contactPhone:
          type: string
          nullable: true
        assigneeId:
          type: string
        assigneeName:
          type: string
        assigneeAvatarUrl:
          type: string
          nullable: true
        automationId:
          type: string
        automationName:
          type: string
        source:
          type: string
          enum:
            - direct
            - queue
          description: >-
            `direct` = assigned immediately, `queue` = pulled from the waiting
            queue.
        assignedAt:
          type: string
          format: date-time
        waitTimeMs:
          type: integer
          nullable: true
        firstHumanMessageAt:
          type: string
          format: date-time
          nullable: true
        firstHumanResponseMs:
          type: integer
          nullable: true
        departmentName:
          type: string
          nullable: true
        hasAccess:
          type: boolean
      required:
        - _id
        - conversationId
        - contactId
        - contactName
        - assigneeId
        - assigneeName
        - automationId
        - automationName
        - source
        - assignedAt
        - hasAccess
      additionalProperties: false
      example:
        _id: ab12cd34ef56789012345678
        conversationId: 8c3d4e0f9a1b3c4d5e6f7a8b9c01
        contactId: 9d4e5f1a2b3c4d5e6f7a8b9c0d12
        contactName: Alex Morgan
        contactPhone: '+14165550100'
        assigneeId: 5f7b1c2e8a1d4e0012c3b4a5
        assigneeName: Sam Patel
        assigneeAvatarUrl: https://r2.example.com/avatars/sam.png
        automationId: 5f7b1c2e8a1d4e0012c3b4a5
        automationName: Inbound Support
        source: queue
        assignedAt: '2026-05-18T14:31:02.000Z'
        waitTimeMs: 331000
        firstHumanMessageAt: '2026-05-18T14:32:12.000Z'
        firstHumanResponseMs: 70000
        departmentName: Customer Success
        hasAccess: true
    EscalationPagination:
      type: object
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        totalPages:
          type: integer
      required:
        - page
        - limit
        - total
        - totalPages
      additionalProperties: false
      example:
        page: 1
        limit: 20
        total: 143
        totalPages: 8
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````