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

# Assign an agent

> Assigns an agent to a conversation. The agent must be an active member of the workspace. Pass `ai` as the `agentId` to assign the workspace's AI agent. Reassigning replaces the current assignment.

Rate limit: 60 requests per minute.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/conversations/{conversationId}/assign
openapi: 3.1.0
info:
  title: Adraa Inbox API
  description: >-
    Public REST API for Adraa Inbox. Assign agents to conversations and send
    messages from your own systems. Authenticate every request with a workspace
    API token.
  version: 1.0.0
  contact:
    email: support@adraa.ai
servers:
  - url: https://api.inbox.adraa.ai
    description: Production
security:
  - apiToken: []
paths:
  /api/v1/conversations/{conversationId}/assign:
    post:
      summary: Assign an agent
      description: >-
        Assigns an agent to a conversation. The agent must be an active member
        of the workspace. Pass `ai` as the `agentId` to assign the workspace's
        AI agent. Reassigning replaces the current assignment.


        Rate limit: 60 requests per minute.
      operationId: assignConversation
      parameters:
        - $ref: '#/components/parameters/conversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agentId
              properties:
                agentId:
                  type: string
                  description: >-
                    ID of the agent to assign (list agents with `GET
                    /api/v1/agents`), or `ai` to assign the workspace's AI
                    agent.
                  example: cmbxgwq1e0000ph01i0j1k2l3
      responses:
        '200':
          description: Agent assigned
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  conversationId:
                    type: string
                    example: cmbxgz9pq0003ph01m4n5o6p7
                  assignment:
                    type: object
                    description: The resulting assignment.
                    properties:
                      agentId:
                        type: string
                        example: cmbxgwq1e0000ph01i0j1k2l3
                      agentNickname:
                        type: string
                        example: sara
                      assignedAt:
                        type: string
                        format: date-time
                        example: '2026-06-12T10:30:00.000Z'
        '400':
          description: Invalid request — unknown agent or invalid body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: INVALID_AGENT
                  message: Invalid agent
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Agent belongs to a different workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: COMPANY_MISMATCH
                  message: Agent cannot be assigned to different company conversation
        '404':
          $ref: '#/components/responses/ConversationNotFound'
components:
  parameters:
    conversationId:
      name: conversationId
      in: path
      required: true
      description: >-
        ID of the conversation. Visible in the console URL when a conversation
        is open:
        `app.inbox.adraa.ai/<workspace>/conversations/<conversationId>`, or list
        conversations with `GET /api/v1/conversations`.
      schema:
        type: string
        example: cmbxgz9pq0003ph01m4n5o6p7
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
            details:
              description: Field-level details for validation errors.
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_TOKEN
              message: Invalid or revoked API token
    ConversationNotFound:
      description: Conversation does not exist or belongs to another workspace
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: CONVERSATION_NOT_FOUND
              message: Conversation not found
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      description: >-
        Workspace API token created in Settings → API. Tokens start with
        `adraa_`.

````