API reference · v1
Events
Accept durable business events, inspect readiness, and bind anonymous source identities to contacts.
List events
/v1/eventsLists only ready business events for one event schema. Results are ordered by occurredAt descending, then id descending. The time filter is inclusive from and exclusive to; defaults are the seven days before now. A range wider than 90 days is clamped with a warning. Uses cursor pagination: no offset and no totalCount. Pending, failed, and outcome_unknown acceptances are absent; use events.status to inspect them. Invalid times return 400 invalid_time_range; malformed cursors return 400 invalid_cursor. Events are read from the operational event store, not the analytics archive.
Query parameters
- Name
schema- Type
- string
- Requirement
- Required
- Description
- The event schema id or slug.
- Name
from- Type
- string (date-time)
- Description
- Start of the time range (ISO 8601). Defaults to 7 days before
to.
- Name
to- Type
- string (date-time)
- Description
- End of the time range (ISO 8601). Defaults to now.
- Name
cursor- Type
- string
- Description
- Opaque cursor from a previous page's
pagination.nextCursor.
- Name
limit- Type
- integer
- Description
- Page size. Defaults to 50, capped at 200.
Request
curl --fail-with-body 'https://api.maxclicks.ai/v1/events?schema=students' \
-H "Authorization: Bearer $MAXCLICKS_API_KEY"Response
{
"data": [
{
"id": "ev_BcwDvBUeSaSDILA5tHgpmU7I",
"schemaId": "sch_BcwDvBUeSaSDILA5tHgpmU7I",
"schemaSlug": "string",
"eventId": "order_10014",
"createdAt": "2025-01-15T10:30:00.000Z",
"receivedAt": "2025-01-15T10:30:00.000Z",
"occurredAt": "2025-01-15T10:30:00.000Z",
"readyAt": "2025-01-15T10:30:00.000Z",
"readinessState": "pending",
"definitionRevision": "string",
"contactId": "con_BcwDvBUeSaSDILA5tHgpmU7I",
"objectId": "ev_BcwDvBUeSaSDILA5tHgpmU7I"
}
],
"pagination": {
"limit": 0,
"nextCursor": "string",
"hasMore": false
},
"warnings": []
}Status codes
- 200A cursor page of events.
- 400The request was malformed or failed validation. Also covers
malformed_json(body is not valid JSON) and, on list endpoints,offset_too_large. - 401The API key is missing or invalid.
- 403The key lacks permission, or the space is out of scope.
- 404The referenced resource was not found.
- 429The rate limit was exceeded.
- 500The API failed to process a valid request.
Fire an event
/v1/events/{schema}Durably accepts one business event and returns 202 with its immutable acceptance receipt. Missing AI auto-fill fields are prepared asynchronously; readinessAtAcceptance is pending or ready. An accepted event is visible to event lists and consumers only once ready. Supply a stable eventId and retry the same normalized payload and occurredAt to recover the original receipt with isDuplicate=true. Changed input under the same eventId returns 409 event_id_conflict; erased occurrences return 409 event_erased. Idempotency-Key is not used. The normalized event input is limited to 256 KiB. occurredAt must be within the previous 366 days or five minutes into the future. contactId and objectId are optional, mutually exclusive explicit subjects in this space. Event admission has separate rate, backlog, and receipt-storage limits in addition to the API write bucket.
Path parameters
- Name
schema- Type
- string
- Requirement
- Required
- Description
- The event schema id or slug.
Request body
Send JSON with Content-Type: application/json. A body is required.
Flat event acceptance input. Custom writable attribute keys are top-level and normalized against the event schema. Any id is ignored on fire. Reserved readiness fields are not caller-controlled. Supply eventId for retry deduplication. The normalized input has a 256 KiB ceiling.
- Name
eventId- Type
- string | null
- Description
- Caller-owned occurrence identifier, scoped to the space and event schema. Reuse with identical input and occurredAt for retries. If omitted or null, the server generates a UUID; save the returned eventId. A changed payload under the same value returns event_id_conflict.
- Name
occurredAt- Type
- string (date-time)
- Description
- When the event occurred. Defaults to acceptance time; explicit values must be no more than 366 days old or five minutes in the future. Preserve the same explicit value on retries.
- Name
contactId- Type
- string | null
- Description
- Explicit contact subject id in this space. Mutually exclusive with objectId.
- Name
objectId- Type
- string | null
- Description
- Explicit object subject id in this space. Mutually exclusive with contactId.
Request
curl --fail-with-body 'https://api.maxclicks.ai/v1/events/students' \
-X POST \
-H "Authorization: Bearer $MAXCLICKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eventId": "order_1042_paid",
"amount": 42
}'Response
{
"data": {
"accepted": 1,
"id": "ev_BcwDvBUeSaSDILA5tHgpmU7I",
"eventId": "order_1042_paid",
"isDuplicate": false,
"readinessAtAcceptance": "pending"
},
"warnings": []
}Status codes
- 202Durable event acceptance receipt; inspect readiness separately.
- 400The request was malformed or failed validation. Also covers
malformed_json(body is not valid JSON) and, on list endpoints,offset_too_large. - 401The API key is missing or invalid.
- 403The key lacks permission, or the space is out of scope.
- 404The referenced resource was not found.
- 409The write conflicts with an existing resource or the resource's current state.
- 413The request body exceeds the 10 MB limit.
- 415The request used an unsupported content type, charset, or content encoding.
- 429The rate limit was exceeded.
- 500The API failed to process a valid request.
Fire a batch of events
/v1/events/{schema}/batchAccepts 1–500 events of one schema. With onError=continue (default), each event commits independently; inspect every result, including failures, even on HTTP 200. Accepted items include their immutable receipt. Admission failures include retryAfterMilliseconds. With onError=abort, a validation or admission failure rolls back new acceptances in that transaction, marks earlier accepted results rolled_back, and returns HTTP 422 with data.results, data.summary, and data.failedIndex. Later items are not attempted. Existing receipts encountered as duplicates remain existing occurrences. A 422 abort response is a business-result data envelope, not the standard error envelope. Each item uses eventId deduplication; Idempotency-Key is not used. Individual events retain the 256 KiB and occurredAt limits, and the whole HTTP body remains limited to 10 MB.
Path parameters
- Name
schema- Type
- string
- Requirement
- Required
- Description
- A schema id or slug.
Request body
Send JSON with Content-Type: application/json. A body is required.
- Name
events- Type
- object[]
- Requirement
- Required
- Description
- See the request example and OpenAPI schema for this field.
- Name
onError- Type
- string
- Description
- Allowed values: "continue", "abort". Default: "continue".
Request
curl --fail-with-body 'https://api.maxclicks.ai/v1/events/students/batch' \
-X POST \
-H "Authorization: Bearer $MAXCLICKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"eventId": "order_1042_paid",
"amount": 42
}
],
"onError": "continue"
}'Response
{
"data": {
"results": [
{
"index": 0,
"status": "accepted",
"id": "ev_BcwDvBUeSaSDILA5tHgpmU7I",
"eventId": "order_1042_paid",
"isDuplicate": false,
"readinessAtAcceptance": "pending"
}
],
"summary": {
"accepted": 1,
"failed": 0
}
},
"warnings": []
}Status codes
- 200Per-item results and a summary.
- 400The request was malformed or failed validation. Also covers
malformed_json(body is not valid JSON) and, on list endpoints,offset_too_large. - 401The API key is missing or invalid.
- 403The key lacks permission, or the space is out of scope.
- 404The referenced resource was not found.
- 413The request body exceeds the 10 MB limit.
- 415The request used an unsupported content type, charset, or content encoding.
- 422Batch aborted; earlier new acceptances were rolled back. Inspect data.results and data.failedIndex.
- 429The rate limit was exceeded.
- 500The API failed to process a valid request.
Get event readiness
/v1/events/{schema}/{id}/statusRead the current readiness of an accepted event by its maxclicks event id, including pending, ready, failed, and outcome_unknown states. This is distinct from the immutable readinessAtAcceptance returned when firing or retrying the event. data contains raw acceptance values until preparation is ready. A missing event or event schema returns 404. Acceptance and readiness do not prove that a downstream workflow, webhook, or email completed.
Path parameters
- Name
schema- Type
- string
- Requirement
- Required
- Description
- Event schema id or slug.
- Name
id- Type
- string
- Requirement
- Required
- Description
- The maxclicks event id from the acceptance receipt, not your eventId.
Request
curl --fail-with-body 'https://api.maxclicks.ai/v1/events/purchase-completed/ev_BcwDvBUeSaSDILA5tHgpmU7I/status' \
-H "Authorization: Bearer $MAXCLICKS_API_KEY"Response
{
"data": {
"id": "ev_BcwDvBUeSaSDILA5tHgpmU7I",
"eventId": "order_1042_paid",
"receivedAt": "2026-09-14T10:30:00.000Z",
"occurredAt": "2026-09-14T10:30:00.000Z",
"readyAt": null,
"readinessState": "pending",
"definitionRevision": "f2d9685136d4746456815a2b8a6d7a3f9eba98dfc4d6129497778d5037410d7a",
"contactId": null,
"objectId": null,
"data": {
"amount": 42
}
},
"warnings": []
}Status codes
- 200Current event readiness and accepted/prepared data.
- 400The request was malformed or failed validation. Also covers
malformed_json(body is not valid JSON) and, on list endpoints,offset_too_large. - 401The API key is missing or invalid.
- 403The key lacks permission, or the space is out of scope.
- 404The referenced resource was not found.
- 409The write conflicts with an existing resource or the resource's current state.
- 429The rate limit was exceeded.
- 500The API failed to process a valid request.
Bind an anonymous event identity
/v1/event-identitiesBinds or unbinds an anonymous browser identity to a contact using a server-held API key with write permission. An enabled contact track definition must match sourceId and subjectSchemaId in the space. Send contactId=null to remove the binding. All six body fields are required and unknown fields are rejected. Use a UUID operationId for replay of the same input; a changed body under that operationId returns 409. expectedAliasRevision is the last revision of this specific alias as a decimal string, or "0" for a new alias. Keep the returned identityRevision for the next change to that alias. Revision conflicts and erased aliases return 409; an unavailable source returns 403. Capacity is bounded at 100,000 aliases and 1,000,000 changes per space; exhausted capacity returns 429 without promising automatic recovery. Idempotency-Key is not used.
Request body
Send JSON with Content-Type: application/json. A body is required.
- Name
sourceId- Type
- string
- Requirement
- Required
- Description
- Source id matching an enabled contact track definition.
- Name
subjectSchemaId- Type
- string
- Requirement
- Required
- Description
- Contact schema id (not a slug) used by the track.
- Name
anonymousId- Type
- string
- Requirement
- Required
- Description
- Browser identity in the configured source.
- Name
contactId- Type
- string | null
- Requirement
- Required
- Description
- Contact in the subject schema, or null to unbind.
- Name
operationId- Type
- string (uuid)
- Requirement
- Required
- Description
- Stable UUID for this identity change; reuse the same body on retries.
- Name
expectedAliasRevision- Type
- string
- Requirement
- Required
- Description
- Last known revision for this alias. Use "0" only for a new alias.
Request
curl --fail-with-body 'https://api.maxclicks.ai/v1/event-identities' \
-X POST \
-H "Authorization: Bearer $MAXCLICKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sourceId": "source_website",
"subjectSchemaId": "sch_BcwDvBUeSaSDILA5tHgpmU7I",
"anonymousId": "visitor_1042",
"contactId": "con_BcwDvBUeSaSDILA5tHgpmU7I",
"operationId": "e125aecb-8b4e-4c7e-8f08-8f768bced7ab",
"expectedAliasRevision": "0"
}'Response
{
"data": {
"identityRevision": "string",
"affectedSubjectIds": [
"ev_BcwDvBUeSaSDILA5tHgpmU7I"
],
"isDuplicate": false
},
"warnings": []
}Status codes
- 200The committed identity revision.
- 400The request was malformed or failed validation. Also covers
malformed_json(body is not valid JSON) and, on list endpoints,offset_too_large. - 401The API key is missing or invalid.
- 403The key lacks permission, or the space is out of scope.
- 404The referenced resource was not found.
- 409The write conflicts with an existing resource or the resource's current state.
- 429The rate limit was exceeded.
- 500The API failed to process a valid request.
Working with these endpoints? See error handling, safe retries, client library guides, and the complete OpenAPI schema.