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

FR

Leads

1 endpoint

post/v1/leads/capture

Capture a lead from an external funnel

Captures a new lead in Capturia from a third-party funnel, form, or tool (Make, Zapier, n8n, custom landing page). Once captured, the lead shows up immediately in My Prospects in the dashboard, and the SMS bot takes over within 30 seconds if consent and configuration are in order. The response message says how many form answers were recorded (Lead captured with 7 qualification answer(s).).

Example contact

A lead whose email belongs to a domain reserved for examples (example.com, example.net, example.org and their subdomains) comes from a tool testing its setup with a made-up contact, often with a real random number. Its record is created as a test record, but no automatic text goes out, no "Form submitted" automation starts and no Lead event goes to the Meta pixel: the message says so. To test end to end, send your own email and your own cell number.

Contact already known (email or phone)

The contact is resolved by email first (case-insensitive), then by phone, including secondary contact details already attached to a contact. Capturing a lead whose email or phone already exists reuses and enriches the existing contact — the returned contact_id is that contact's, never a duplicate and never an error. Contact details and core fields that are already filled in (name, email, phone, pipeline, value, address...) are not overwritten; qualification answers (custom_fields), on the other hand, are refreshed with the latest values sent — a key that is already present is replaced, a new key is added. A new phone number is kept as a secondary number when the contact already has one. If the email and the phone point to two different contacts, the email takes priority and no contact detail is removed from the other contact.

The response exposes contact_was_new to tell the two outcomes apart: on an existing contact (false), pipeline and assignment_status describe the resolved request, not necessarily the persisted state — the contact keeps the pipeline, stage, and sales rep it already has, and ignored_fields names the fields of the pipeline block it did not take (existing_contact_kept).

Received fields not applied as received (ignored_fields)

A capture that responds 200 tells you what it did not apply as received. The response carries ignored_fields, a [{ field, reason }] list that is always present and empty when everything was applied as received:

  • unknown_field — a name the API does not know, at the root, in customData, or in a block (pipeline.id, utm.utm_source);
  • custom_field_not_defined — a custom_fields key with no definition of the same name in the account;
  • unreadable_value — a value that cannot be read: an object received where the contract expects a simple value, a tag item that is not text, or the text "[object Object]" that a connector sends when its mapping points to an object instead of a field (customData.Last_name). That text is removed: the field keeps what remains readable; if nothing remains, it stays empty, or another source fills it. A tag or a qualification answer that carries this text is discarded entirely; an sms_consent that carries it cannot be read at all;
  • reserved_tag — a tag with a reserved name (tags[1]);
  • limit_exceeded — a tag beyond the 20 kept, or longer than 50 characters; an answer pair (qualification_answers.<question>) beyond the 20 answers, or too long;
  • system_not_active — a system_id that is not active;
  • existing_contact_kept — a field of the pipeline block that the existing contact kept;
  • sales_rep_not_found — a sales rep email that matches no active member of the account;
  • sales_rep_does_not_sell — a sales rep email that matches a member who doesn't contact leads;
  • submission_not_recorded — what only applies with a recorded submission, when none is recorded (existing_pipeline_contact, idempotent_replay);
  • duplicate_field — a copy of a field received from several sources, set aside in favor of another value.

Only limit: on an existing contact, identity and address fields that are already filled in, and ad attribution that is already set (first-touch rule), are kept without being named one by one (contact_was_new: false signals it).

The lead is captured in all of these cases: this is a setup warning to read on the first test of an integration. The list is capped at 50 entries (ignored_fields_truncated), with fields you mapped by hand listed before the ones a connector adds automatically.

Doubtful email (email_check)

A capture that responds 200 also tells you what the shape of the address received in email reveals. The response carries email_check, always present and null when there is nothing to report:

  • undeliverable — the address cannot receive any email (a domain reserved for testing, an extension that does not exist such as gmail.con): Capturia will not send it any email;
  • suspected_typo — likely typo in the domain of a major provider (gmail.coml, hotmai.com); did_you_mean gives the address the prospect most likely meant to type.

Never a rejection: the lead is captured with the address received, which Capturia does not change. The message says so in one sentence. It is up to the integration to react, for example by asking the prospect for their address again.

Pipeline and stage

The pipeline block designates the pipeline and the stage by their text identifier (pipeline_slug, stage_slug), which you copy from the dashboard: Settings, API Keys, "Your pipeline and stage identifiers" section. A connector that only sends key/value pairs (GoHighLevel workflow, Zapier) sends them flat: pipeline.pipeline_slug, pipeline.stage_slug. Without pipeline_slug, the stage is looked up in the default pipeline.

Contact already in an open pipeline

A lead whose contact (resolved by email or phone) is already in an open pipeline stage (already handled by a sales rep — not archived, stage neither won nor lost) is not resubmitted: the response returns status: existing_pipeline_contact, no new submission is recorded, and the SMS bot is not triggered again, so an ongoing conversation is not overwritten. Newly provided core fields still enrich the existing contact.

Retry deduplication takes precedence: a re-push received within the 5-minute window is treated as a retry (status: idempotent_replay, see Idempotency) and keeps the original activity_id and original_created_at — existing_pipeline_contact only applies after this window.

Idempotency

The Idempotency-Key header is optional but recommended for client-side retries. A second request with the same key and the same payload returns the original response without duplicating the lead. The key is stored for 24h. It is 16 to 128 [A-Za-z0-9_-] characters long (a UUID v4 or a ULID works); a key in any other format returns 400 invalid_request. A second request with the same key but a different payload returns 409 idempotency_conflict, as does a second request received while the first one is still in progress (retry after the Retry-After delay). The underlying RPC also keeps its own 5-minute dedup window. This window is per contact and independent of content: any submission for a contact already captured within the last 5 minutes is treated as a retry (idempotent_replay) even if the payload differs — the contact is still enriched (including custom_fields, which are refreshed), but no new activity, no tag, and no SMS bot follow-up. Updates to the contact remain real: an automation that watches a custom field reacts to the value change, as it does for any change to the contact. This is also what prevents a double bot follow-up when a lead resubmits their form twice in a row. A different Idempotency-Key does not bypass this window: it applies in the database after any cache miss. Two intentionally distinct submissions from the same contact only produce two activities if they are more than 5 minutes apart.

Refusals

A refused payload returns 422, and no lead is captured: the code names the field at issue (invalid_phone, invalid_email, missing_consent, invalid_payload) or what the account does not know (pipeline_not_found, stage_not_found, system_not_found). When the refused field received a simple value, the message quotes it as received: a faulty setup shows on the very first test. Beyond 100 requests per minute from the same IP address, the capture returns 429 rate_limited_ip, with the X-RateLimit-Scope: ip header.

Required scopes: leads:capture

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
phonestring | integerrequiredPhone (normalized to E.164). Expected final format: ^\+[1-9]\d{10,14}$ (between 11 and 15 digits after the +). Also accepted: a positive JSON integer within the JavaScript safe range (at most 9007199254740991; every E.164 number fits), converted to a string before normalization, for no-code connectors whose source field is numeric. Prefer the string: it is the only form that preserves an explicit international +. Any other number (negative, decimal, zero) is rejected with a 422 invalid_phone that restates the accepted formats.
sms_consentboolean | stringrequiredExplicit SMS consent. Must be true (boolean) or a whitelisted truthy string (see the schema description). Ambiguous values (false, "no", 0, etc.) are rejected with 422 missing_consent. Accepted at the root of the body or in the customData object (GoHighLevel webhooks).
first_namestringoptionalNo description.
last_namestringoptionalNo description.
emailstringoptionalNo description.
source_labelstringoptionalFree-form label identifying the lead's source (e.g. funnel-fb-jan, landing-blueprint). Shown in the pipeline and in the contact's activity log.
utmLeadCaptureUtmoptionalOptional UTM parameters attached to the lead. Used to attribute the marketing source in the pipeline (Source : Google Ads / Facebook campaign X). You can also send each sub-field flat (utm.source); see LeadCapturePayload. An unknown sub-field is not rejected: it is ignored and named in the response's ignored_fields.
gclidstringoptionalGoogle Ads click identifier (the gclid parameter of the landing URL, auto-tagging). Kept with the lead's ad attribution (first-touch). Without utm.source, the lead is attributed to the google source and the cpc medium, which links it to the campaign whose web origin is google / cpc. When meta.ads_consent is false, the identifier is never kept (neither in the attribution nor in the received copy): only the google / cpc origin remains.
notesstringoptionalFree-form notes attached to the lead (visible on the contact).
tagsstring[]optionalTags to attach to the created contact. If a tag does not exist for this client, it is created on the fly. Tags from the root and from customData add up, those from customData first, with duplicates removed regardless of case. A tag never rejects the lead: beyond the first 20, or longer than 50 characters, it is discarded (reason limit_exceeded); an item that is not text, or that carries "[object Object]", is discarded entirely (reason unreadable_value). Any name that starts with "Campagne :" (any case and spacing) is ignored, without taking a place among the 20: this prefix is reserved for campaign tags, which Capturia sets on its own based on the lead's campaign (reason reserved_tag). The response names each discarded tag by its position in the received list (tags[1], customData.tags[0]). A string is read as a comma-separated list, so an "[object Object]" received alone is named tags[0]; a field that is neither a string nor a list (an object, a number) is named tags or customData.tags.
qualification_answersobject[]optionalForm answers captured upstream, one question / answer pair per answer. They show up on the record, question and answer, and the SMS agent knows them: its first text starts from what the lead answered. A connector that only sends key/value pairs (a GoHighLevel workflow's Webhook action, Zapier, Make) sends one pair per answer, at the root or in customData: the key qualification_answers. followed by the question (prefix case-insensitive), the value being the answer (text, number, boolean, or a list of texts joined with commas). A question written with underscores and no spaces (qualification_answers.do_you_live_in_quebec) reads with spaces. These pairs are added to the received list, in order; a question already answered keeps its first answer (another answer is named duplicate_field). An empty pair is absent; an unreadable pair is named unreadable_value; a pair whose question exceeds 500 characters, whose answer exceeds 1,000, or beyond 20 answers, is named limit_exceeded, and the lead is still captured. Only these pairs become answers: the fields a connector adds on its own (a GoHighLevel contact's custom fields) stay unknown_field.
qualification_answers[].questionstringrequiredThe question asked to the prospect, as they read it.
qualification_answers[].answerstringrequiredThe prospect's answer, as they gave it.
pipelineLeadCapturePipelineConfigoptionalOptional routing of the lead in the sales pipeline. All fields are optional. Without pipeline_slug, the account's default pipeline is targeted. If stage_slug is omitted, the pipeline's default stage is used. assigned_sales_rep_email must designate a member of the client's team who sells (otherwise the returned assignment_status is email_not_found or seller_does_not_sell). You identify the pipeline and the stage by their text identifier (slug), never by their technical identifier (UUID): id, stage_id, or any other unknown sub-field is ignored and named in the response's ignored_fields (unknown_field). A slug that matches nothing is rejected with a 422 (pipeline_not_found, stage_not_found). You can also send each sub-field flat (pipeline.stage_slug); see LeadCapturePayload. On an existing contact, these fields are only written where the contact is empty: the ones it keeps are named in ignored_fields (existing_contact_kept).
custom_fieldsobjectoptionalCustom fields of the contact, keyed by the NAME of the definition configured on the client side (e.g. type_propriete), not by its internal UUID: a site's integrator does not know the ids. The capture resolves name → definition per client, then fills the contact and the kanban. A key with no matching definition is ignored (no error) and named in the response's ignored_fields (custom_fields.ma_cle, reason custom_field_not_defined). For a select field, provide the option's value (e.g. maison_isolee), not its label.
addressstringoptionalThe contact's postal address (free text, e.g. the property for sale).
postal_codestringoptionalThe contact's postal code.
address_place_idstringoptionalPlace identifier (e.g. a Google Place ID) if the address comes from an autocomplete. Stored as is for later re-resolution.
streetstringoptionalStreet (including the civic number). Completes an existing contact without overwriting a street that is already filled in.
citystringoptionalCity. Completes an existing contact without overwriting a city that is already filled in.
sectorstringoptionalArea or neighborhood. Completes an existing contact without overwriting an area that is already filled in.
provincestringoptionalProvince. Completes an existing contact without overwriting a province that is already filled in.
countrystringoptionalCountry. Completes an existing contact without overwriting a country that is already filled in.
regionstringoptionalQuébec administrative region, stored under its official name (case, accents and dashes don't matter). A value outside the list is left empty: the lead is never rejected for it. Without a region, it's derived from the city when the city is known. Completes an existing contact without overwriting a region that is already filled in.
industrystringoptionalIndustry of the lead's business: a code (real_estate…) or its French or English label, stored under its code. A value outside the list is left empty. Completes an existing contact without overwriting an industry that is already filled in.
languagestringoptionalLanguage of the lead (fr or en, or a code like fr-CA). An unrecognized value is left empty. Completes an existing contact without overwriting a language that is already filled in.
metaLeadCaptureMetaAttributionoptionalThe visitor's Meta ad attribution, captured on the funnel at submission and persisted (first-touch) on the contact. Used to attribute the server-side Purchase event (Conversions API) to the original click when the deal moves to "won". All fields are optional; providing whatever is available improves Meta's match quality. A returning lead does not overwrite its original attribution (first-touch). The ad_id/adset_id/campaign_id identifiers (and their names) also link the lead to the ad that brought it in, visible on its contact and in per-ad performance. Connectors hooked up to Meta Lead Ads (Zapier, Make, n8n) have these fields in the lead payload. You can also send each sub-field flat (meta.ad_id); see LeadCapturePayload. An unknown sub-field is not rejected: it is ignored and named in the response's ignored_fields.
system_idstringoptionalTarget System of the capture (UUID of one of the account's Systems, visible in the Capturia dashboard). Omitted → the System set on the API key, otherwise the main System. A new lead's contact is created in this System. A lead the account already knows moves there too, unless it has work in progress (an appointment, a quote, a proposal, a contract) or the capture comes from another person on its contact; with no System named by the request or the key, the capture can bring it back to the main System. A UUID that matches none of the account's Systems → system_not_found error (422), and no contact is created. A System of the account that is not active (archived, for example) → the lead goes to the main System, and the response names system_id in ignored_fields (reason system_not_active).

Responses

StatusDescription
200

Lead captured (status: created), idempotent replay of a previous capture (status: idempotent_replay), or contact already handled (status: existing_pipeline_contact — already in an open pipeline stage: no new submission is recorded, the SMS bot is not triggered, and activity_id is null). In all cases, the returned contact_id is stable.

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_payload
{
  "error": {
    "type": "validation_error",
    "code": "invalid_payload",
    "message": "The request content is invalid.",
    "hint": "With `details`, each refused field is named with its reason. Without `details`, the body could not be parsed as JSON.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_payload",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
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"
    }
  }
}
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.

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 `leads:capture` scope. Create a new key with the \"Lead capture\" 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": "leads:capture",
      "current_scopes": [
        "contacts:read"
      ],
      "suggested_preset": "lead_capture"
    }
  }
}
terms_acceptance_required
{
  "error": {
    "type": "authorization_error",
    "code": "terms_acceptance_required",
    "message": "API terms of service have not been accepted, or your accepted version is outdated.",
    "hint": "Open this key in Capturia, Permissions tab, and check the API terms attestation: the key keeps its secret, nothing to change in your integration.",
    "doc_url": "https://capturia.io/en/developers/api/v1/authentication#terms",
    "dashboard_url": "https://capturia.io/platform/dashboard/admin/integrations/api-keys/6f1e2d3c-4b5a-4c6d-8e7f-9a0b1c2d3e4f?tab=permissions",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7"
  }
}
409

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

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, no lead is captured. invalid_phone, invalid_email, missing_consent, and invalid_payload: validation refuses a field, which details names as it was sent (field, empty when the body is not a JSON object), with the schema's reason (reason, which gives the accepted formats). When that field received a simple value (text, number, or boolean), the message quotes it as received, in quotes for text and capped at 120 characters: a column name instead of a value points to the connector's setup. This value is never kept by Capturia; the API key's Recent errors tab keeps the field, the reason, and the names of the fields received. pipeline_not_found: the pipeline_slug matches no pipeline of the account. stage_not_found: the stage_slug matches no stage of the target pipeline. system_not_found: the system_id matches no System of the account.

invalid_phonephone · 1
{
  "error": {
    "type": "validation_error",
    "code": "invalid_phone",
    "message": "The phone provided is not valid: field \"phone\" received \"phone_number\".",
    "hint": "The message quotes the value received as-is: a column name instead of a number points to your connector's mapping. Send a complete number, preferably in E.164 format (`+15145551234`).",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_phone",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "phone",
        "reason": "Phone must be a valid number — accepted formats: E.164 (+15141234567), 10-digit NANP (5141234567), 11-digit with country code (15141234567), or formatted variants (\"(514) 123-4567\", \"1-514-123-4567\")"
      }
    ]
  }
}
invalid_phonephone · 2
{
  "error": {
    "type": "validation_error",
    "code": "invalid_phone",
    "message": "The phone is missing or not valid.",
    "hint": "`details` names the refused field. Send a complete number, preferably in E.164 format (`+15145551234`).",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_phone",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "phone",
        "reason": "Phone is required — accepted formats: E.164 (+15141234567), 10-digit NANP (5141234567), 11-digit with country code (15141234567), or formatted variants (\"(514) 123-4567\", \"1-514-123-4567\")"
      }
    ]
  }
}
invalid_email
{
  "error": {
    "type": "validation_error",
    "code": "invalid_email",
    "message": "The email provided is not valid: field \"email\" received \"alex@exemple\".",
    "hint": "The message quotes the value received as-is: a column name instead of an address points to your connector's mapping. Send a complete address, such as `[email protected]`.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_email",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "email",
        "reason": "Invalid email address"
      }
    ]
  }
}
missing_consentsms_consent · 1
{
  "error": {
    "type": "business_rule_error",
    "code": "missing_consent",
    "message": "The required consent is missing: field \"sms_consent\" received \"J'accepte de recevoir des SMS\".",
    "hint": "The message quotes the value received as-is. A commercial message (email or text) only goes to a contact who consented to it: send their consent with the contact.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#missing_consent",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "sms_consent",
        "reason": "sms_consent must attest consent — accepted values: true (boolean) or \"true\"/\"yes\"/\"oui\"/\"vrai\"/\"1\"/\"on\"/\"checked\" (case-insensitive). The field is accepted at the payload root or inside the \"customData\" object (GoHighLevel webhooks nest Custom Data pairs there)."
      }
    ]
  }
}
missing_consentsms_consent · 2
{
  "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": "sms_consent",
        "reason": "sms_consent must attest consent — accepted values: true (boolean) or \"true\"/\"yes\"/\"oui\"/\"vrai\"/\"1\"/\"on\"/\"checked\" (case-insensitive). The field is accepted at the payload root or inside the \"customData\" object (GoHighLevel webhooks nest Custom Data pairs there)."
      }
    ]
  }
}
invalid_payloadpipeline.expected_close_date
{
  "error": {
    "type": "validation_error",
    "code": "invalid_payload",
    "message": "The request content is invalid: field \"pipeline.expected_close_date\" received \"30/06/2026\".",
    "hint": "The message quotes the value received as-is: a column name instead of a value points to your connector's mapping. `details` names the refused field with its reason.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_payload",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "pipeline.expected_close_date",
        "reason": "expected_close_date must be ISO date (YYYY-MM-DD)"
      }
    ]
  }
}
invalid_payload
{
  "error": {
    "type": "validation_error",
    "code": "invalid_payload",
    "message": "The request content is invalid.",
    "hint": "With `details`, each refused field is named with its reason. Without `details`, the body could not be parsed as JSON.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#invalid_payload",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "",
        "reason": "Invalid input: expected object, received array"
      }
    ]
  }
}
pipeline_not_found
{
  "error": {
    "type": "business_rule_error",
    "code": "pipeline_not_found",
    "message": "The `pipeline_slug` provided does not match any pipeline on the account.",
    "hint": "Copy the pipeline identifier from Settings, API Keys, \"Your pipeline and stage identifiers\" section.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#pipeline_not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "pipeline.pipeline_slug",
        "reason": "unknown_for_this_account"
      }
    ]
  }
}
stage_not_found
{
  "error": {
    "type": "business_rule_error",
    "code": "stage_not_found",
    "message": "The `stage_slug` provided does not match any stage of the target pipeline.",
    "hint": "Use the slug of a stage of this pipeline, as returned by GET /v1/pipeline/stages.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#stage_not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": [
      {
        "field": "pipeline.stage_slug",
        "reason": "unknown_in_pipeline"
      }
    ]
  }
}
system_not_found
{
  "error": {
    "type": "business_rule_error",
    "code": "system_not_found",
    "message": "The specified system_id does not match any System for this account.",
    "hint": "Use the UUID of one of your Systems, or omit system_id: the lead goes to your key's System, otherwise to your main System.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#system_not_found",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "field": "system_id",
      "reason": "unknown_for_this_account"
    }
  }
}
429

Limit reached. rate_limit_exceeded: the key's quota is used up. too_many_attempts: too many invalid keys presented from this IP address. rate_limited_ip: more than 100 requests per minute from this IP address; details gives the limit and the window in seconds, and the X-RateLimit-Scope header is ip. In every case, Retry-After gives the delay in seconds before retrying.

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
    }
  }
}
rate_limited_ip
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limited_ip",
    "message": "IP rate limit reached.",
    "hint": "`details` gives the limit and the window in seconds. Wait for the `Retry-After` header's delay before retrying.",
    "doc_url": "https://capturia.io/en/developers/api/v1/errors#rate_limited_ip",
    "request_id": "req_01J9X8Z3F4K2M5N7P9Q1R3S5T7",
    "details": {
      "limit": 100,
      "window_seconds": 60
    }
  }
}
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/leads/capture' \
  -H 'Authorization: Bearer cap_live_<your-key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "phone": "+15145551234",
  "sms_consent": true,
  "first_name": "Alex",
  "last_name": "Tremblay",
  "email": "[email protected]",
  "source_label": "funnel-fb-jan",
  "utm": {
    "source": "facebook",
    "medium": "cpc",
    "campaign": "spring-2026"
  },
  "tags": [
    "lead-chaud",
    "vu-webinaire"
  ],
  "pipeline": {
    "pipeline_slug": "ventes-b2b",
    "stage_slug": "nouveau-lead",
    "deal_value": 2500,
    "expected_close_date": "2026-06-30",
    "assigned_sales_rep_email": "[email protected]"
  },
  "custom_fields": {
    "type_propriete": "maison_isolee",
    "delai_vente": "0_3_mois"
  },
  "address": "123 rue Principale, Montréal",
  "postal_code": "H2X 1Y4"
}'