Events
2 endpoints
/v1/eventsPush a custom event that triggers automations
Generic inbound webhook per account: an external source (Zapier, Make,
n8n, a client backend, a third-party tool) pushes a named event with
its data. Capturia resolves the contact (external_ → phone →
email), enriches the contact non-destructively, fills in the mapped custom
fields, records the event on the contact, then starts
the automations whose "Custom event" trigger
listens for this event name — with the payload: a top-level key made
of unaccented letters, digits and _ is cited in messages through
{{event., and any key can be read, with no field created
beforehand, in the trigger filter and in a condition ("Event data").
Contact resolution
At least one identifier is required (external_, email or phone).
If no contact matches, a minimal contact is created — unless
contact. is false, in which case the request returns
404 contact_ without recording anything. If the identifiers
only match an archived contact, the event is recorded on it
(for traceability) but the contact is not modified and no automation
is enrolled (contact_).
Consent (Law 25 / CASL)
Receiving an event does not establish any communication consent. A contact created through this path cannot receive SMS/email until consent is captured through another flow; a triggered automation that tries to send without consent is blocked by the execution engine's guards.
Optional HMAC signature
In addition to the API key, the request can carry a signature
X- — an HMAC-SHA256 of
${t}. computed with the raw API key as the secret,
with a 5-minute anti-replay window. As soon as the header is present,
validation is strict (fail-closed): an invalid signature = 401 invalid_. Without the header, the API key alone authenticates the request.
Idempotency
The Idempotency- header is optional but recommended for
retries: a second request with the same key and the same payload returns the
original response without ingesting the event again (stored for 24h; a
different payload = 409 idempotency_). In addition, automation
enrollment has its own 5-minute deduplication per contact and per
automation.
Custom error codes
- 429 —
rate_when the per-IP-address limit (120 requests per minute) is reached, with headerlimited_ ip X-.RateLimit- Scope: ip rate_when the key's hourly quota, counted across all its requests, is used up.limit_ exceeded
events:ingestHeaders
| 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 |
|---|---|---|---|
event | string | required | Event name, in the account's namespace. Compared to the name
configured on the automations' "Custom event" trigger regardless of
capital letters and of spaces at the start or end, non-breaking spaces
included: Cart_ and cart_ are the same event. |
contact | EventIngestContact | required | Identity of the contact the event targets. At least one identifier is
required among external_, email, phone. The server resolves the contact
in the order external_+external_ → phone → email; the identity
fields you send enrich the contact non-destructively (a
value that is already set is never overwritten).
A name received with the text "[object Object]" (a mapping that points to
an object instead of a field) is cleared of it: the readable part is
saved; if nothing remains, the name is absent. |
payload | object | optional | Arbitrary event data. A top-level key made of unaccented letters,
digits and _ is cited in automation messages through
{{event. (a nested object is serialized as JSON); a hyphen,
a space or an accent makes it impossible to cite. Any top-level key
is read as is, with no field created beforehand, in the "Custom
event" trigger filter and in a condition ("Event data"): a text, a
number or a boolean, never an object. The stored content is capped
(number of keys, depth, total size). |
custom_fields | object | optional | Custom fields of the contact, keyed by the definition's name
(same contract as /). A key with no matching
definition is silently ignored. Additive merge: the
new value wins on collision. |
source_label | string | optional | Free-form label identifying the source (shown on the contact). |
Responses
| Status | Description |
|---|---|
200 | Event ingested ( |
400 | Invalid request.
|
401 | The API key or the signature is refused.
|
403 | Authorization refused.
|
404 | Resource not found.
|
409 | Idempotency key conflict. The same
|
413 | The request body exceeds 1 MB (1,048,576 bytes).
|
415 | The
|
422 | Request refused.
|
429 | Rate limit reached.
|
500 | Unexpected server error. Always include the
|
501 | Test keys (
|
503 | A service the request depends on didn't respond (reading the key, the
account or the plan). The same request will go through once it's back:
retry after the
|
Example request
curl -X POST 'https://api.capturia.io/v1/events' \
-H 'Authorization: Bearer cap_live_<your-key>' \
-H 'Content-Type: application/json' \
-d '{
"event": "abandon_panier",
"contact": {
"external_id": "user-4821",
"external_source": "mon-backend",
"email": "[email protected]",
"first_name": "Alex"
},
"payload": {
"montant": 249.99,
"produit": "Forfait Pro",
"url_panier": "https://boutique.example.com/panier/abc123"
},
"custom_fields": {
"plan_vise": "pro"
},
"source_label": "Boutique en ligne"
}'/v1/event-registrationsRegister a contact for an event
Registers an existing contact of the account for a published event (webinar, challenge, summit, online event). The person then receives the event's messages, just as if they had registered through its page.
One registration per person and per edition: a second call
for the same contact and the same edition returns the same registration with
200 and created: false, without resending the confirmation. It updates the
language, and re-registers a person who had said they would not
attend, as long as a seat is left (event_ otherwise); a person
who asked to stop receiving messages stays opted out. The call is
therefore safe to retry, without an Idempotency- header.
Requires the plan's Event support module
(403 feature_ otherwise) and the contacts:write scope.
Rejections
404 resource_withnot_ found details.:resource contact(contact missing, merged or from another account),eventoredition.422 business_withrule_ violation details.:rule event_(draft),not_ published event_(event archived, edition cancelled, or no upcoming edition),closed event_(edition ended),edition_ ended event_(every seat of the edition is taken).full 400 validation_: a body field is refused;error detailsnames each field and its reason, includingexactly_onone_ of_ event_ id_ or_ event_ slug event_whenid event_andid event_are both present or both missing. A body that is not JSON returnsslug 400 invalid_, a body that is not an objectjson 400 invalid_.body
contacts:writeRequest body
| Property | Type | Required | Description |
|---|---|---|---|
contact_id | string | required | Contact to register. |
event_id | string | optional | Identifier of the event. |
event_slug | string | optional | Address of the event, as it appears in its registration link. |
edition_id | string | optional | Target edition. If omitted: the open edition where the contact already holds a seat, otherwise the next one that still has a seat, as on the registration page. |
language | string | optional | Language of the messages. If omitted: the event's first language. Allowed values: |
Responses
| Status | Description |
|---|---|
200 | The contact was already registered for this edition; the same registration is returned. |
201 | Registration created. |
400 | Invalid request.
|
401 | The API key is missing, unknown or expired.
|
403 | Authorization refused.
|
404 | Resource not found.
|
413 | The request body exceeds 1 MB (1,048,576 bytes).
|
415 | The
|
422 | Request refused.
|
429 | Rate limit reached.
|
500 | Unexpected server error. Always include the
|
501 | Test keys (
|
503 | A service the request depends on didn't respond (reading the key, the
account or the plan). The same request will go through once it's back:
retry after the
|
Example request
curl -X POST 'https://api.capturia.io/v1/event-registrations' \
-H 'Authorization: Bearer cap_live_<your-key>' \
-H 'Content-Type: application/json' \
-d '{
"contact_id": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"event_slug": "defi-5-jours",
"language": "fr"
}'