> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Message

> Send a message to a conversation.

If starting the run returns 429, the message is already saved. Retry the
conversation's /run endpoint instead of resending the message.



## OpenAPI

````yaml /openapi/agent-sdk.json post /api/conversations/{conversation_id}/events
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/conversations/{conversation_id}/events:
    post:
      tags:
        - Events
      summary: Send Message
      description: |-
        Send a message to a conversation.

        If starting the run returns 429, the message is already saved. Retry the
        conversation's /run endpoint instead of resending the message.
      operationId: send_message_api_conversations__conversation_id__events_post
      parameters:
        - in: path
          name: conversation_id
          required: true
          schema:
            format: uuid
            title: Conversation Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '429':
          description: Message saved but server run capacity is full
      security:
        - APIKeyHeader: []
components:
  schemas:
    SendMessageRequest:
      description: Payload to send a message to the agent.
      properties:
        content:
          items:
            anyOf:
              - $ref: '#/components/schemas/TextContent'
              - $ref: '#/components/schemas/ImageContent'
          title: Content
          type: array
        role:
          default: user
          enum:
            - user
            - system
            - assistant
            - tool
          title: Role
          type: string
        run:
          default: false
          description: Whether the agent loop should automatically run if not running
          title: Run
          type: boolean
      title: SendMessageRequest
      type: object
    Success:
      properties:
        success:
          default: true
          title: Success
          type: boolean
      title: Success
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    TextContent:
      additionalProperties: false
      properties:
        cache_prompt:
          default: false
          title: Cache Prompt
          type: boolean
        text:
          title: Text
          type: string
        type:
          const: text
          default: text
          title: Type
          type: string
      required:
        - text
      title: TextContent
      type: object
    ImageContent:
      properties:
        cache_prompt:
          default: false
          title: Cache Prompt
          type: boolean
        image_urls:
          items:
            type: string
          title: Image Urls
          type: array
        type:
          const: image
          default: image
          title: Type
          type: string
      required:
        - image_urls
      title: ImageContent
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

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