Server-to-Server API
Use the Server-to-Server API for backend event tracking.
Endpoint
Section titled “Endpoint”POST https://analyze-ingest.thismatters.workers.dev/api/v1/trackAuthentication
Section titled “Authentication”Include your API key in the header:
Authorization: Bearer pk_live_xxxxxRequest Body
Section titled “Request Body”{ "events": [ { "event_type": "purchase", "user_id": "user_123", "timestamp": "2024-01-15T10:30:00Z", "event_attributes": { "order_id": "ORD-456", "revenue": 99.00 } } ]}Example (Node.js)
Section titled “Example (Node.js)”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 } }] }) });