API reference

Batches

Broadcast one template to a list of recipients over a dedicated queue.

Create a batch

POST/v1/batches202 Accepted

Request body

FieldTypeNotes
No fields.

Response

FieldTypeNotes
idrequiredstring
objectrequired"message_batch"
statusrequired"pending" | "enqueuing" | "sending" | "paused" | "completed" | "failed" | "cancelled"
environmentrequired"sandbox" | "production"
namerequiredstring | null
template_namerequiredstring | null
recipient_countrequiredinteger
range 0..9007199254740991
enqueued_countrequiredinteger
range 0..9007199254740991
sent_countrequiredinteger
range 0..9007199254740991
failed_countrequiredinteger
range 0..9007199254740991
error_messagerequiredstring | null
trace_idrequiredstring
scheduled_forrequiredstring<ISO-8601> | null
started_atrequiredstring<ISO-8601> | null
completed_atrequiredstring<ISO-8601> | null
created_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

Retrieve a batch

GET/v1/batches/{'{id}'}

Response

FieldTypeNotes
idrequiredstring
objectrequired"message_batch"
statusrequired"pending" | "enqueuing" | "sending" | "paused" | "completed" | "failed" | "cancelled"
environmentrequired"sandbox" | "production"
namerequiredstring | null
template_namerequiredstring | null
recipient_countrequiredinteger
range 0..9007199254740991
enqueued_countrequiredinteger
range 0..9007199254740991
sent_countrequiredinteger
range 0..9007199254740991
failed_countrequiredinteger
range 0..9007199254740991
error_messagerequiredstring | null
trace_idrequiredstring
scheduled_forrequiredstring<ISO-8601> | null
started_atrequiredstring<ISO-8601> | null
completed_atrequiredstring<ISO-8601> | null
created_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

List batches

GET/v1/batches

Response

FieldTypeNotes
objectrequired"list"
datarequiredobject[]
has_morerequiredboolean
next_cursorrequiredstring | null

Control a batch

POST/v1/batches/{'{id}'}/pause
POST/v1/batches/{'{id}'}/resume
POST/v1/batches/{'{id}'}/cancel

Response

FieldTypeNotes
idrequiredstring
objectrequired"message_batch"
statusrequired"pending" | "enqueuing" | "sending" | "paused" | "completed" | "failed" | "cancelled"
environmentrequired"sandbox" | "production"
namerequiredstring | null
template_namerequiredstring | null
recipient_countrequiredinteger
range 0..9007199254740991
enqueued_countrequiredinteger
range 0..9007199254740991
sent_countrequiredinteger
range 0..9007199254740991
failed_countrequiredinteger
range 0..9007199254740991
error_messagerequiredstring | null
trace_idrequiredstring
scheduled_forrequiredstring<ISO-8601> | null
started_atrequiredstring<ISO-8601> | null
completed_atrequiredstring<ISO-8601> | null
created_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

Export failures

GET/v1/batches/{'{id}'}/failures

Response

FieldTypeNotes
objectrequired"message_batch_failure_export"
batch_idrequiredstring
generated_atrequiredstring<ISO-8601>
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
rowsrequiredobject[]