---
title: "Create a draft"
method: POST
path: "/v1/mailboxes/{id}/drafts"
tags: ["Mailboxes"]
---

# Create a draft

`POST /v1/mailboxes/{id}/drafts`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/mailboxes/{id}/drafts`
- Auth: API key in header `x-api-key`

Saves a draft of a new message, or of a reply when `inReplyToMessageId` names a message in the mailbox, and returns it with status 201. A phone channel's draft holds a recipient number and text. Send it with `POST /v1/mailboxes/{id}/drafts/{draftId}/send`.

## Path parameters

- `id` string, required

## Request body

- CreateMailboxDraftPayload
  - `channel` 'email', nullable
  - `endpointId` string
  - `to` string[], nullable
  - `cc` string[], nullable
  - `bcc` string[], nullable
  - `replyTo` string[], nullable
  - `subject` string, nullable
  - `text` string, nullable
  - `html` string, nullable
  - `attachments` EmailAttachment[], nullable
    - `filename` string, required
    - `content` string, nullable
    - `mediaId` string
    - `contentType` string, required
    - `size` integer, required
  - `inReplyToMessageId` string

## Response `201`

Success

- MailboxDraft
  - `id` string, required
  - `channel` 'email', required
  - `threadId` string, required
  - `inReplyToMessageId` string, required
  - `state` 'saved' | 'locked' | 'sent', required
  - `lockedByActionId` string, required
  - `to` string[], required
  - `subject` string, nullable, required
  - `createdAt` string, required
  - `updatedAt` string, required
  - `endpointId` string, required
  - `cc` string[], required
  - `bcc` string[], required
  - `replyTo` string[], required
  - `html` string, nullable, required
  - `text` string, nullable, required
  - `attachments` EmailAttachment[], required
    - `filename` string, required
    - `content` string, nullable
    - `mediaId` string
    - `contentType` string, required
    - `size` integer, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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