Aller au contenu
Esc
↑↓naviguer↵ouvrir⌘Japerçu

Update a draft

Each given field replaces the stored one; null clears it. Setting html or text replaces the whole body: the part left out becomes null. attachments replaces the whole list (null or an empty list removes the files). A sent draft, or one that changed during the request, answers 409. An edit by an agent sends a draft waiting for approval back to draft. send_at (BillionSend extension) schedules the draft to be sent as the caller, or reschedules it, and clears send_error; null cancels the schedule. A draft waiting for approval cannot be scheduled (409). When the scheduled send goes out, the draft becomes sent; when the inbox’s rules hold it, pending_approval; when it is refused (the key revoked, the inbox deleted, a limit reached), it stays a draft with send_at null, send_error set and an inbox.draft.send_failed webhook.

PATCH/inboxes/{inbox_id}/drafts/{draft_id}
Autorisation
AuthorizationJeton Bearer · headerrequis

A BillionSend API key (bs_…).

Paramètres de chemin
inbox_idstringrequis

The inbox ID or its email address, such as support@example.com

draft_idstring<uuid>requis
Corps de la requête
application/json
tostring | string[] | null

An address or a list of them; "Name <address>" works too

Afficher les propriétés
Au moins un de :
string
string
string[]
Tableau de string
string
null
null
ccstring | string[] | null

An address or a list of them; "Name <address>" works too

Afficher les propriétés
Au moins un de :
string
string
string[]
Tableau de string
string
null
null
bccstring | string[] | null

An address or a list of them; "Name <address>" works too

Afficher les propriétés
Au moins un de :
string
string
string[]
Tableau de string
string
null
null
subjectstring | null
htmlstring | null
textstring | null
attachmentsobject[] | null

Files with base64 content (no remote paths), 10 MiB decoded in all; none on the shared domain. A held send keeps them with its draft

Afficher les propriétés
Tableau de object
filenamestring | boolean | null
Afficher les propriétés
Au moins un de :
string
string
boolean
boolean
null
null
contentstring
content_typestring
content_idstring

Inline part: the HTML shows it with <img src="cid:<content_id>">

longueur min 1 · longueur max 255
pathstring
send_atstring | null

BillionSend extension: send the draft at this time, as the caller, within 30 days: an ISO 8601 datetime with offset (e.g. "2026-09-01T12:00:00Z") or a relative time like "in 2 hours". A past time sends it within a minute; null cancels. The send runs every rule and limit then; a refused one leaves the draft unsent with send_error set and fires inbox.draft.send_failed. A draft waiting for approval cannot be scheduled (409)

Réponses
200

Draft

objectstringrequis
Valeurs autorisées :inbox_draft
idstring<uuid>requis
typestringrequis
Valeurs autorisées :standalonereply
tostring[] | nullrequis
ccstring[]requis
bccstring[]requis
subjectstring | nullrequis
htmlstring | nullrequis
textstring | nullrequis
thread_idstring<uuid> | nullrequis
reply_to_email_idstring<uuid> | nullrequis
email_idstring<uuid> | nullrequis
created_atstringrequis
updated_atstringrequis
attachmentsobject[]requis

The draft's files, by position; empty once it is sent, rejected or expired

Afficher les propriétés
Tableau de object
idstringrequis
filenamestringrequis
content_typestringrequis
sizeintegerrequis
statusstringrequis
Valeurs autorisées :draftpending_approvalsentrejectedexpired
approval_reasonsstring[]requis
forwardbooleanrequis
decided_bystring | nullrequis
decided_atstring | nullrequis
expires_atstring | nullrequis
send_atstring | nullrequis

BillionSend extension: when the scheduled send goes out; null when not scheduled

send_errorstring | nullrequis

BillionSend extension: the error name of the last scheduled send that was refused (e.g. invalid_api_key, inbox_send_cap_reached, not_found); null otherwise

401

Missing, malformed, unknown or revoked API key

statusCodenumberrequis
namestringrequis
messagestringrequis
403

Restricted API key, the inbox's or the shared domain's rules, or held mail

statusCodenumberrequis
namestringrequis
messagestringrequis
404

Not found

statusCodenumberrequis
namestringrequis
messagestringrequis
409

Idempotency conflict, or a draft already sent

statusCodenumberrequis
namestringrequis
messagestringrequis
422

Validation error

statusCodenumberrequis
namestringrequis
messagestringrequis
429

The inbox's daily send limit, or the team's daily limit for mail from the shared domain, or the rate limit (rate_limit_exceeded, with Retry-After)

statusCodenumberrequis
namestringrequis
messagestringrequis
Essayer
Serveur
Autorisation
Paramètres
Corpsapplication/json
Requête
curl -X PATCH 'https://api.billionsend.com/inboxes/string/drafts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": "string",
  "cc": "string",
  "bcc": "string",
  "subject": "string",
  "html": "string",
  "text": "string",
  "attachments": [
    {
      "filename": "string",
      "content": "string",
      "content_type": "string",
      "content_id": "string",
      "path": "string"
    }
  ],
  "send_at": "string"
}'
Réponse
{
  "object": "inbox_draft",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "standalone",
  "to": [
    "string"
  ],
  "cc": [
    "string"
  ],
  "bcc": [
    "string"
  ],
  "subject": "string",
  "html": "string",
  "text": "string",
  "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",
  "reply_to_email_id": "5e00f13a-4994-422b-8a76-6ae8ac072852",
  "email_id": "8e6bf5ae-e456-4654-87f8-33e2156caffc",
  "created_at": "string",
  "updated_at": "string",
  "attachments": [
    {
      "id": "string",
      "filename": "string",
      "content_type": "string",
      "size": 0
    }
  ],
  "status": "draft",
  "approval_reasons": [
    "string"
  ],
  "forward": true,
  "decided_by": "string",
  "decided_at": "string",
  "expires_at": "string",
  "send_at": "string",
  "send_error": "string"
}

Cette page vous a-t-elle été utile ?