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

# Send message

> Requires an authenticated end user with access to the selected AI. Application service accounts cannot act as an unverified end user.



## OpenAPI

````yaml /openapi-v2.json post /act/ai/messages
openapi: 3.1.0
info:
  title: Darwin API v2
  version: 2.0.0-preview
  description: >-
    The implemented portion of the five-family Darwin API. Operations are added
    only after runtime and contract verification.
servers:
  - url: https://api.darwin.so/api/v2
    description: Production — use live `darwin_…` keys.
  - url: https://api.dev.darwin.so/api/v2
    description: Sandbox — use isolated `darwin_test_…` keys.
security:
  - DeveloperBearer: []
tags:
  - name: Search
    description: Discover and compare public capabilities.
  - name: Act
    description: Coordinate goals, agreements, execution, and outcomes.
  - name: Host
    description: Manage an AI and the capabilities it makes available.
  - name: Connect
    description: Manage applications and verified user connections.
  - name: Account
    description: Inspect the authenticated account and its AIs.
paths:
  /act/ai/messages:
    post:
      tags:
        - Act
      summary: Send message
      description: >-
        Requires an authenticated end user with access to the selected AI.
        Application service accounts cannot act as an unverified end user.
      operationId: sendActAiMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - content
              properties:
                aiId:
                  type: string
                content:
                  type: string
                  maxLength: 20000
                requestId:
                  type: string
      responses:
        '201':
          description: The completed or clarified AI turn.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationTurn'
        '400':
          description: The request was invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The bearer key is missing, invalid, expired, or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The principal does not have the required scope or resource access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The resource was not found for this principal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ConversationTurn:
      type: object
      required:
        - conversation
        - messages
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationSummary'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ConversationMessage'
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
    ConversationSummary:
      type: object
      required:
        - id
        - aiId
        - mode
        - type
        - title
        - messageCount
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        aiId:
          type:
            - string
            - 'null'
        mode:
          type: string
          const: CHAT
        type:
          type: string
          const: CHAT
          deprecated: true
        title:
          type: string
        messageCount:
          type: integer
          minimum: 0
        lastMessageAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ConversationMessage:
      type: object
      required:
        - id
        - conversationId
        - role
        - content
        - sequence
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        conversationId:
          type: string
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          type: string
        sequence:
          type: integer
          minimum: 0
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    DeveloperBearer:
      type: http
      scheme: bearer
      bearerFormat: Darwin API key
      description: >-
        Production keys begin with `darwin_`. Isolated sandbox keys begin with
        `darwin_test_`. Create keys in Developer settings.

````