API Reference
Track event
Track an event for a contact. Automatically creates/updates the contact.
Authorization
ApiKeyAuth AuthorizationBearer <token>
API Key authentication. Secret keys (sk_*) are required for all endpoints except /v1/track. Public keys (pk_*) only work with the /v1/track endpoint for client-side event tracking. The project is automatically derived from the key.
In: header
Request Body
application/json
email*string
Contact email
Format
emailevent*string
Event name
subscribed?boolean
Whether contact is subscribed to marketing emails. Defaults to true for event tracking.
Default
truedata?
Event data and contact metadata
Response Body
application/json
curl -X POST "https://next-api.useplunk.com/v1/track" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "event": "purchase", "data": { "product": "Premium Plan", "amount": 99 } }'{
"success": true,
"data": {
"contact": {
"id": "string",
"email": "string"
},
"event": {
"id": "string",
"event": "string"
}
}
}