---
title: "Update a draft"
method: PATCH
path: "/v1/inboxes/{id}/drafts/{did}"
tags: ["Drafts"]
---

# Update a draft

`PATCH /v1/inboxes/{id}/drafts/{did}`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/v1/inboxes/{id}/drafts/{did}`
- Auth: API key in header `X-API-Key`

Merge-patch. Omitted fields are left as-is. Set `sendAt` to schedule or
reschedule the send (this also clears `sendError`); `sendAt: null`
cancels it.

## Request body

- DraftInput
  - `to` union
    - string, email
    - string[]
  - `cc` union
    - string, email
    - string[]
  - `bcc` union
    - string, email
    - string[]
  - `subject` string
  - `plainBody` string
  - `htmlBody` string
  - `replyToMessageId` string, uuid
  - `labels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `sendAt` string, date-time, nullable: Schedule the send: ISO 8601 with an offset, e.g. `2026-10-01T09:00:00-04:00`. Must be in the future and at most 90 days ahead. A scheduled draft needs at least one recipient and a body. On update, `null` cancels the schedule. Anjal checks for due drafts about every 20 seconds. If the send fails, the draft is kept, `sendError` is set, `sendAt` is cleared and `draft.send_failed` fires.

## Response `200`

Updated

- object
  - `id` string, uuid
  - `inboxId` string, uuid
  - `to` string[]
  - `cc` string[]
  - `bcc` string[]
  - `subject` string
  - `plainBody` string, nullable
  - `htmlBody` string, nullable
  - `replyToMessageId` string, uuid, nullable
  - `labels` string[]: Applied to the message when the draft is sent.
  - `sendAt` string, date-time, nullable: When Anjal will send this draft. Null if not scheduled.
  - `sendError` string, nullable: Why the last scheduled send failed. The draft is kept and `sendAt` is cleared.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `updated` boolean

## Other responses

- `400`: Request body failed schema validation

---

[API](https://skmtc.dev/anjal/apis/anjal-api.md) · [All operations](https://skmtc.dev/anjal/apis/anjal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anjal/apis/anjal-api/revisions/a4044778e294?raw)
