> ## 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.

# Create or replace a draft



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/inboxes/{inboxId}/drafts
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}/drafts:
    post:
      tags:
        - Drafts
      summary: Create or replace a draft
      parameters:
        - description: Inbox id
          in: path
          name: inboxId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                id:
                  type: string
                to:
                  items:
                    maxLength: 320
                    type: string
                  maxItems: 50
                  type: array
                cc:
                  items:
                    maxLength: 320
                    type: string
                  maxItems: 50
                  type: array
                bcc:
                  items:
                    maxLength: 320
                    type: string
                  maxItems: 50
                  type: array
                subject:
                  maxLength: 998
                  type: string
                text:
                  maxLength: 500000
                  type: string
                html:
                  maxLength: 500000
                  type: string
                attachment_ids:
                  items:
                    minLength: 1
                    type: string
                  maxItems: 10
                  type: array
                expected_updated_at:
                  description: >-
                    With id: the draft's updated_at as you last read it. If the
                    draft was saved since, the save is refused with 409 and the
                    current draft
                  format: date-time
                  type: string
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  draft:
                    additionalProperties: false
                    properties:
                      id:
                        type: string
                      inbox_id:
                        type: string
                      to:
                        items:
                          type: string
                        type: array
                      cc:
                        items:
                          type: string
                        type: array
                      bcc:
                        items:
                          type: string
                        type: array
                      subject:
                        type: string
                      text:
                        nullable: true
                        type: string
                      html:
                        nullable: true
                        type: string
                      attachment_ids:
                        items:
                          type: string
                        type: array
                      created_at:
                        format: date-time
                        type: string
                      updated_at:
                        format: date-time
                        type: string
                    required:
                      - id
                      - inbox_id
                      - to
                      - cc
                      - bcc
                      - subject
                      - text
                      - html
                      - attachment_ids
                      - created_at
                      - updated_at
                    type: object
                required:
                  - draft
                type: object
          description: Draft
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '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
    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.