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

# Send a reply

> Sends as an agent on the conversation's channel. Email and WhatsApp delivery is queued atomically with the message; queued does not mean delivered. Chat replies appear in the visitor stream. Internal notes and test-thread replies stay in Protodesk. Requires messages:send; messages:write alone never authorizes delivery. Reuse the same Idempotency-Key and request body for uncertain retries.




## OpenAPI

````yaml POST /conversations/{conversationId}/send
openapi: 3.1.0
info:
  title: Protodesk API
  version: 0.1.0
  description: >
    The Protodesk Platform API: sync your customers in, attach your own business
    objects (orders, bookings, listings) to conversations, post and read
    messages across channels, and receive every workspace event via signed
    webhooks or a resumable SSE stream.


    Authenticate every request with a workspace-scoped API key: `Authorization:
    Bearer pk_live_...`. Create endpoints accept an `Idempotency-Key` header so
    retries are always safe. Lists use opaque cursor pagination (`data` /
    `hasMore` / `nextCursor`).


    Task-oriented guides: [docs.protodesk.io](https://docs.protodesk.io).
servers:
  - url: https://api.protodesk.io/v1
    description: Production
  - url: http://localhost:8080/v1
    description: Local development
security: []
tags:
  - name: Evelin
    description: >-
      Human-owned AI connections using the existing Evelin runtime. Generation
      never sends a customer message.
  - name: Customers
    description: People or companies contacting a workspace across channels.
  - name: Conversations
    description: Customer conversations attached to channels and external business objects.
  - name: Messages
    description: Customer, agent, AI, system, and internal messages inside conversations.
  - name: Channel identities
    description: >-
      The same customer across WhatsApp, email, chat, and more — linked
      identities per channel.
  - name: Statuses & priorities
    description: The workspace's conversation statuses and priority levels.
  - name: Assignments
    description: >-
      Who a conversation has been assigned to, over time. Assign via POST
      /conversations/{conversationId}/assign.
  - name: Webhooks
    description: Webhook subscriptions for receiving workspace events.
  - name: Realtime
    description: Server-sent event stream of workspace events.
  - name: API Keys
    description: Create, list, and revoke workspace API keys.
  - name: Account
    description: The workspace and scopes behind your API key.
  - name: System
    description: Service metadata and health endpoints.
paths:
  /conversations/{conversationId}/send:
    post:
      tags:
        - Messages
      summary: Send a reply to a customer
      description: >
        Sends as an agent on the conversation's channel. Email and WhatsApp
        delivery is queued atomically with the message; queued does not mean
        delivered. Chat replies appear in the visitor stream. Internal notes and
        test-thread replies stay in Protodesk. Requires messages:send;
        messages:write alone never authorizes delivery. Reuse the same
        Idempotency-Key and request body for uncertain retries.
      operationId: sendMessage
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 8
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
      responses:
        '201':
          description: >-
            Reply recorded; inspect queued and message.metadata.deliveryStatus
            for delivery state.
          headers:
            Idempotency-Replayed:
              $ref: '#/components/headers/IdempotencyReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
        default:
          $ref: '#/components/responses/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SendMessageRequest:
      type: object
      additionalProperties: false
      properties:
        body:
          type: string
          description: Reply text; required unless attachments are provided.
        internal:
          type: boolean
          default: false
          description: Store an internal note without customer delivery.
        sendAt:
          type: string
          format: date-time
          description: Optional future email delivery time, at most 30 days ahead.
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/MessageAttachmentInput'
          description: >-
            Durable /api/media references owned by this workspace; arbitrary
            URLs are not accepted for sending.
    SendMessageResponse:
      type: object
      required:
        - message
        - queued
        - undoMsec
      properties:
        message:
          $ref: '#/components/schemas/Message'
        queued:
          type: boolean
          description: True only when provider delivery has been durably queued.
        undoMsec:
          type: integer
          description: >-
            Normal undo window in milliseconds; zero for scheduled or unqueued
            replies.
        scheduledFor:
          type: string
          format: date-time
    MessageAttachmentInput:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
        url:
          type: string
        filename:
          type: string
        contentType:
          type: string
        sizeBytes:
          type: integer
          minimum: 0
        metadata:
          type: object
          additionalProperties: true
    Message:
      type: object
      description: |
        Every key is always present; optional fields are null when unset.
      required:
        - id
        - externalId
        - conversationId
        - sender
        - body
        - channel
        - attachments
        - metadata
        - internal
        - createdAt
      properties:
        id:
          type: string
          example: msg_x6q5vl75f5d53m7oet2k4r5w6a
        externalId:
          type:
            - string
            - 'null'
          example: msg_123
        conversationId:
          type: string
          example: conv_x6q5vl75f5d53m7oet2k4r5w6a
        sender:
          $ref: '#/components/schemas/MessageSender'
        body:
          type: string
          example: Hi, is this villa available for yearly rental?
        channel:
          type: string
          example: whatsapp
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        metadata:
          type: object
          additionalProperties: true
        internal:
          type: boolean
        createdAt:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    MessageSender:
      type: string
      enum:
        - customer
        - agent
        - ai
        - system
    Attachment:
      type: object
      description: >
        A file on a message, referenced by URL (and/or your own id). Every key
        is always present; unset fields are null. Provide at least id or url.
      required:
        - id
        - url
        - filename
        - contentType
        - sizeBytes
        - metadata
      properties:
        id:
          type:
            - string
            - 'null'
          description: Your external attachment id, if any.
          example: file_123
        url:
          type:
            - string
            - 'null'
          format: uri
          example: https://example.com/files/inquiry.png
        filename:
          type:
            - string
            - 'null'
          example: inquiry.png
        contentType:
          type:
            - string
            - 'null'
          example: image/png
        sizeBytes:
          type: integer
          format: int64
          minimum: 0
          example: 12345
        metadata:
          type: object
          additionalProperties: true
          example:
            kind: screenshot
    Error:
      type: object
      required:
        - code
        - message
        - requestId
      properties:
        code:
          type: string
          example: route.not_found
        message:
          type: string
          example: Not found
        requestId:
          type: string
          example: req_x6q5vl75f5d53m7oet2k4r5w6a
  headers:
    IdempotencyReplayed:
      description: Present with true when a response was replayed from an idempotency key.
      schema:
        type: string
        enum:
          - 'true'
    RequestId:
      description: Request id for tracing this request in logs and support.
      schema:
        type: string
        example: req_x6q5vl75f5d53m7oet2k4r5w6a
    RateLimitLimit:
      description: >-
        Request budget for the route class (read or write) applied to this
        request.
      schema:
        type: integer
        example: 40
    RateLimitRemaining:
      description: Requests remaining in the current budget after this request.
      schema:
        type: integer
        example: 39
    RateLimitReset:
      description: Seconds until the budget refills to its full limit.
      schema:
        type: integer
        example: 1
    RetryAfter:
      description: Seconds to wait before retrying, sent with 429 responses.
      schema:
        type: integer
        example: 1
  responses:
    Error:
      description: >-
        Error response. All /v1 responses carry RateLimit-Limit,
        RateLimit-Remaining, and RateLimit-Reset headers. A 429
        (rate_limit.exceeded) additionally carries Retry-After. Request bodies
        exceeding the route-class limit (1KB reads, 64KB writes) return 413
        (request.body_too_large).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: Protodesk API key
      description: >
        Use a workspace API key in the Authorization header. Keys use
        pk_live_<key_id>_<secret> for production and pk_test_<key_id>_<secret>
        for test mode.

````

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