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

# Assign Conversation

> Assign a conversation to an agent or a team



## OpenAPI

````yaml /api-reference/openapi/EvoAI-CRM-Service/conversations.yaml post /api/v1/conversations/{conversation_id}/assignments
openapi: 3.0.4
info:
  title: Evolution Foundation - CRM Service - Conversations
  description: Management of contacts, conversations, inboxes, labels and macros
  version: 1.1.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3000
    description: Development server
    variables:
      port:
        default: '3000'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/conversations/{conversation_id}/assignments:
    parameters:
      - $ref: '#/components/parameters/conversation_id'
    post:
      summary: Assign Conversation
      description: Assign a conversation to an agent or a team
      operationId: assign-a-conversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                assignee_id:
                  type: string
                  format: uuid
                  description: Id of the assignee user
                  example: 111e2222-e33b-44d5-a666-777888999000
                team_id:
                  type: string
                  format: uuid
                  description: >-
                    Id of the team. If the assignee_id is present, this param
                    would be ignored
                  example: 555e6666-e77b-88d9-a000-111222333444
      responses:
        '200':
          description: Conversation assigned successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                  - meta
                  - message
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/user'
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                        description: Response timestamp
                        example: '2024-01-15T10:30:00Z'
                  message:
                    type: string
                    description: Success message
                    example: Conversation assigned successfully
              example:
                success: true
                data:
                  id: 111e2222-e33b-44d5-a666-777888999000
                  name: John Doe
                  email: john@example.com
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                message: Conversation assigned successfully
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation_error:
                  summary: Invalid request parameters
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Invalid request parameters
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/{conversation_id}/assignments
                      method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_token:
                  summary: Invalid or missing token
                  value:
                    success: false
                    error:
                      code: INVALID_TOKEN
                      message: Invalid or missing authentication token
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/{conversation_id}/assignments
                      method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  summary: Insufficient permissions
                  value:
                    success: false
                    error:
                      code: FORBIDDEN
                      message: You do not have permission to access this resource
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/{conversation_id}/assignments
                      method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                conversation_not_found:
                  summary: Conversation not found
                  value:
                    success: false
                    error:
                      code: NOT_FOUND
                      message: Conversation not found
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/{conversation_id}/assignments
                      method: POST
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal server error
                  value:
                    success: false
                    error:
                      code: INTERNAL_ERROR
                      message: An internal server error occurred
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/conversations/{conversation_id}/assignments
                      method: POST
      security:
        - userApiKey: []
        - agentBotApiKey: []
components:
  parameters:
    conversation_id:
      name: conversation_id
      in: path
      required: true
      description: Conversation ID (UUID)
      schema:
        type: string
        format: uuid
      example: 123e4567-e89b-12d3-a456-426614174000
  schemas:
    user:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
        avatar_url:
          type: string
          nullable: true
        available_name:
          type: string
          description: Display name for the user
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Validation failed
            details:
              type: object
              additionalProperties: true
              nullable: true
        meta:
          type: object
          required:
            - timestamp
            - path
            - method
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2024-01-15T10:30:00Z'
            path:
              type: string
              example: /public/api/v1/inboxes/{inbox_identifier}/contacts
            method:
              type: string
              example: POST
  securitySchemes:
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.