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

# Drafts API — Save and Send Agent Emails for Human Review

> Create, list, and delete draft emails so agents can stage replies for human review before sending from the Agent Loadout dashboard.

Drafts let an agent compose a reply and save it without sending — a team member can then review and send it directly from the dashboard. This is especially useful for supervised workflows where the agent handles triage and drafting, but a human approves anything that touches billing, account access, or sensitive topics. Saved drafts retain their uploaded file attachments; unused uploads that are not attached to any draft expire automatically after 24 hours.

***

## List drafts

Returns cursor-paginated saved drafts for the specified inbox.

**`GET /api/v1/inboxes/:id/drafts`**

Requires: `email:read`

### Query parameters

<ParamField query="limit" type="integer">
  Number of drafts to return. Range: 1–100. Defaults to 20.
</ParamField>

<ParamField query="cursor" type="string">
  Opaque pagination cursor returned as `next_cursor` in the previous response.
</ParamField>

```bash title="List saved drafts" theme={null}
curl -s "https://agent-loadout.com/api/v1/inboxes/<INBOX_ID>/drafts?limit=20" \
  -H "Authorization: Bearer $AGENT_LOADOUT_TOKEN"
```

***

## Create a draft

Saves a new draft without sending it. Attach existing upload IDs for file attachments, and set `reply_to_message_id` to keep the draft linked to the correct conversation.

**`POST /api/v1/inboxes/:id/drafts`**

Requires: `email:send`

```bash title="Save a draft reply" theme={null}
curl -s -X POST https://agent-loadout.com/api/v1/inboxes/<INBOX_ID>/drafts \
  -H "Authorization: Bearer $AGENT_LOADOUT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to":["customer@example.com"],"subject":"Re: Your question","text":"Draft reply..."}'
```

### Request parameters

<ParamField body="to" type="string[]">
  One or more recipient addresses for the draft. Accepts plain addresses or RFC 5322 `"Name <addr>"` format.
</ParamField>

<ParamField body="subject" type="string">
  Subject line of the draft message.
</ParamField>

<ParamField body="text" type="string">
  Plain-text draft body. Provide at least one of `text` or `html`.
</ParamField>

<ParamField body="html" type="string">
  HTML draft body displayed in email clients that support it.
</ParamField>

<ParamField body="attachment_ids" type="string[]">
  IDs of previously uploaded files to attach to this draft. Upload files first via `POST /api/v1/inboxes/:id/uploads`. Maximum 10 attachments and 10 MB total.
</ParamField>

<ParamField body="reply_to_message_id" type="string">
  ID of the message this draft is a reply to. Links the draft to the correct thread in the dashboard so a team member can send it with proper threading headers.
</ParamField>

<Tip>
  Always set `reply_to_message_id` when drafting a reply. This ensures the dashboard shows the draft in context alongside the customer's original message, making it easy for a team member to review and send.
</Tip>

***

## Delete a draft

Permanently removes a saved draft. Attached files are released and may expire if not referenced elsewhere.

**`DELETE /api/v1/drafts/:id`**

Requires: `email:send`

```bash title="Delete a draft" theme={null}
curl -s -X DELETE https://agent-loadout.com/api/v1/drafts/<DRAFT_ID> \
  -H "Authorization: Bearer $AGENT_LOADOUT_TOKEN"
```

***

## Sending a draft

To promote a draft to a sent message, pass its `draft_id` in the body of the send endpoint. The draft is removed atomically when the message is queued — even if the send is deduplicated by an `idempotency_key`.

```bash title="Send a saved draft" theme={null}
curl -s -X POST https://agent-loadout.com/api/v1/inboxes/<INBOX_ID>/messages \
  -H "Authorization: Bearer $AGENT_LOADOUT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["customer@example.com"],
    "subject": "Re: Your question",
    "text": "Draft reply...",
    "draft_id": "<DRAFT_ID>",
    "idempotency_key": "reply-draft-<DRAFT_ID>"
  }'
```

<Note>
  Sending requires the `email:send` scope. On the Free Sandbox, sends are limited to verified recipients (25 per month, 5 per day). A paid plan is required for production support workflows.
</Note>

***

## Attachment lifecycle

<CardGroup cols={2}>
  <Card title="Uploads (unsaved)" icon="clock">
    Files uploaded via `POST /api/v1/inboxes/:id/uploads` but not yet attached to a draft or message expire after **24 hours**.
  </Card>

  <Card title="Draft attachments" icon="file">
    Files referenced in a saved draft are retained as long as the draft exists. Deleting the draft releases the files.
  </Card>
</CardGroup>
