Saltar al contenido
Esc
↑↓navegar↵abrir⌘Jvista previa

Send a draft

Sends the draft from the inbox address; the body is optional and only ever holds headers, which are not supported (an empty value is fine), and an Idempotency-Key is accepted. Answers the sent email’s id. A draft waiting for approval goes out only when a person or a team-wide full access key sends it (403 approval_required otherwise), and their send skips the inbox’s rules but never the team’s limits or the shared domain’s rules. An agent’s send of a draft runs the rules and may hold it (202).

POST/inboxes/{inbox_id}/drafts/{draft_id}/send
Autorización
AuthorizationToken Bearer · headerobligatorio

A BillionSend API key (bs_…).

Parámetros de ruta
inbox_idstringobligatorio

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

draft_idstring<uuid>obligatorio
Parámetros de encabezado
Idempotency-Keystring

1 to 256 characters. A retry with the same key and the same body answers the original response instead of sending again; the same key with a different body answers 409 invalid_idempotent_request.

longitud mín. 1 · longitud máx. 256
Cuerpo de la solicitud
application/json
headersany

Not supported: only an empty value is accepted, anything else answers 422

Respuestas
200

Sent

idstring<uuid>obligatorio

The ID of the sent email: GET /emails/{id} reads it

thread_idstring<uuid> | nullobligatorio

BillionSend extension: the thread the email was sent in

202

Held for approval

objectstringobligatorio
Valores permitidos:inbox_draft
idstring<uuid>obligatorio
typestringobligatorio
Valores permitidos:standalonereply
tostring[] | nullobligatorio
ccstring[]obligatorio
bccstring[]obligatorio
subjectstring | nullobligatorio
htmlstring | nullobligatorio
textstring | nullobligatorio
thread_idstring<uuid> | nullobligatorio
reply_to_email_idstring<uuid> | nullobligatorio
email_idstring<uuid> | nullobligatorio
created_atstringobligatorio
updated_atstringobligatorio
attachmentsobject[]obligatorio

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

Mostrar propiedades
Array de object
idstringobligatorio
filenamestringobligatorio
content_typestringobligatorio
sizeintegerobligatorio
statusstringobligatorio
Valores permitidos:draftpending_approvalsentrejectedexpired
approval_reasonsstring[]obligatorio
forwardbooleanobligatorio
decided_bystring | nullobligatorio
decided_atstring | nullobligatorio
expires_atstring | nullobligatorio
send_atstring | nullobligatorio

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

send_errorstring | nullobligatorio

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

400

Malformed JSON body

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
401

Missing, malformed, unknown or revoked API key

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
403

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

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
404

Not found

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
409

Idempotency conflict, or a draft already sent

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
422

Validation error

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
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)

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
Pruébalo
Servidor
Autorización
Parámetros
Cuerpoapplication/json
Solicitud
curl -X POST 'https://api.billionsend.com/inboxes/string/drafts/497f6eca-6276-4993-bfeb-53cbbbba6f08/send' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "headers": null
}'
Respuesta
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84"
}

¿Te ha resultado útil esta página?