Emails
2 endpoints
/v1/emails/conversationsList email conversations
Returns a paginated list of the account's email threads (cursor v2). Stable
sort: last_ — conversations with a
recent exchange come first. last_ is NOT NULL in the table.
Read-only
The public API only exposes the list of threads. The individual
messages of a conversation aren't available through the
public API yet — the payload is limited to the thread's metadata.
To send an email, use POST /.
email:readQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | null | optional | Opaque pagination cursor: pass the pagination. value from the previous page. |
limit | integer | optional | Maximum number of results per page (default 20, max 100). Above that → 400 invalid_request. |
created_after | string | optional | Filter: only resources created after this date (inclusive). |
created_before | string | optional | Filter: only resources created before this date (inclusive). |
Responses
| Status | Description |
|---|---|
200 | Paginated list of email conversations. |
400 | Invalid request.
|
401 | The API key is missing, unknown or expired.
|
403 | Authorization refused.
|
429 | Rate limit reached.
|
500 | Unexpected server error. Always include the
|
501 | Test keys (
|
503 | A service the request depends on didn't respond (reading the key, the
account or the plan). The same request will go through once it's back:
retry after the
|
Example request
curl -X GET 'https://api.capturia.io/v1/emails/conversations' \
-H 'Authorization: Bearer cap_live_<your-key>' \
-H 'Content-Type: application/json'/v1/emails/sendSend an email to a record
Queues an email to a record of the account, for delivery through
Resend. The send is created with status= and delivered
asynchronously by the worker — the 201 response confirms the email was
queued, not that it was delivered.
A commercial message (CASL)
An email to a prospect is a commercial electronic message under Canada's Anti-Spam Legislation. It follows the same rules as an email written by hand in Capturia:
tomust be the address of a record of the account, otherwise422 missing_, reasonconsent not_(create the record with its consent first, througha_ contact POST /orv1/ contacts POST /);v1/ leads/ capture - an unsubscribed address is refused:
409 recipient_;unsubscribed - an address with no consent basis (no consent, no recent request from
that address) is refused:
422 missing_, reasonconsent no_;consent - the email goes out with the account's legal footer and an unsubscribe link, and the worker checks unsubscribes and consent again when it sends it;
- the account must have a postal address (legal footer): otherwise
422 missing_;postal_ address - if a seller has taken the record over, the email is cancelled when it is sent (it doesn't go out, even after the agent is turned back on); during a timed pause of the agent, it is deferred to the end of the pause, like other automatic sends;
- a reply from the recipient asking to stop receiving emails
unsubscribes their address, as for a sequence: later calls to it are
refused (
409 recipient_).unsubscribed
Sender resolved server-side
The sender (from) is derived from the account's default sender
(client_). If no default
sender is configured, the request returns
400 no_.
Idempotency
The Idempotency- header is recommended: a retry with the same
key returns the first call's response, without a second email. The key
has 16 to 128 [A- characters, otherwise
400 invalid_; an empty header counts as a request without a
key. Reused with another body, the key is refused
(409 idempotency_, details. is payload_);
while the request that carries it is still in progress, a retry receives
409 idempotency_ (in_) with Retry-. The same
key is still recognized after the idempotency memory expires (24 h) or
from another API key of the account: the same call returns the email
already queued, even once the worker has filled in its variables.
Test mode
"test": true in the body lets you validate an integration without
targeting a real contact: personalization variables are
filled with sample values, the subject is prefixed with
[TEST], and recipient compliance checks are
bypassed. In exchange, the recipient must be an active member
of the account's team (otherwise 400 recipient_), and
a quota of 50 tests per rolling 24 hours applies, shared with the
platform's test buttons (otherwise 429 test_).
email:sendHeaders
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | optional | Idempotency key: 16 to 128 [A- characters (a UUID v4 or a ULID works). A key of any other
shape is refused with 400 invalid_ (details.: idempotency-); an empty header counts as
a request without a key. A second request with the same key and the same payload returns the original
response, with the Idempotency- header, without repeating the operation; the same key with
a different payload is refused with 409 idempotency_. Stored for 24 h. Optional but recommended. |
Request body
| Property | Type | Required | Description |
|---|---|---|---|
to | string | required | Email recipient. Validated against the standard email pattern
(^[^\s@]+@[^\s@]+\.). An invalid format returns
400 validation_. |
subject | string | required | Email subject (free text, no explicit length cap in the API). |
body | string | required | Email body in HTML. The content isn't validated at request time —
the sending worker sanitizes it before handing it to Resend for
delivery. Personalization variables ({{first_, etc.) are filled
when it goes out; a variable the sending service doesn't know or can't
read ({{prénom}}, {{contact.) makes the send fail, test
included, with the reason message_: nothing
goes out between braces. A link, a date or the business name cited with
no value for this contact and no fallback ({{booking_ without an
appointment) makes the real send fail with the reason
message_: nothing goes out with a gap. |
test | boolean | optional | Test mode. When true, the send is treated as an operational
test: personalization variables ({{first_,
etc.) are filled with sample values, the subject is
prefixed with [TEST], and recipient compliance checks
(unsubscribe, consent) are bypassed.
In exchange, two safeguards apply:
the recipient (to) must be an active member of the account's
team — otherwise 400 recipient_;
a quota of 50 test sends per rolling 24 hours, shared with
the platform's test buttons — otherwise 429
test_.
A test send creates neither a conversation nor any history on a
contact. |
Responses
| Status | Description |
|---|---|
201 | Email queued. |
400 | Invalid request.
|
401 | The API key is missing, unknown or expired.
|
403 | Authorization refused.
|
409 | Conflict with the resource's state.
|
413 | The request body exceeds 1 MB (1,048,576 bytes).
|
415 | The
|
422 | Request refused.
|
429 | Limit reached.
|
500 | Unexpected server error. Always include the
|
501 | Test keys (
|
503 | A service the request depends on didn't respond (reading the key, the
account or the plan). The same request will go through once it's back:
retry after the
|
Example request
curl -X POST 'https://api.capturia.io/v1/emails/send' \
-H 'Authorization: Bearer cap_live_<your-key>' \
-H 'Content-Type: application/json' \
-d '{
"to": "[email protected]",
"subject": "Suivi de notre échange",
"body": "<p>Bonjour Alex,</p><p>Voici les détails dont nous avons parlé.</p>"
}'