Skip to content

Server-to-Server API

Use the Server-to-Server API for backend event tracking.

POST https://analyze-ingest.thismatters.workers.dev/api/v1/track

Include your API key in the header:

Authorization: Bearer pk_live_xxxxx
{
"events": [
{
"event_type": "purchase",
"user_id": "user_123",
"timestamp": "2024-01-15T10:30:00Z",
"event_attributes": {
"order_id": "ORD-456",
"revenue": 99.00
}
}
]
}
const response = await fetch(
'https://analyze-ingest.thismatters.workers.dev/api/v1/track',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer pk_live_xxxxx'
},
body: JSON.stringify({
events: [{
event_type: 'subscription_renewed',
user_id: 'user_123',
event_attributes: {
plan: 'pro',
mrr: 49
}
}]
})
}
);