Ingest a customer event or claim
curl --request POST \
--url https://api.swapnice.com/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"customer_id": "cust_8f2a1c",
"client_event_id": "evt_checkout_8891",
"consent_receipt_id": "cr_44aa01",
"consent_purpose": "personalization",
"event_type": "purchase.completed",
"ontology": "intent",
"ontology_category": "outcome",
"object": "sku_blue_eyes_tin",
"occurred_at": "2026-08-26T16:04:00.000Z",
"confidence": 1,
"payload": {
"sku": "sku_blue_eyes_tin",
"currency": "USD",
"amount": 24.99
},
"context": {
"surface": "checkout",
"storefront": "ios"
},
"provenance": {
"source_partner": "partner_app",
"source_system": "ios",
"collected_at": "2026-08-26T16:04:00.000Z"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: 'cust_8f2a1c',
client_event_id: 'evt_checkout_8891',
consent_receipt_id: 'cr_44aa01',
consent_purpose: 'personalization',
event_type: 'purchase.completed',
ontology: 'intent',
ontology_category: 'outcome',
object: 'sku_blue_eyes_tin',
occurred_at: '2026-08-26T16:04:00.000Z',
confidence: 1,
payload: {sku: 'sku_blue_eyes_tin', currency: 'USD', amount: 24.99},
context: {surface: 'checkout', storefront: 'ios'},
provenance: {
source_partner: 'partner_app',
source_system: 'ios',
collected_at: '2026-08-26T16:04:00.000Z'
}
})
};
fetch('https://api.swapnice.com/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/events"
payload = {
"customer_id": "cust_8f2a1c",
"client_event_id": "evt_checkout_8891",
"consent_receipt_id": "cr_44aa01",
"consent_purpose": "personalization",
"event_type": "purchase.completed",
"ontology": "intent",
"ontology_category": "outcome",
"object": "sku_blue_eyes_tin",
"occurred_at": "2026-08-26T16:04:00.000Z",
"confidence": 1,
"payload": {
"sku": "sku_blue_eyes_tin",
"currency": "USD",
"amount": 24.99
},
"context": {
"surface": "checkout",
"storefront": "ios"
},
"provenance": {
"source_partner": "partner_app",
"source_system": "ios",
"collected_at": "2026-08-26T16:04:00.000Z"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"event_id": "evt_9c21",
"status": "accepted",
"sequence": 7,
"accepted_at": "2026-08-26T16:04:00.120Z",
"processing_status": "queued"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Events
Ingest an event
Accept one consented activity event. Idempotency-Key is required.
POST
/
v1
/
events
Ingest a customer event or claim
curl --request POST \
--url https://api.swapnice.com/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"customer_id": "cust_8f2a1c",
"client_event_id": "evt_checkout_8891",
"consent_receipt_id": "cr_44aa01",
"consent_purpose": "personalization",
"event_type": "purchase.completed",
"ontology": "intent",
"ontology_category": "outcome",
"object": "sku_blue_eyes_tin",
"occurred_at": "2026-08-26T16:04:00.000Z",
"confidence": 1,
"payload": {
"sku": "sku_blue_eyes_tin",
"currency": "USD",
"amount": 24.99
},
"context": {
"surface": "checkout",
"storefront": "ios"
},
"provenance": {
"source_partner": "partner_app",
"source_system": "ios",
"collected_at": "2026-08-26T16:04:00.000Z"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: 'cust_8f2a1c',
client_event_id: 'evt_checkout_8891',
consent_receipt_id: 'cr_44aa01',
consent_purpose: 'personalization',
event_type: 'purchase.completed',
ontology: 'intent',
ontology_category: 'outcome',
object: 'sku_blue_eyes_tin',
occurred_at: '2026-08-26T16:04:00.000Z',
confidence: 1,
payload: {sku: 'sku_blue_eyes_tin', currency: 'USD', amount: 24.99},
context: {surface: 'checkout', storefront: 'ios'},
provenance: {
source_partner: 'partner_app',
source_system: 'ios',
collected_at: '2026-08-26T16:04:00.000Z'
}
})
};
fetch('https://api.swapnice.com/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/events"
payload = {
"customer_id": "cust_8f2a1c",
"client_event_id": "evt_checkout_8891",
"consent_receipt_id": "cr_44aa01",
"consent_purpose": "personalization",
"event_type": "purchase.completed",
"ontology": "intent",
"ontology_category": "outcome",
"object": "sku_blue_eyes_tin",
"occurred_at": "2026-08-26T16:04:00.000Z",
"confidence": 1,
"payload": {
"sku": "sku_blue_eyes_tin",
"currency": "USD",
"amount": 24.99
},
"context": {
"surface": "checkout",
"storefront": "ios"
},
"provenance": {
"source_partner": "partner_app",
"source_system": "ios",
"collected_at": "2026-08-26T16:04:00.000Z"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"event_id": "evt_9c21",
"status": "accepted",
"sequence": 7,
"accepted_at": "2026-08-26T16:04:00.120Z",
"processing_status": "queued"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Accept one consented activity event. Idempotency-Key is required.
Returns
202 after durable accept. Profile reads see the event after status is processed. See events and intents.Authorizations
OAuth 2.1 authorization code with PKCE. Implicit and password flows are unsupported.
Headers
Required for mutating requests. Replays with the same key and payload hash return
the original logical result; replays with a different payload hash return 409.
Required string length:
16 - 255Optional caller-supplied correlation ID echoed in responses and errors.
Body
application/json
Partner-generated event ID used alongside the idempotency key.
Example:
"purchase.completed"
Example:
"ygo"
Available options:
account_linking, personalization, analytics, support, event_enrichment, profile_resolution, measurement Available options:
outcome, sentiment, affiliate, habit, activation Catalog or intent object the event is about, such as an entry_id or SKU.
Example:
"sku_blue_eyes_tin"
Required range:
0 <= x <= 1Show child attributes
Show child attributes
⌘I