What are First-Party Events?
First-Party Events let you stream customer activity from your own systems (your website, app, POS add-ons, or backend) directly into your AIQ account. Any event you track (orders, subscriptions, check-ins, custom actions) becomes a targetable trait you can use to build flows.
For example, an order event like this:
{
"order_type": "coffee",
"order_total": 24.50,
"store_id": "store_1"
}
Lets you build audiences such as:
Customers who have had more than 10 coffee orders in the past 90 days
Customers who had an order with a total greater than $20 from May 1 to May 31
Customers who have orders at both store_1 and store_2
Why use First-Party Events?
Bring your own signals. Any customer activity you track becomes a targetable trait inside AIQ.
No integrator required. You send events straight to your own account with your AIQ REST API key. There is no integrator slug to request or include.
No schema setup. AIQ infers the queryable shape of each event automatically from the payloads you send. The first time AIQ sees a field, it becomes available as a trait in the audience builder.
Ingest Endpoint
POST /api/v2/native/events/ingest
Headers
Header | Required | Value |
| Yes | Your AIQ REST API key. |
| Yes |
|
The X-APIKEY both authenticates the request and determines which AIQ account the event is written to.
Request Body
Field | Type | Required | Notes |
| string | Yes | Lowercase slug (a-z, 0-9, underscore). |
| string | No | Human-friendly label shown in the AIQ UI. Defaults to |
| int64 | Yes | Unix time in seconds for when the event occurred. |
| object | Yes | The event payload. Must be a JSON object. |
| string | One of these four | Contact phone. Normalized by AIQ. |
| string | One of these four | Contact email. Normalized by AIQ. |
| string | One of these four | AIQ contact ID. |
| string | One of these four | Third-party customer identifier (usually tied to POS). |
At least one of phone, email, contactID, or srcID is required so AIQ can resolve the event to a contact.
Unlike Integrator Events, there is no integratorSlug field.
Limits
Max request body size: 64 KB
Max 20 distinct event names per account
Payloads are flattened to a max nesting depth of 3 and a max of 100 fields per payload
JSON keys must be alphanumeric/underscore only
Example Request
curl -X POST https://lab.alpineiq.com/api/v2/native/events/ingest \
-H "X-APIKEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"eventName": "subscription_renewed",
"eventDisplayName": "Subscription Renewed",
"timestamp": 1764709020,
"email": "[email protected]",
"event": {
"plan": { "tier": "gold", "monthly_price": 49.99 },
"auto_renew": true,
"promo_codes": ["WELCOME10"]
}
}'
Responses
Success
A 200 OK with an empty data object means the event was stored cleanly:
{
"code": 200,
"success": true,
"data": {}
}
Warnings
These flags appear inside data when relevant. If present, some fields may not be queryable in the audience builder.
Flag | Meaning | What to do |
| This event already has 100 distinct schema fields; new fields won't become queryable. | Trim the payload to a stable set of meaningful fields. Avoid dynamic or unbounded keys. |
| This payload contained more than 100 fields; the overflow wasn't added to the schema. | Reduce the number of fields per event. |
| The payload nested deeper than 3 levels; deeper fields weren't made filterable. | Flatten nested structures you want to make queryable. |
| One or more keys contained characters outside | Rename keys to use only letters, digits, and underscores. |
Errors
Errors use the standard AIQ envelope:
{
"code": 400,
"success": false,
"errors": [{ "message": "eventName is required" }]
}
Status | Example message | Cause |
|
| No customer identifier supplied. |
|
| Missing or malformed event name. |
|
| Missing or zero timestamp. |
|
| Empty payload or a non-object (array/scalar) |
|
| Body isn't valid JSON. |
|
| Too many distinct event names on this account. |
|
| Auth failure. |
|
| Body over 64 KB. |
|
| Transient server-side issue. Retry the request. |
Event Payloads
The event field is the heart of the request. Rules:
Must be a JSON object (
{ ... }). Top-level arrays or scalars are rejected.All keys must be alphanumeric/underscore. Non-conforming keys are skipped from the schema.
nullvalues are ignored.Nested fields are allowed up to depth 3; deeper levels are dropped from the schema.
Up to 100 fields per payload are added to the schema.
Audience Builder
Once AIQ has received your events, they will show up as traits in the audience builder under AIQ Native. These traits are available per account, and only appear once events for that account have been ingested.
You can filter on:
Field values: any field discovered from your payloads becomes a selectable filter path
Event count: match contacts by how many matching events they have (e.g. exactly 3, more than 5, less than 2)
Time window: a rolling window (e.g. the last 24 hours) or a fixed start/end date range, evaluated against the event
timestampyou sent.
Getting Set Up
Get your AIQ REST API key for the account.
Start sending events to
POST /api/v2/native/events/ingest.
Integrator Events vs. First-Party Events
| Integrator Events | First-Party Events |
Who sends events | A third-party integrator on behalf of many merchants | The merchant, for their own account |
Endpoint |
|
|
| Required, issued by AIQ | Not used |
Event name limit | 20 per integrator | 20 per account |
Onboarding | AIQ creates the integrator | None beyond an API key |