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

# Process a message with an assistant

> Sends messages to the specified assistant specialization and returns its response. You can provide a chatUid to continue an existing conversation.



## OpenAPI

````yaml POST /v1/assistants/{identifier}/messages
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
paths:
  /v1/assistants/{identifier}/messages:
    post:
      tags:
        - Assistants
      summary: Process a message with an assistant specialization
      description: >-
        Sends messages to the specified assistant specialization and returns its
        response. You can provide a chatUid to continue an existing
        conversation.
      operationId: processAssistantMessage
      parameters:
        - name: identifier
          in: path
          required: true
          description: Identifier of the assistant specialization to use
          schema:
            type: string
      requestBody:
        required: true
        description: Messages and optional chat context for the assistant
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessMessageRequest'
      responses:
        '200':
          description: Assistant response and updated chat context
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatHistory'
        '400':
          description: Invalid message payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid or missing token
        '404':
          description: Assistant specialization not found
        '429':
          description: Too Many Requests - Rate limit exceeded
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    ProcessMessageRequest:
      type: object
      required:
        - messages
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
          description: Messages to process, usually including the latest user message
        chatUid:
          type: string
          description: Optional chat UID to continue an existing conversation
        metadata:
          type: object
          additionalProperties: true
          description: Custom metadata for this interaction
        tenantId:
          type: string
          description: >-
            Tenant (customer/organization) this conversation belongs to in
            multi-tenant setups. Auto-registers the tenant on first use and
            attributes its cost/usage. See the Tenants endpoints.
        subtenantId:
          type: string
          description: >-
            End user/entity inside the tenant. When omitted it is derived from
            metadata.subtenantMetadata.id or the legacy metadata.userId. Used
            for per-subtenant cost attribution and usage limits.
    ChatHistory:
      type: object
      required:
        - chatUid
        - assistantIdentifier
        - createdAt
        - messages
      properties:
        chatUid:
          type: string
          description: Unique identifier for the chat session
        assistantIdentifier:
          type: string
          description: Identifier for the assistant specialization used
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the chat was created
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
          description: Messages exchanged in the chat
        metadata:
          type: object
          additionalProperties: true
          description: Custom metadata associated with the chat
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
        details:
          type: object
          additionalProperties: true
          description: Additional details about the error
    ChatMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
          description: Role of the message sender
        content:
          type: string
          description: Content of the message
        timestamp:
          type: string
          format: date-time
          description: When the message was sent
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use JWT token for authentication

````