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

FR

Automations

5 endpoints

get/v1/automations

List automations

Returns the paginated list of the client's active automations (cursor v2). Stable sort created_at DESC, id DESC. Archived automations (archived_at IS NOT NULL) are excluded — the public API does not expose them.

Filters

  • ?status=active — only automations with is_active=true.
  • ?status=inactive — only automations with is_active=false.

Read-only

The public API only exposes read access (list + history) and manual triggering. Creating, editing and archiving an automation happen in the dashboard — there is no POST/PATCH/DELETE /v1/automations endpoint.

Required scopes: automations: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).
statusstringoptionalFilter on is_active=true (active) or is_active=false (inactive).

Responses

StatusDescription
200

Paginated list of automations.

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 `automations: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": "automations: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/automations' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json'
post/v1/automations/{id}/trigger

Manually trigger an automation

Creates an execution with status="pending" and trigger_type="manual_api", claimable by the automation engine (asynchronous, no guarantee of synchronous completion). To track the execution's progress, call GET /v1/automations/{id}/history.

Preconditions

  • Automations must not have been removed from the account — otherwise 403 feature_not_available (details.feature: automations).
  • The automation must belong to the calling client and must not be archived — otherwise 404 not_found (details.resource: automation).
  • The automation must have is_active=true — otherwise 409 automation_inactive.
  • The automation must be published — otherwise 409 automation_not_published.
  • The published automation must have a trigger node — otherwise 409 no_trigger.
  • The contact_id must belong to the calling client — otherwise 404 not_found (details.resource: contact). A contact absorbed by a merge also returns 404 not_found: trigger on the contact that was kept.

Enrollment guards

Manual triggering goes through the same guards as automatic triggers:

  • Contact already in an active run of this automation — otherwise 409 already_enrolled (turn on Multiple concurrent runs in the Enrollment settings to allow concurrent runs).
  • The same trigger (same event_data) within the last 5 minutes, cap of 5 enrollments per contact per 24 h on this automation, or safety cap of 20,000 runs opened within the hour for the account — otherwise 429 trigger_throttled, with the reason in details.reason (duplicate, window_cap, hard_cap), to retry later.
  • Beyond 200 runs opened within the hour for the account, the trigger is still accepted: its execution is created pending with an upcoming scheduled_at, and starts gradually, 30 per minute.
  • A contact who is no longer reached out to (already a customer, closed in a lost or disqualification column, disqualified, or said no) — otherwise 409 lead_pursuit_ended, with the reason in details. An automation set up for customers or for the lost column accepts them; someone who said no, never.
  • A contact unsubscribed from this automation's series, an archived or test record — otherwise 422 business_rule_violation, with the reason in details.reason (unsubscribed, contact_archived, contact_test). Retrying changes nothing.
  • An appointment automation (status or reminder of an appointment) with no appointment for the contact and no event_data.booking_id attached — otherwise 422 business_rule_violation, with details naming event_data.booking_id (booking_required).

The body accepts an optional event_data (free-form JSON object) injected into the execution: each key is cited in the graph's messages as {{event.<key>}} (rules for citable keys: event_data).

Required scopes: automations:trigger

Path parameters

NameTypeRequiredDescription
idstringrequiredUUID of the resource.

Request body

PropertyTypeRequiredDescription
contact_idstringrequiredTarget contact to run the automation on. Must belong to the calling client.
event_dataobjectoptionalOptional event context (free-form JSON object) injected into the execution. Each key is cited in a message of the graph as {{event.<key>}} (for example {{event.campaign}}), a nested object rendered as JSON. A citable key is written with letters, digits and _: a hyphen, a space or an accent makes it impossible to cite. Keys the engine sets itself can't be read there, even when sent here: those of a status, a booking, a payment, a quote, an invoice, a call, a conversation or contact details (source, status, channel, reason, language, total, email, phone, from, to, payload…). A name of the integration's own, prefixed (crm_plan), never collides with them. Empty by default.

Responses

StatusDescription
201

pending execution created — claimed asynchronously by the engine.

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": "contact_id",
        "reason": "required"
      }
    ]
  }
}
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. feature_not_available: details.feature names what is missing, the public API in the account's plan (public_api) or automations, removed from the account (automations).

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_availablepublic_api
{
  "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 `automations:trigger` 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": "automations:trigger",
      "current_scopes": [
        "leads:capture"
      ],
      "suggested_preset": "full_integration",
      "required_permission": "automations.manage"
    }
  }
}
feature_not_availableautomations
{
  "error": {
    "type": "authorization_error",
    "code": "feature_not_available",
    "message": "This feature isn't open for this account yet.",
    "hint": "Capturia opens it account by account before its launch; the rejection comes from the account, not the key. `details.feature` names it. Contact your Capturia advisor to have it opened.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#plan",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "feature": "automations"
    }
  }
}
404

Resource not found. details.resource names what is missing: automation, unknown, archived or from another account; contact, a record that is unknown, from another account or merged into another one (trigger on the record that was kept).

not_foundautomation
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "automation"
    }
  }
}
not_foundcontact
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "contact"
    }
  }
}
409

Conflict with the resource's state. code tells apart the refusals the operation returns under this status, and each example shows one.

automation_inactive
{
  "error": {
    "type": "conflict_error",
    "code": "automation_inactive",
    "message": "This automation is inactive.",
    "hint": "Activate the automation in the dashboard, then retry the request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#automation_inactive",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
automation_not_published
{
  "error": {
    "type": "conflict_error",
    "code": "automation_not_published",
    "message": "This automation is not published.",
    "hint": "Publish the automation in the dashboard, then retry the request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#automation_not_published",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
no_trigger
{
  "error": {
    "type": "conflict_error",
    "code": "no_trigger",
    "message": "The published automation has no trigger.",
    "hint": "Add a trigger to the automation, publish it again, then retry the request.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#no_trigger",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
already_enrolled
{
  "error": {
    "type": "conflict_error",
    "code": "already_enrolled",
    "message": "This contact already has a run in progress in this automation.",
    "hint": "Wait for the current run to finish, or enable multiple opportunities in the automation's enrollment settings.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#already_enrolled",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
lead_pursuit_ended
{
  "error": {
    "type": "conflict_error",
    "code": "lead_pursuit_ended",
    "message": "This contact is no longer solicited: they bought, were lost, or said no.",
    "hint": "`details` gives the reason. A record whose pursuit has ended no longer receives sales sequences or automations.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#lead_pursuit_ended",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "contact_id",
        "reason": "lead_refused"
      }
    ]
  }
}
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. business_rule_violation: an account rule refuses this contact, and details names it: unsubscribed, the contact unsubscribed from this automation's series; contact_archived, the record is archived; contact_test, it is a test record; booking_required on the event_data.booking_id field, an appointment automation with no appointment for the contact and none attached. The same request returns the same refusal: retrying does not help.

business_rule_violationunsubscribed
{
  "error": {
    "type": "business_rule_error",
    "code": "business_rule_violation",
    "message": "A business rule prevents this operation.",
    "hint": "`details` names the rule that blocks the operation. The endpoint's reference lists each possible value and what it requires.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#business_rule_violation",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "reason": "unsubscribed"
    }
  }
}
business_rule_violationevent_data.booking_id · booking_required
{
  "error": {
    "type": "business_rule_error",
    "code": "business_rule_violation",
    "message": "A business rule prevents this operation.",
    "hint": "`details` names the rule that blocks the operation. The endpoint's reference lists each possible value and what it requires.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#business_rule_violation",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "event_data.booking_id",
        "reason": "booking_required"
      }
    ]
  }
}
429

Limit reached. rate_limit_exceeded and too_many_attempts: the key's rate limit, Retry-After gives the delay in seconds. trigger_throttled: an enrollment guard refuses this trigger, without Retry-After, and details.reason names it: duplicate, the same trigger within 5 minutes; window_cap, the cap of 5 triggers for the contact over 24 hours in this automation; hard_cap, the account's safety cap of 20,000 runs opened within the hour. Try again later.

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
    }
  }
}
trigger_throttled
{
  "error": {
    "type": "rate_limit_error",
    "code": "trigger_throttled",
    "message": "The trigger was refused by the enrollment guards.",
    "hint": "Three guards can refuse: a duplicate enrollment within 5 minutes, the 24-hour re-enrollment cap, or the account's safety cap on runs opened within the hour. Try again later.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#trigger_throttled",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "reason": "duplicate"
    }
  }
}
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/automations/{id}/trigger' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "contact_id": "8f3b1a2c-9d4e-4f5a-b6c7-d8e9f0a1b2c3",
  "event_data": {
    "source": "crm_import"
  }
}'
get/v1/automations/{id}/history

List an automation's execution history

Returns the paginated list of an automation's executions (cursor v2). Stable sort created_at DESC, id DESC — most recent executions first. An execution is one run of the automation for a given contact; the engine can restart it after a failure (retry_count > 0).

The automation must belong to the calling client and must not be archived — otherwise 404 not_found (details.resource: automation), as for an ID that is not a UUID.

Required scopes: automations:read

Path parameters

NameTypeRequiredDescription
idstringrequiredUUID of the resource.

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 the automation's executions.

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 `automations: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": "automations:read",
      "current_scopes": [
        "leads:capture"
      ],
      "suggested_preset": "read_only"
    }
  }
}
404

Resource not found. code tells apart the refusals the operation returns under this status, and each example shows one.

not_found
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "automation"
    }
  }
}
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/automations/{id}/history' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json'
post/v1/enrollments

Enroll contacts in a sequence, an automation, or a follow-up

Enrolls up to 100 contacts in one of the account's email sequences, automations, or SMS follow-up campaigns, through the same service as the dashboard. Returns one outcome per contact: enrolled, already (already enrolled), or refused with its reason.

Required scope

The scope follows the kind of target: email:send for a sequence (email_sequence), automations:trigger for an automation (automation), campaigns:launch for a follow-up (relance).

Refusal reasons

  • lead_customer, lead_closed, lead_refused: the contact is already a customer, closed (in a lost or disqualification column, or disqualified), or said no. An automation set up for customers or for the lost column accepts them; someone who said no, never.
  • contact_not_found, contact_absorbed, contact_archived, contact_test: the record isn't a live record of the account.
  • target_inactive, target_empty, module_closed, booking_email_not_enrollable: the target isn't active, has no step, its module isn't open, or it's a booking email, which the calendar sends itself.
  • target_not_enrollable: the follow-up takes no individual enrollment (a one-time send goes to its list, the autonomous follow-up picks its own leads).
  • unsubscribed, opted_out, no_consent, no_phone, upcoming_booking, said_later, held_by_event, manual_pilot, contact_paused, enrollment_filter, other_system, queued_elsewhere, withdrawn_from_target: the target's guards (unsubscription, consent, upcoming booking, a date the prospect gave or the seller promised that hasn't come yet, an event's agent following the contact, the target's enrollment filter, earlier removal from this follow-up, send caps).
  • duplicate, window_cap, hard_cap: an automation's caps (the same enrollment within 5 minutes, the contact's cap over 24 hours, the account's safety cap over the hour); retry later.
  • booking_required: an appointment automation, for a contact with no appointment; attach event_data.booking_id.

A contact repeated in contact_ids is enrolled once and gets a single outcome. Each enrollment leaves a trace on the contact's record, with the key as the author.

Required scopes: email:send or automations:trigger or campaigns:launch

Request body

PropertyTypeRequiredDescription
targetEnrollmentTargetrequiredThe target of an enrollment, in the calling account.
contact_idsstring[]requiredThe contacts to enroll (at most 100 per request).

Responses

StatusDescription
200

One outcome per contact.

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_errortarget.type · invalid_value
{
  "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": "target.type",
        "reason": "invalid_value"
      }
    ]
  }
}
validation_errortarget.id · invalid_uuid
{
  "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": "target.id",
        "reason": "invalid_uuid"
      }
    ]
  }
}
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"
    }
  }
}
404

Resource not found. details.resource names what is missing: the target (email_sequence, automation or relance), which isn't in the account or isn't of this kind; contact, a record was merged into another one during the enrollment, and nothing is enrolled. An unknown or already merged contact does not refuse the request: its outcome is refused in the response.

not_foundemail_sequence
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "email_sequence"
    }
  }
}
not_foundcontact
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "contact"
    }
  }
}
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"
  }
}
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 POST 'https://api.capturia.io/v1/enrollments' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "target": {
    "type": "email_sequence",
    "id": "8f3b1a2c-9d4e-4f5a-b6c7-d8e9f0a1b2c3"
  },
  "contact_ids": [
    "2b3c4d5e-6f7a-4b9c-8d1e-2f3a4b5c6d7e"
  ]
}'
post/v1/enrollments/withdraw

Remove a contact from a sequence, an automation, or a follow-up

Stops a contact's current enrollment in one of the account's email sequences, automations, or SMS follow-up campaigns: whatever was left to send doesn't go out. A follow-up that already went out keeps its status, and every follow-up text stops, even after the contact replied (mode: followups_stopped); the texting agent still answers if they write.

Idempotent: a contact already removed returns outcome: already. A contact never enrolled in this target answers 404 not_found (details.resource: enrollment); a target that isn't in the account, 404 not_found with its kind in details.resource. An enrollment that can no longer be withdrawn answers 422 business_rule_violation (details.reason: not_withdrawable).

The scope follows the kind of target, as for enrollment. The removal leaves a trace on the contact's record, with the key as the author.

Required scopes: email:send or automations:trigger or campaigns:launch

Request body

PropertyTypeRequiredDescription
targetEnrollmentTargetrequiredThe target of an enrollment, in the calling account.
contact_idstringrequiredThe contact to remove.

Responses

StatusDescription
200

The contact is removed, or already was.

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_errortarget.type · invalid_value
{
  "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": "target.type",
        "reason": "invalid_value"
      }
    ]
  }
}
validation_errorcontact_id · invalid_uuid
{
  "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": "contact_id",
        "reason": "invalid_uuid"
      }
    ]
  }
}
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"
    }
  }
}
404

Resource not found. details.resource names what is missing: the target (email_sequence, automation or relance), which isn't in the account or isn't of this kind; enrollment, this contact has no enrollment in this target; contact, the record was merged into another one during the removal, and nothing is withdrawn.

not_foundrelance
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "relance"
    }
  }
}
not_foundenrollment
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "enrollment"
    }
  }
}
not_foundcontact
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "The requested resource was not found.",
    "hint": "`details.resource` names the resource looked up. Check its ID: it may have been deleted, or it belongs to another account.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "resource": "contact"
    }
  }
}
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. business_rule_violation: the enrollment can no longer be withdrawn (details.reason: not_withdrawable): a follow-up that already went out with no follow-up text left to stop, or an enrollment that ended in the meantime.

business_rule_violation
{
  "error": {
    "type": "business_rule_error",
    "code": "business_rule_violation",
    "message": "A business rule prevents this operation.",
    "hint": "`details` names the rule that blocks the operation. The endpoint's reference lists each possible value and what it requires.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#business_rule_violation",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "reason": "not_withdrawable"
    }
  }
}
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 POST 'https://api.capturia.io/v1/enrollments/withdraw' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "target": {
    "type": "relance",
    "id": "8f3b1a2c-9d4e-4f5a-b6c7-d8e9f0a1b2c3"
  },
  "contact_id": "2b3c4d5e-6f7a-4b9c-8d1e-2f3a4b5c6d7e"
}'