Base URL
The API runs on port3100 by default (controlled by the PORT environment variable). Point all requests at your Egma instance:
http://localhost:3100. The web interface runs separately on port 3101; use port 3100 for all API calls.
If you deploy Egma behind a reverse proxy, the API and web interface share a
single origin. Use the origin your proxy exposes rather than a port-suffixed
address in that case.
Authentication
Every request must carry an API key in theAuthorization header:
Request and Response Format
All request bodies and all responses are JSON. SetContent-Type: application/json on every request that sends a body.
Here is a minimal example — fetching your API keys with curl:
Pagination
All paginated list endpoints return a top-levelitems array and a next_cursor field. The cursor is the ID of the last item in the page:
next_cursor is null, you have reached the last page. To fetch the next page, pass the cursor as a query parameter:
Errors
All error responses follow a consistent shape:error field is a stable snake_case code your code can branch on. The message field is a plain-English sentence meant for developers — it may improve across releases, so do not match against it programmatically.
HTTP Status Codes
Rate Limiting
Egma applies a fixed-window rate limit of 600 requests per minute per organization by default (configurable viaEGMA_RATE_LIMIT_PER_MINUTE). The limit is keyed on your organization, not on the individual key — rotating a key does not reset your budget.
When you exceed the limit, the API returns 429 with a Retry-After header indicating how many seconds remain until the window resets:
OTLP Trace Ingest
Egma accepts OpenTelemetry traces at the standard OTLP/HTTP endpoint:Protobuf encoding
Send
Content-Type: application/x-protobuf for the standard binary format used by most OpenTelemetry SDKs.JSON encoding
Send
Content-Type: application/json for the OTLP JSON format, useful for debugging with curl.Content-Encoding: gzip when sending a compressed body. The maximum body size is 20 MiB (matching the OpenTelemetry Collector default).
Authentication: pass your project-scoped API key in the Authorization: Bearer egma_sk_... header, exactly as with every other API request. Trace ingest requires a project-scoped key — an org-wide key without a project association cannot file spans.
The response follows the OTLP ExportTraceServiceResponse schema, including a partialSuccess field when some spans were rejected. Your exporter reads this natively.
Health Check
200 when healthy, 503 when either store is unreachable. The status field is either "ok" or "unavailable". This endpoint does not require authentication.