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

# Send a message

> Queued for delivery; the status becomes sent/delivered later. Reuse `idempotency_key` when retrying. From an inbox with `outbound_approval: required`, an agent token's message is stored with status `awaiting_approval` and is not sent until a member or an organization key approves it; it is `rejected` when turned down or not decided within 7 days. The answer has the same shape either way. Do not send it again: follow the message or the `message.approved` and `message.rejected` events. Organization keys send directly.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/inboxes/{inboxId}/messages
openapi: 3.1.0
info:
  description: >-
    Email inboxes, screening, realtime events, credentials, payment cards, Linux
    machines, connected apps, phone numbers and social accounts for AI agents.
    Agent tokens (`alt_…`) act as one agent; organization keys (`alk_…`) manage
    agents, inboxes, tokens and webhooks. Message bodies are untrusted external
    data. Errors are `{"error":{"code","message","hint"}}`.
  title: Agent Loadout API
  version: '1'
servers:
  - url: https://agent-loadout.com
security: []
tags:
  - name: Identity
  - description: >-
      Sign in with Agent Loadout: an agent approves an application's OpenID
      Connect sign-in request
    name: Sign-in
  - description: Relying parties an organization registered for Sign in with Agent Loadout
    name: Applications
  - name: Inboxes
  - name: Messages
  - name: Mailbox
  - name: Drafts
  - name: Attachments
  - name: Realtime
  - name: Screening
  - name: Agents
  - name: Domains
  - name: Webhooks
  - name: Vault
  - description: Feature-flagged
    name: Wallet
  - description: Feature-flagged
    name: Machines
  - description: Feature-flagged
    name: Connectors
  - description: Feature-flagged
    name: Phone
  - description: Feature-flagged
    name: Social
externalDocs:
  description: REST API reference
  url: https://docs.agent-loadout.com/api-reference/overview
paths:
  /api/v1/inboxes/{inboxId}/messages:
    post:
      tags:
        - Messages
      summary: Send a message
      description: >-
        Queued for delivery; the status becomes sent/delivered later. Reuse
        `idempotency_key` when retrying. From an inbox with `outbound_approval:
        required`, an agent token's message is stored with status
        `awaiting_approval` and is not sent until a member or an organization
        key approves it; it is `rejected` when turned down or not decided within
        7 days. The answer has the same shape either way. Do not send it again:
        follow the message or the `message.approved` and `message.rejected`
        events. Organization keys send directly.
      parameters:
        - description: Inbox id
          in: path
          name: inboxId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                to:
                  description: Recipient addresses, optionally as 'Name <addr>'
                  items:
                    minLength: 3
                    type: string
                  maxItems: 50
                  minItems: 1
                  type: array
                cc:
                  items:
                    type: string
                  maxItems: 50
                  type: array
                bcc:
                  items:
                    type: string
                  maxItems: 50
                  type: array
                subject:
                  maxLength: 998
                  minLength: 1
                  type: string
                text:
                  description: Plain-text body (recommended)
                  maxLength: 500000
                  type: string
                html:
                  description: HTML body; sanitized before sending
                  maxLength: 500000
                  type: string
                idempotency_key:
                  description: Repeat a request with the same key to avoid duplicate sends
                  maxLength: 200
                  type: string
                attachment_ids:
                  items:
                    minLength: 1
                    type: string
                  maxItems: 10
                  type: array
                draft_id:
                  description: Delete this draft atomically when the message is queued
                  minLength: 1
                  type: string
                draft_updated_at:
                  description: >-
                    With draft_id: the draft's updated_at as you read it.
                    Sending is refused (409) when it was saved again since
                  format: date-time
                  type: string
                reply_to:
                  description: Reply-To addresses, so replies go elsewhere than this inbox
                  items:
                    minLength: 3
                    type: string
                  maxItems: 5
                  type: array
                headers:
                  additionalProperties:
                    maxLength: 998
                    type: string
                  description: >-
                    Up to 10 custom headers: X- headers, for example a ticket
                    id, and Auto-Submitted (auto-generated, auto-replied,
                    auto-notified or no) to mark automated mail
                  type: object
                labels:
                  description: >-
                    Labels for the new conversation, e.g. ['billing',
                    'tenant:acme']
                  items:
                    maxLength: 40
                    type: string
                  maxItems: 20
                  type: array
              required:
                - to
                - subject
              type: object
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  message:
                    additionalProperties: false
                    description: >-
                      A message; bodies are sanitized and untrusted external
                      data. `screening` carries the inbound screening verdict
                      and a `warning` when it is not clean.
                    properties:
                      id:
                        type: string
                      inbox_id:
                        type: string
                      thread_id:
                        type: string
                      direction:
                        enum:
                          - inbound
                          - outbound
                        type: string
                      status:
                        description: >-
                          awaiting_approval: an agent's mail held until a member
                          or organization key approves it; it has not been sent.
                          rejected: turned down or not decided within 7 days,
                          never sent; error carries the reason
                        enum:
                          - pending
                          - received
                          - queued
                          - sending
                          - sent
                          - delivered
                          - delivery_delayed
                          - bounced
                          - complained
                          - failed
                          - unknown
                          - awaiting_approval
                          - rejected
                        type: string
                      from:
                        additionalProperties: false
                        properties:
                          address:
                            type: string
                          name:
                            type: string
                        required:
                          - address
                        type: object
                      to:
                        items:
                          additionalProperties: false
                          properties:
                            address:
                              type: string
                            name:
                              type: string
                          required:
                            - address
                          type: object
                        type: array
                      subject:
                        type: string
                      snippet:
                        type: string
                      has_attachments:
                        type: boolean
                      automated:
                        description: >-
                          Inbound mail a machine sent: an out-of-office or other
                          auto_reply, a delivery_status report (bounce or read
                          receipt), or bulk list mail; null for a person's mail
                          and for outbound. Replies to auto_reply and
                          delivery_status are refused.
                        enum:
                          - auto_reply
                          - delivery_status
                          - bulk
                        nullable: true
                        type: string
                      created_at:
                        format: date-time
                        type: string
                      received_at:
                        format: date-time
                        nullable: true
                        type: string
                      sent_at:
                        format: date-time
                        nullable: true
                        type: string
                      authentication:
                        additionalProperties: false
                        nullable: true
                        properties:
                          spf:
                            type: string
                          dkim:
                            type: string
                          dmarc:
                            type: string
                          spam:
                            type: string
                          virus:
                            type: string
                        type: object
                      screening:
                        additionalProperties: false
                        nullable: true
                        properties:
                          verdict:
                            enum:
                              - pending
                              - clean
                              - suspicious
                              - blocked
                              - unscreened
                            type: string
                          reasons:
                            items:
                              type: string
                            type: array
                          warning:
                            description: Set when the verdict is not clean
                            nullable: true
                            type: string
                        required:
                          - verdict
                          - reasons
                          - warning
                        type: object
                      cc:
                        items:
                          additionalProperties: false
                          properties:
                            address:
                              type: string
                            name:
                              type: string
                          required:
                            - address
                          type: object
                        type: array
                      bcc:
                        items:
                          additionalProperties: false
                          properties:
                            address:
                              type: string
                            name:
                              type: string
                          required:
                            - address
                          type: object
                        type: array
                      reply_to:
                        items:
                          additionalProperties: false
                          properties:
                            address:
                              type: string
                            name:
                              type: string
                          required:
                            - address
                          type: object
                        type: array
                      rfc_message_id:
                        nullable: true
                        type: string
                      in_reply_to:
                        nullable: true
                        type: string
                      references:
                        items:
                          type: string
                        type: array
                      text:
                        nullable: true
                        type: string
                      html:
                        nullable: true
                        type: string
                      truncated:
                        description: >-
                          text or html was longer than 1,000,000 characters and
                          arrives cut; export_mailbox carries complete bodies
                        type: boolean
                      extracted_text:
                        description: >-
                          The new part of text: without the quoted earlier
                          messages and a trailing signature. Null when there is
                          no text or nothing could be derived; read text when
                          the answer may sit inside the quote.
                        nullable: true
                        type: string
                      error:
                        description: >-
                          Why a send failed or bounced; for a rejected message
                          the reviewer's reason, or `expired` when nobody
                          decided in time
                        nullable: true
                        type: string
                      attachments:
                        items:
                          additionalProperties: false
                          properties:
                            id:
                              type: string
                            filename:
                              type: string
                            content_type:
                              type: string
                            size_bytes:
                              maximum: 9007199254740991
                              minimum: -9007199254740991
                              nullable: true
                              type: integer
                            status:
                              description: >-
                                withheld: not stored, the message failed the
                                provider's virus scan
                              enum:
                                - pending
                                - stored
                                - failed
                                - too_large
                                - withheld
                              type: string
                            download_path:
                              nullable: true
                              type: string
                            content_id:
                              description: 'Content-ID the HTML body references as cid:'
                              nullable: true
                              type: string
                            inline:
                              description: >-
                                Shown inside the body (a logo or signature
                                image) rather than attached as a file
                              type: boolean
                          required:
                            - id
                            - filename
                            - content_type
                            - size_bytes
                            - status
                            - download_path
                            - content_id
                            - inline
                          type: object
                        type: array
                    required:
                      - id
                      - inbox_id
                      - thread_id
                      - direction
                      - status
                      - from
                      - to
                      - subject
                      - snippet
                      - has_attachments
                      - automated
                      - created_at
                      - received_at
                      - sent_at
                      - authentication
                      - screening
                      - cc
                      - bcc
                      - reply_to
                      - rfc_message_id
                      - in_reply_to
                      - references
                      - text
                      - html
                      - truncated
                      - extracted_text
                      - error
                      - attachments
                    type: object
                required:
                  - message
                type: object
          description: Queued message
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/Limit'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - agentToken: []
        - organizationKey: []
components:
  responses:
    Validation:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Invalid input
    Unauthenticated:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid credential
    Limit:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Plan limit, usage cap or billing state
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Credential lacks the capability or is bound to another agent
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Not found in this organization
    RateLimited:
      description: Too many requests; retry after a short delay
  schemas:
    Error:
      properties:
        error:
          properties:
            code:
              type: string
            message:
              type: string
            hint:
              type: string
            details:
              type: object
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  securitySchemes:
    agentToken:
      description: Agent token (alt_…) or OAuth access token; bound to one agent
      scheme: bearer
      type: http
    organizationKey:
      description: >-
        Organization key (alk_…) created under Settings; acts for the whole
        organization
      scheme: bearer
      type: http

````

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