Saltar al contenido principal

Messages

Submit certified messages and read their state.

GET /v1/messages​

List messages of the tenant

Newest first. Combine from/to with status, or look up by clientTrackId.

  • Authentication: API key in the Authorization: Bearer header
  • Scopes: at least one of messages:read
  • operationId: listMessages

Parameters​

NameInTypeRequiredDescription
clientTrackIdquerystringNoOnly the message submitted with this clientTrackId (up to 128 characters).
fromqueryTimestampNoAccepted at or after this instant.
toqueryTimestampNoAccepted before this instant.
statusqueryRecipientStatusNoOnly messages with at least one recipient in this state.
cursorqueryCursorNoOpaque pagination token. Do not parse or build it.
limitqueryintegerNoMaximum number of items per page, from 1 to 200 (default 50).
If-None-MatchheaderstringNoETag of a previous response; a match answers 304 without a body.

Responses​

CodeDescriptionSchema
200A page of messages.MessagePage
304Not modified since the ETag sent in If-None-Match.—
400The request is malformed. The body is not valid JSON or not a JSON object, a field is invalid (errors lists each one), a header or query parameter is invalid, or the Content-Type is not application/json where a JSON body is expected (unsupported_media on the control plane).Problem
401Missing or invalid API key.Problem
403The API key is not allowed to perform this operation.Problem
429Rate limit or quota exceeded.Problem
500Unexpected failure (internal_error). The request may be retried; keep the requestId when contacting support.Problem
503A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present.Problem

POST /v1/messages​

Submit a certified message

Accepts a message for certified delivery. Nothing is sent before the request is durably recorded, so a 202 means the message will be processed exactly once.

  • Authentication: API key in the Authorization: Bearer header
  • Scopes: at least one of messages:write
  • operationId: submitMessage

Parameters​

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesClient-generated key, scoped to the tenant. Repeating a request with the same key and the same body returns the original response with Idempotent-Replayed: true; the same key with a different body is rejected with 422 idempotency_key_reused.

Request body (application/json)​

FieldTypeRequiredDescription
fromEmailAddressYesSender address. It must be an authorized sender of the tenant, according to the sender policy.
tolist of EmailAddressYesEach recipient is sent, tracked and certified individually.
cclist of EmailAddressNoRecipients in copy, up to 50.
bcclist of EmailAddressNoA blind recipient never appears in the evidence of another recipient.
replyToEmailAddressNoAddress that receives the replies, when it differs from the sender.
subjectstringYesSubject of the message (1 to 998 characters, no control characters).
htmlstringNoHTML body. At least one of html or text is required.
textstringNoPlain-text body. At least one of html or text is required.
attachmentslist of InlineAttachment or UploadedAttachmentNoAttachments of the message, up to 50: inline (filename and contentBase64) or uploaded beforehand (attachmentId).
optionsMessageOptionsNoPer-message overrides of the configuration. Each one is resolved against the tenant, plan and platform levels and capped by their ceilings; the values really applied are returned in effectiveOptions.
clientTrackIdstringNoCaller's own reference; searchable with GET /v1/messages?clientTrackId=.
metadataobjectNoFree key/value pairs echoed back in queries and webhooks.

Responses​

CodeDescriptionSchema
200Replay of a request already accepted with the same Idempotency-Key.SubmitMessageResponse
202Accepted for delivery.SubmitMessageResponse
400The request is malformed. The body is not valid JSON or not a JSON object, a field is invalid (errors lists each one), a header or query parameter is invalid, or the Content-Type is not application/json where a JSON body is expected (unsupported_media on the control plane).Problem
401Missing or invalid API key.Problem
403The API key is not allowed to perform this operation.Problem
409A request with the same Idempotency-Key is still being processed (idempotency_request_in_progress). Retry after the number of seconds in Retry-After.Problem
413The message exceeds api.inline.maxBytes or api.message.maxBytes.Problem
422The request is well formed but cannot be accepted.Problem
429Rate limit or quota exceeded.Problem
503A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present.Problem

GET /v1/messages/{trackId}​

Read a message and the state of each recipient

Returns the message metadata, per-recipient delivery/interaction state, and each recipient's certification summary (state, pendingEvents, expectedBy, latestReceipt). The ETag changes whenever any field in the representation—including certification—changes; send If-None-Match to receive 304 Not Modified when unchanged.

  • Authentication: API key in the Authorization: Bearer header
  • Scopes: at least one of messages:read
  • operationId: getMessage

Parameters​

NameInTypeRequiredDescription
trackIdpathTrackIdYesServer-generated ULID that identifies a message.
If-None-MatchheaderstringNoETag of a previous response; a match answers 304 without a body.

Responses​

CodeDescriptionSchema
200The message.Message
304Not modified since the ETag sent in If-None-Match.—
401Missing or invalid API key.Problem
403The API key is not allowed to perform this operation.Problem
404The resource does not exist or belongs to another tenant.Problem
429Rate limit or quota exceeded.Problem
500Unexpected failure (internal_error). The request may be retried; keep the requestId when contacting support.Problem
503A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present.Problem