Capturia measures its ads and site traffic with the Meta pixel and Google Analytics. You can decline at any time. Learn more

FR

Emails

2 endpoints

get/v1/emails/conversations

List email conversations

Returns a paginated list of the account's email threads (cursor v2). Stable sort: last_message_at DESC, id DESC — conversations with a recent exchange come first. last_message_at 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 /v1/emails/send.

Required scopes: email:read

Query parameters

NameTypeRequiredDescription
cursorstring | nulloptionalOpaque pagination cursor: pass the pagination.next_cursor value from the previous page.
limitintegeroptionalMaximum number of results per page (default 20, max 100). Above that → 400 invalid_request.
created_afterstringoptionalFilter: only resources created after this date (inclusive).
created_beforestringoptionalFilter: only resources created before this date (inclusive).

Responses

StatusDescription
200

Paginated list of email conversations.

400

Invalid request. code tells apart the refusals the operation returns under this status, and each example shows one.

invalid_requestlimit · exceeds_max
{
  "error": {
    "type": "validation_error",
    "code": "invalid_request",
    "message": "Request format is invalid.",
    "hint": "Check that headers, body and JSON encoding match the API contract documented in the API Reference.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_request",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "field": "limit",
      "reason": "exceeds_max",
      "max": 100
    }
  }
}
invalid_requestcursor · cursor_invalid_format
{
  "error": {
    "type": "validation_error",
    "code": "invalid_request",
    "message": "Request format is invalid.",
    "hint": "Check that headers, body and JSON encoding match the API contract documented in the API Reference.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_request",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "field": "cursor",
      "reason": "cursor_invalid_format"
    }
  }
}
401

The API key is missing, unknown or expired. code tells the three causes apart: missing_api_key (no Authorization: Bearer header), invalid_api_key (unknown or revoked key, or invalid format) and expired_api_key (expiration date has passed).

missing_api_key
{
  "error": {
    "type": "authentication_error",
    "code": "missing_api_key",
    "message": "No API key was provided.",
    "hint": "Add an Authorization header in the form: Bearer cap_live_<your_key>",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#missing_api_key",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
invalid_api_key
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "API key is invalid or has been revoked.",
    "hint": "Verify the key in your dashboard or generate a new one.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#invalid_api_key",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
expired_api_key
{
  "error": {
    "type": "authentication_error",
    "code": "expired_api_key",
    "message": "API key has expired.",
    "hint": "Roll the key from the dashboard to generate a new valid one.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#expired_api_key",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
403

Authorization refused. code tells apart the refusals the operation returns under this status, and each example shows one.

browser_not_allowed
{
  "error": {
    "type": "authorization_error",
    "code": "browser_not_allowed",
    "message": "API keys must be used from a server, never from a browser.",
    "hint": "The request carries an `Origin` header: call the API from your server, where the key stays secret.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#browser_not_allowed",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
account_suspended
{
  "error": {
    "type": "authorization_error",
    "code": "account_suspended",
    "message": "Access to this account is suspended by the Capturia team.",
    "hint": "The refusal comes from the account, not the key. While the suspension lasts, no request is accepted: contact the Capturia team.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#account_suspended",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
feature_not_available
{
  "error": {
    "type": "authorization_error",
    "code": "feature_not_available",
    "message": "This feature is not included in your plan.",
    "hint": "The rejection comes from the account's plan, not the key. Contact your Capturia advisor to talk it over.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#plan",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "feature": "public_api"
    }
  }
}
insufficient_scope
{
  "error": {
    "type": "authorization_error",
    "code": "insufficient_scope",
    "message": "This API key does not contain the required scope for this endpoint.",
    "hint": "This key is missing the `email:read` scope. Create a new key with the \"Read only\" preset or add the scope via the dashboard.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#scopes",
    "dashboard_url": "https://capturia.io/platform/dashboard/admin/integrations/api-keys/6f1e2d3c-4b5a-4c6d-8e7f-9a0b1c2d3e4f?tab=permissions",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "required_scope": "email:read",
      "current_scopes": [
        "leads:capture"
      ],
      "suggested_preset": "read_only"
    }
  }
}
429

Rate limit reached. rate_limit_exceeded: the key's hourly quota is used up. too_many_attempts: too many invalid keys presented from this IP address (brute-force protection). In both cases, Retry-After gives the delay in seconds.

rate_limit_exceeded
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded.",
    "hint": "Retry after the number of seconds in retry_after_seconds, and consider implementing exponential backoff.",
    "doc_url": "https://capturia.io/en/developers/api/v1/rate-limits",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "limit": 100,
      "count": 100,
      "limit_type": "per_key",
      "retry_after_seconds": 42
    }
  }
}
too_many_attempts
{
  "error": {
    "type": "rate_limit_error",
    "code": "too_many_attempts",
    "message": "Too many invalid authentication attempts from this IP.",
    "hint": "Wait the period indicated by retry_after_seconds before trying again.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#brute-force",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "limit_type": "brute_force",
      "retry_after_seconds": 300
    }
  }
}
500

Unexpected server error. Always include the request_id when contacting support.

internal_error
{
  "error": {
    "type": "server_error",
    "code": "internal_error",
    "message": "Server error. The Capturia team has been notified.",
    "hint": "If this persists, contact support and include the request_id from this response.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#internal_error",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
501

Test keys (cap_test_) aren't served yet: only cap_live_ keys are accepted.

not_implemented
{
  "error": {
    "type": "server_error",
    "code": "not_implemented",
    "message": "This feature is not yet implemented.",
    "hint": "Check the API documentation for available features and the changelog for upcoming releases.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_implemented",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
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 Retry-After delay.

service_unavailable
{
  "error": {
    "type": "server_error",
    "code": "service_unavailable",
    "message": "Service temporarily unavailable.",
    "hint": "Retry after the period indicated by Retry-After.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#service_unavailable",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}

Example request

curl -X GET 'https://api.capturia.io/v1/emails/conversations' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json'
post/v1/emails/send

Send an email to a record

Queues an email to a record of the account, for delivery through Resend. The send is created with status="queued" 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:

  • to must be the address of a record of the account, otherwise 422 missing_consent, reason not_a_contact (create the record with its consent first, through POST /v1/contacts or 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_consent, reason 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_email_senders.is_default = true). If no default sender is configured, the request returns 400 no_sender_configured.

Idempotency

The Idempotency-Key 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-Za-z0-9_-] characters, otherwise 400 invalid_request; an empty header counts as a request without a key. Reused with another body, the key is refused (409 idempotency_conflict, details.reason is payload_mismatch); while the request that carries it is still in progress, a retry receives 409 idempotency_conflict (in_flight) with Retry-After. 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_not_allowed), and a quota of 50 tests per rolling 24 hours applies, shared with the platform's test buttons (otherwise 429 test_quota_exceeded).

Required scopes: email:send

Headers

NameTypeRequiredDescription
Idempotency-KeystringoptionalIdempotency key: 16 to 128 [A-Za-z0-9_-] characters (a UUID v4 or a ULID works). A key of any other shape is refused with 400 invalid_request (details.field: idempotency-key); 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-Replayed: true header, without repeating the operation; the same key with a different payload is refused with 409 idempotency_conflict. Stored for 24 h. Optional but recommended.

Request body

PropertyTypeRequiredDescription
tostringrequiredEmail recipient. Validated against the standard email pattern (^[^\s@]+@[^\s@]+\.[^\s@]+$). An invalid format returns 400 validation_error.
subjectstringrequiredEmail subject (free text, no explicit length cap in the API).
bodystringrequiredEmail 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_name}}, etc.) are filled when it goes out; a variable the sending service doesn't know or can't read ({{prénom}}, {{contact.first_name}}) makes the send fail, test included, with the reason message_variable_left:<variable>: nothing goes out between braces. A link, a date or the business name cited with no value for this contact and no fallback ({{booking_date}} without an appointment) makes the real send fail with the reason message_value_missing:<variable>: nothing goes out with a gap.
testbooleanoptionalTest mode. When true, the send is treated as an operational test: personalization variables ({{first_name}}, 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_not_allowed; a quota of 50 test sends per rolling 24 hours, shared with the platform's test buttons — otherwise 429 test_quota_exceeded. A test send creates neither a conversation nor any history on a contact.

Responses

StatusDescription
201

Email queued.

400

Invalid request. code tells apart the refusals the operation returns under this status, and each example shows one.

invalid_request
{
  "error": {
    "type": "validation_error",
    "code": "invalid_request",
    "message": "Request format is invalid.",
    "hint": "Check that headers, body and JSON encoding match the API contract documented in the API Reference.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_request",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
invalid_encoding
{
  "error": {
    "type": "validation_error",
    "code": "invalid_encoding",
    "message": "Request encoding must be UTF-8.",
    "hint": "Use Content-Type: application/json; charset=utf-8.",
    "doc_url": "https://capturia.io/en/developers/api/v1/conventions#encoding",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
invalid_json
{
  "error": {
    "type": "validation_error",
    "code": "invalid_json",
    "message": "The request body is not valid JSON.",
    "hint": "Check the JSON syntax (quotes, commas, braces) and its UTF-8 encoding.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_json",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
invalid_body
{
  "error": {
    "type": "validation_error",
    "code": "invalid_body",
    "message": "The request body must be a JSON object.",
    "hint": "Send an object (`{ ... }`): this endpoint accepts no array, string or number.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_body",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
validation_error
{
  "error": {
    "type": "validation_error",
    "code": "validation_error",
    "message": "Request validation failed.",
    "hint": "`details` names each field to fix and the reason it was refused.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#validation_error",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "to",
        "reason": "invalid_format"
      }
    ]
  }
}
invalid_requestidempotency-key · invalid_format
{
  "error": {
    "type": "validation_error",
    "code": "invalid_request",
    "message": "Request format is invalid.",
    "hint": "Check that headers, body and JSON encoding match the API contract documented in the API Reference.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_request",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "field": "idempotency-key",
      "reason": "invalid_format"
    }
  }
}
recipient_not_allowed
{
  "error": {
    "type": "business_rule_error",
    "code": "recipient_not_allowed",
    "message": "A test send can only target an active member of your team.",
    "hint": "Use the address of an active team member of the account as the recipient.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#recipient_not_allowed",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
no_sender_configured
{
  "error": {
    "type": "business_rule_error",
    "code": "no_sender_configured",
    "message": "No default email sender is configured for this account.",
    "hint": "Set up the account's default sender in the dashboard, then retry the request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#no_sender_configured",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
401

The API key is missing, unknown or expired. code tells the three causes apart: missing_api_key (no Authorization: Bearer header), invalid_api_key (unknown or revoked key, or invalid format) and expired_api_key (expiration date has passed).

missing_api_key
{
  "error": {
    "type": "authentication_error",
    "code": "missing_api_key",
    "message": "No API key was provided.",
    "hint": "Add an Authorization header in the form: Bearer cap_live_<your_key>",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#missing_api_key",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
invalid_api_key
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "API key is invalid or has been revoked.",
    "hint": "Verify the key in your dashboard or generate a new one.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#invalid_api_key",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
expired_api_key
{
  "error": {
    "type": "authentication_error",
    "code": "expired_api_key",
    "message": "API key has expired.",
    "hint": "Roll the key from the dashboard to generate a new valid one.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#expired_api_key",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
403

Authorization refused. code tells apart the refusals the operation returns under this status, and each example shows one.

browser_not_allowed
{
  "error": {
    "type": "authorization_error",
    "code": "browser_not_allowed",
    "message": "API keys must be used from a server, never from a browser.",
    "hint": "The request carries an `Origin` header: call the API from your server, where the key stays secret.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#browser_not_allowed",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
account_suspended
{
  "error": {
    "type": "authorization_error",
    "code": "account_suspended",
    "message": "Access to this account is suspended by the Capturia team.",
    "hint": "The refusal comes from the account, not the key. While the suspension lasts, no request is accepted: contact the Capturia team.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#account_suspended",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
feature_not_available
{
  "error": {
    "type": "authorization_error",
    "code": "feature_not_available",
    "message": "This feature is not included in your plan.",
    "hint": "The rejection comes from the account's plan, not the key. Contact your Capturia advisor to talk it over.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#plan",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "feature": "public_api"
    }
  }
}
insufficient_scope
{
  "error": {
    "type": "authorization_error",
    "code": "insufficient_scope",
    "message": "This API key does not contain the required scope for this endpoint.",
    "hint": "This key is missing the `email:send` scope. Create a new key with the \"Full integration\" preset or add the scope via the dashboard.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#scopes",
    "dashboard_url": "https://capturia.io/platform/dashboard/admin/integrations/api-keys/6f1e2d3c-4b5a-4c6d-8e7f-9a0b1c2d3e4f?tab=permissions",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "required_scope": "email:send",
      "current_scopes": [
        "leads:capture"
      ],
      "suggested_preset": "full_integration",
      "required_permission": "emailConversations.compose"
    }
  }
}
409

Conflict with the resource's state. recipient_unsubscribed: the recipient unsubscribed from the account's emails, nothing went out, and retrying does not help until they subscribe again themselves. idempotency_conflict: the Idempotency-Key was already used for another request body (details.reason = payload_mismatch, use a new key), or the request that carries it is still in progress (in_flight, Retry-After gives the delay before replaying the same request).

recipient_unsubscribed
{
  "error": {
    "type": "conflict_error",
    "code": "recipient_unsubscribed",
    "message": "The recipient unsubscribed from this account's emails.",
    "hint": "No commercial email can be sent to them until they subscribe again themselves.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#recipient_unsubscribed",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "to",
        "reason": "unsubscribed"
      }
    ]
  }
}
idempotency_conflictpayload_mismatch
{
  "error": {
    "type": "idempotency_error",
    "code": "idempotency_conflict",
    "message": "Idempotency key conflict.",
    "hint": "Either the same Idempotency-Key was used with a different payload, or a request with this key is still in progress. Use a fresh Idempotency-Key per logical request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/conventions#idempotency",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "reason": "payload_mismatch"
    }
  }
}
idempotency_conflictin_flight
{
  "error": {
    "type": "idempotency_error",
    "code": "idempotency_conflict",
    "message": "Idempotency key conflict.",
    "hint": "Either the same Idempotency-Key was used with a different payload, or a request with this key is still in progress. Use a fresh Idempotency-Key per logical request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/conventions#idempotency",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "reason": "in_flight"
    }
  }
}
413

The request body exceeds 1 MB (1,048,576 bytes). details.max_bytes gives the limit, and details.received_bytes the size announced by Content-Length when the request declares it.

payload_too_large
{
  "error": {
    "type": "validation_error",
    "code": "payload_too_large",
    "message": "Request body exceeds the 1 MB limit.",
    "hint": "Split your request into smaller batches.",
    "doc_url": "https://capturia.io/en/developers/api/v1/conventions#body-size",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "max_bytes": 1048576,
      "received_bytes": 1572864
    }
  }
}
415

The Content-Type header is missing, or isn't application/json.

invalid_content_type
{
  "error": {
    "type": "validation_error",
    "code": "invalid_content_type",
    "message": "Unsupported Content-Type.",
    "hint": "Send Content-Type: application/json on POST/PUT/PATCH requests.",
    "doc_url": "https://capturia.io/en/developers/api/v1/conventions#content-type",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
422

Request refused. code tells apart the refusals the operation returns under this status, and each example shows one.

missing_consentto · not_a_contact
{
  "error": {
    "type": "business_rule_error",
    "code": "missing_consent",
    "message": "The required consent is missing.",
    "hint": "`details` names the field at issue and what is missing. A commercial message (email or text) only goes to a contact who consented to it: create the contact with their consent, or record that consent on the existing contact.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#missing_consent",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "to",
        "reason": "not_a_contact"
      }
    ]
  }
}
missing_consentto · no_consent
{
  "error": {
    "type": "business_rule_error",
    "code": "missing_consent",
    "message": "The required consent is missing.",
    "hint": "`details` names the field at issue and what is missing. A commercial message (email or text) only goes to a contact who consented to it: create the contact with their consent, or record that consent on the existing contact.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#missing_consent",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "to",
        "reason": "no_consent"
      }
    ]
  }
}
missing_postal_address
{
  "error": {
    "type": "business_rule_error",
    "code": "missing_postal_address",
    "message": "The account has no postal address: a commercial email cannot be sent.",
    "hint": "Add the postal address in Settings, Brand identity, then retry the request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#missing_postal_address",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "account",
        "reason": "missing_postal_address"
      }
    ]
  }
}
429

Limit reached. rate_limit_exceeded and too_many_attempts: rate limit, Retry-After gives the delay in seconds. test_quota_exceeded: the account's test send quota is reached (details.used sends out of the details.limit allowed per details.window_hours rolling hours, shared with the platform's test buttons), without Retry-After: retrying right away does not help, wait for the window to free up sends.

rate_limit_exceeded
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded.",
    "hint": "Retry after the number of seconds in retry_after_seconds, and consider implementing exponential backoff.",
    "doc_url": "https://capturia.io/en/developers/api/v1/rate-limits",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "limit": 100,
      "count": 100,
      "limit_type": "per_key",
      "retry_after_seconds": 42
    }
  }
}
too_many_attempts
{
  "error": {
    "type": "rate_limit_error",
    "code": "too_many_attempts",
    "message": "Too many invalid authentication attempts from this IP.",
    "hint": "Wait the period indicated by retry_after_seconds before trying again.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#brute-force",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "limit_type": "brute_force",
      "retry_after_seconds": 300
    }
  }
}
test_quota_exceeded
{
  "error": {
    "type": "rate_limit_error",
    "code": "test_quota_exceeded",
    "message": "The test send quota is reached.",
    "hint": "`details` gives the usage, the limit and the window in hours: wait for the window to end before sending another test.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#test_quota_exceeded",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "used": 50,
      "limit": 50,
      "window_hours": 24
    }
  }
}
500

Unexpected server error. Always include the request_id when contacting support.

internal_error
{
  "error": {
    "type": "server_error",
    "code": "internal_error",
    "message": "Server error. The Capturia team has been notified.",
    "hint": "If this persists, contact support and include the request_id from this response.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#internal_error",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
501

Test keys (cap_test_) aren't served yet: only cap_live_ keys are accepted.

not_implemented
{
  "error": {
    "type": "server_error",
    "code": "not_implemented",
    "message": "This feature is not yet implemented.",
    "hint": "Check the API documentation for available features and the changelog for upcoming releases.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_implemented",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
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 Retry-After delay.

service_unavailable
{
  "error": {
    "type": "server_error",
    "code": "service_unavailable",
    "message": "Service temporarily unavailable.",
    "hint": "Retry after the period indicated by Retry-After.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#service_unavailable",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}

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>"
}'