Base URLs
PostHog Cloud is available in two regions. Use the base URL that matches your deployment:All API requests must use HTTPS. HTTP requests will be rejected.
Response format
The API returns JSON-formatted responses. Successful requests return a200 status code along with the requested data.
Success response
Error response
Errors return appropriate HTTP status codes with details:Common status codes
| Status Code | Description |
|---|---|
200 | Success |
201 | Resource created |
400 | Bad request - check your parameters |
401 | Unauthorized - check your API key |
403 | Forbidden - rate limit exceeded or insufficient permissions |
404 | Resource not found |
429 | Too many requests - you’ve hit a rate limit |
500 | Server error |
Pagination
List endpoints return paginated results. The response includes pagination metadata:offset and limit query parameters to navigate:
Making your first request
Here’s a simple example to list your projects:API endpoint structure
API endpoints follow a consistent pattern:/api/projects/123/insights/- List insights for project 123/api/projects/123/feature_flags/- List feature flags for project 123/api/projects/123/events/- Query events for project 123
Next steps
Authentication
Learn how to create and use personal API keys
Rate limits
Understand rate limiting and best practices