SegOps AIDocs

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#

http
https://api.segops.ai

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:

SchemeHeaderUse case
JWT (Bearer)Authorization: Bearer <access_token>User-facing calls from web/mobile apps
API KeyAuthorization: ApiKey <key>Server-to-server: ingestion, membership checks, scripts

Obtaining a JWT

bash
curl -X POST https://api.segops.ai/api/auth/token/ \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "password": "..." }'

# Response:
# { "access": "eyJ...", "refresh": "eyJ..." }

The access token expires in 60 minutes. Refresh it with:

bash
curl -X POST https://api.segops.ai/api/auth/token/refresh/ \
  -H "Content-Type: application/json" \
  -d '{ "refresh": "eyJ..." }'

Using an API Key

bash
curl https://api.segops.ai/api/segments/membership/?user_id=user-123 \
  -H "Authorization: ApiKey sk_live_xxxxxxxxxxxxxxxx"

Rate Limits#

PlanEvents / monthAPI calls / min
Free500,00060
Starter5,000,000300
Business50,000,0001,000
EnterpriseUnlimitedCustom

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:

json
{ "detail": "Human-readable error message" }

For field validation errors:

json
{ "field_name": ["Error message for this field"] }
HTTP StatusMeaning
200 / 201 / 202Success
400Bad request or validation error
401Missing or invalid credentials
403Authenticated but not authorized (role or plan)
404Resource not found
429Rate limit exceeded
500Internal server error

Pagination#

Large collections use cursor-based pagination:

bash
GET /api/segments/<id>/members/?limit=1000&cursor=<opaque_cursor>
Authorization: ApiKey sk_...
json
{
  "results": [...],
  "next_cursor": "dXNlci01Njc4",
  "count": 48210
}

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:

json
{
  "count": 12,
  "next": "https://api.segops.ai/api/segments/?limit=10&offset=10",
  "previous": null,
  "results": [...]
}

Timestamps#

All timestamps are ISO 8601 / RFC 3339 in UTC:

text
2026-04-25T14:32:00Z

When ingesting events, omit occurred_atto default to the server's receive time.

Note
All API endpoints are documented with example curl commands. Replace $JWT with your access token and $API_KEY with your API key in all examples.