API Reference — Authentication & Overview
SegOps exposes a REST API for ingesting events, querying segment membership, managing segments and connectors, and exploring user profiles. All responses are JSON.
Base URL#
All API paths begin with /api/. For self-hosted deployments, replace api.segops.ai with your own domain.
Authentication#
The API supports two authentication schemes:
| Scheme | Header | Use case |
|---|---|---|
| JWT (Bearer) | Authorization: Bearer <access_token> | User-facing calls from web/mobile apps |
| API Key | Authorization: ApiKey <key> | Server-to-server: ingestion, membership checks, scripts |
Obtaining a JWT
The access token expires in 60 minutes. Refresh it with:
Using an API Key
Rate Limits#
| Plan | Events / month | API calls / min |
|---|---|---|
| Free | 500,000 | 60 |
| Starter | 5,000,000 | 300 |
| Business | 50,000,000 | 1,000 |
| Enterprise | Unlimited | Custom |
When a limit is exceeded, the server returns 429 Too Many Requests with a Retry-After header.
Error Format#
All errors use a consistent response shape:
For field validation errors:
| HTTP Status | Meaning |
|---|---|
| 200 / 201 / 202 | Success |
| 400 | Bad request or validation error |
| 401 | Missing or invalid credentials |
| 403 | Authenticated but not authorized (role or plan) |
| 404 | Resource not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Pagination#
Large collections use cursor-based pagination:
Pass next_cursor as the cursor query parameter in subsequent requests. When next_cursor is null, you have reached the end. Standard list endpoints use offset pagination:
Timestamps#
All timestamps are ISO 8601 / RFC 3339 in UTC:
When ingesting events, omit occurred_atto default to the server's receive time.
$JWT with your access token and $API_KEY with your API key in all examples.