Leads
1 endpoint
/v1/leads/captureCapture 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., example., example. 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_ 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_), 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_ to tell the two outcomes apart:
on an existing contact (false), pipeline and assignment_
describe the resolved request, not necessarily the persisted state — the
contact keeps the pipeline, stage, and sales rep it already has, and
ignored_ names the fields of the pipeline block it did
not take (existing_).
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_, a [{ field, reason }] list that
is always present and empty when everything was applied as received:
unknown_— a name the API does not know, at the root, infield customData, or in a block (pipeline.,id utm.);utm_ source custom_— afield_ not_ defined custom_key with no definition of the same name in the account;fields unreadable_— 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 (value customData.). 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; anLast_ name sms_that carries it cannot be read at all;consent reserved_— a tag with a reserved name (tag tags[1]);limit_— a tag beyond the 20 kept, or longer than 50 characters; an answer pair (exceeded qualification_) beyond the 20 answers, or too long;answers. <question> system_— anot_ active system_that is not active;id existing_— a field of thecontact_ kept pipelineblock that the existing contact kept;sales_— a sales rep email that matches no active member of the account;rep_ not_ found sales_— a sales rep email that matches a member who doesn't contact leads;rep_ does_ not_ sell submission_— what only applies with a recorded submission, when none is recorded (not_ recorded existing_,pipeline_ contact idempotent_);replay duplicate_— a copy of a field received from several sources, set aside in favor of another value.field
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_ 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_), 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_, 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 asgmail.): Capturia will not send it any email;con suspected_— likely typo in the domain of a major provider (typo gmail.,coml hotmai.);com did_gives the address the prospect most likely meant to type.you_ mean
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_, stage_), 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.. Without
pipeline_, 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_,
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_, see
Idempotency) and keeps the original activity_ and
original_ — existing_ only applies after this
window.
Idempotency
The Idempotency- 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- characters long (a UUID v4 or a ULID
works); a key in any other format returns 400 invalid_. A second
request with the same key but a different payload returns 409
idempotency_, as does a second request received while the
first one is still in progress (retry after the Retry-
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_) even if the payload differs — the contact is still
enriched (including custom_, 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- 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_, invalid_,
missing_, invalid_) or what the account does not
know (pipeline_, stage_, system_).
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_, with the
X- header.
leads:captureHeaders
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | optional | Idempotency key: 16 to 128 [A- characters (a UUID v4 or a ULID works). A key of any other
shape is refused with 400 invalid_ (details.: idempotency-); an empty header counts as
a request without a key. A second request with the same key and the same payload returns the original
response, with the Idempotency- header, without repeating the operation; the same key with
a different payload is refused with 409 idempotency_. Stored for 24 h. Optional but recommended. |
Request body
| Property | Type | Required | Description |
|---|---|---|---|
phone | string | integer | required | Phone (normalized to E.164). Expected final format:
^\+[1- (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_ that restates the accepted formats. |
sms_consent | boolean | string | required | Explicit 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_. Accepted at the root of the body or in
the customData object (GoHighLevel webhooks). |
first_name | string | optional | No description. |
last_name | string | optional | No description. |
email | string | optional | No description. |
source_label | string | optional | Free-form label identifying the lead's source (e.g. funnel-,
landing-). Shown in the pipeline and in the contact's
activity log. |
utm | LeadCaptureUtm | optional | Optional 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.); see
LeadCapturePayload. An unknown sub-field is not rejected: it is
ignored and named in the response's ignored_. |
gclid | string | optional | Google Ads click identifier (the gclid parameter of the landing
URL, auto-tagging). Kept with the lead's ad
attribution (first-touch). Without utm., 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. is false, the identifier is never
kept (neither in the attribution nor in the received copy): only the
google / cpc origin remains. |
notes | string | optional | Free-form notes attached to the lead (visible on the contact). |
tags | string[] | optional | Tags 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_); an item that is not text, or that
carries "[object Object]", is discarded entirely (reason
unreadable_). 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_). The response names each
discarded tag by its position in the received list (tags[1],
customData.). 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.. |
qualification_answers | object[] | optional | Form 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_ 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_) 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_). An empty pair is absent; an unreadable pair is
named unreadable_; a pair whose question exceeds 500
characters, whose answer exceeds 1,000, or beyond 20 answers, is named
limit_, 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_. |
qualification_answers[].question | string | required | The question asked to the prospect, as they read it. |
qualification_answers[].answer | string | required | The prospect's answer, as they gave it. |
pipeline | LeadCapturePipelineConfig | optional | Optional routing of the lead in the sales pipeline. All fields are
optional. Without pipeline_, the account's default pipeline is
targeted. If stage_ is omitted, the pipeline's default stage is used.
assigned_ must designate a member of the client's team
who sells (otherwise the returned assignment_ is email_
or seller_).
You identify the pipeline and the stage by their text identifier (slug),
never by their technical identifier (UUID): id, stage_, or any other
unknown sub-field is ignored and named in the response's ignored_
(unknown_). A slug that matches nothing is rejected with a
422 (pipeline_, stage_).
You can also send each sub-field flat (pipeline.); see
LeadCapturePayload.
On an existing contact, these fields are only written where the contact is
empty: the ones it keeps are named in ignored_
(existing_). |
custom_fields | object | optional | Custom fields of the contact, keyed by the NAME of the definition
configured on the client side (e.g. type_), 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_
(custom_, reason custom_). For a
select field, provide the option's value (e.g. maison_), not its
label. |
address | string | optional | The contact's postal address (free text, e.g. the property for sale). |
postal_code | string | optional | The contact's postal code. |
address_place_id | string | optional | Place identifier (e.g. a Google Place ID) if the address comes from an autocomplete. Stored as is for later re-resolution. |
street | string | optional | Street (including the civic number). Completes an existing contact without overwriting a street that is already filled in. |
city | string | optional | City. Completes an existing contact without overwriting a city that is already filled in. |
sector | string | optional | Area or neighborhood. Completes an existing contact without overwriting an area that is already filled in. |
province | string | optional | Province. Completes an existing contact without overwriting a province that is already filled in. |
country | string | optional | Country. Completes an existing contact without overwriting a country that is already filled in. |
region | string | optional | Qué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. |
industry | string | optional | Industry of the lead's business: a code (real_…) 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. |
language | string | optional | Language of the lead (fr or en, or a code like fr-). An
unrecognized value is left empty. Completes an existing contact without
overwriting a language that is already filled in. |
meta | LeadCaptureMetaAttribution | optional | The 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_/adset_/campaign_ 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.); see
LeadCapturePayload. An unknown sub-field is not rejected: it is
ignored and named in the response's ignored_. |
system_id | string | optional | Target 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_
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_ in ignored_ (reason
system_). |
Responses
| Status | Description |
|---|---|
200 | Lead captured ( |
400 | Invalid request.
|
401 | The API key is missing, unknown or expired.
|
403 | Authorization refused.
|
409 | Conflict with the resource's state.
|
413 | The request body exceeds 1 MB (1,048,576 bytes).
|
415 | The
|
422 | Request refused, no lead is captured.
|
429 | Limit reached.
|
500 | Unexpected server error. Always include the
|
501 | Test keys (
|
503 | A service the request depends on didn't respond (reading the key, the
account or the plan). The same request will go through once it's back:
retry after the
|
Example request
curl -X POST 'https://api.capturia.io/v1/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"
}'