Skip to main content
POST
/
v1
/
track
curl --request POST \ --url https://api.mailglyph.com/v1/track \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "email": "[email protected]", "event": "purchase", "data": { "product": "Premium Plan", "amount": 99 } } '
{
  "success": true,
  "data": {
    "contact": "<string>",
    "event": "<string>",
    "timestamp": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

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.

Body

application/json
email
string<email>
required

Contact email

event
string
required

Event name

subscribed
boolean
default:true

Whether contact is subscribed to marketing emails. Defaults to true for event tracking.

data
Example object · object

Optional event data and contact metadata. Choose Empty object if you do not want to send any example preset keys.

Example:
{ "product": "Premium Plan", "amount": 99 }

Response

200 - application/json

Event tracked successfully

success
boolean
data
object