Ingest a customer event or claim
curl --request POST \
--url https://swapnice-gateway-dev.ceo-cbc.workers.dev/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://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://swapnice-gateway-dev.ceo-cbc.workers.dev/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://swapnice-gateway-dev.ceo-cbc.workers.dev/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://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://swapnice-gateway-dev.ceo-cbc.workers.dev/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
Headers
Body
application/json