Base URL
All API requests are made to the following base URL:API Conventions
Before making your first request, familiarize yourself with the conventions used across every endpoint. Requests and responses All request bodies must be sent as JSON, and all responses are returned as JSON. Include theContent-Type: application/json header on every request that sends a body.
Timestamps
All timestamps are formatted as ISO 8601 strings in UTC (e.g., 2024-11-01T14:32:00Z).
Resource IDs
Every resource has a prefixed string ID that indicates its type at a glance:
Errors
Failed requests return a JSON body with a top-level
error object containing a machine-readable code and a human-readable message. Use error.code in your error-handling logic and error.message for logging.
Quick Example
The following request tracks apage_viewed event for a user. Swap in your own API key, user ID, and properties to run it immediately.
Response Format
Every API response follows one of two shapes depending on whether the request succeeded or failed.- Success
- Error
A successful response returns a
2xx status code and a JSON body describing the created or queried resource.Success Response
Next Steps
Before making API calls, set up authentication and review the rate limits so your integration stays healthy.Authentication
Learn how to generate API keys and attach them to every request.
Rate Limits
Understand per-endpoint quotas and how to handle 429 responses gracefully.
Explore the API
Events
Track user actions and custom events from any source.
Users
Identify users and enrich their profiles with traits.
Dashboards
Query and manage your analytics dashboards programmatically.
Reports
Generate and export reports from your workspace data.