POST /v1/traces, so the same credential that calls the REST API is the one your voice agent’s OpenTelemetry exporter uses.
Key Format
Every Egma API key begins with the prefixegma_sk_ followed by 43 characters of base64url-encoded random data:
Creating a Key
Send aPOST request to /api/keys. You may optionally name the key and associate it with a specific project.
Request Body
string
A human-readable label for this key. Useful for identifying keys in the list
view. Optional — omit to create an unnamed key.
string
Scopes this key to a single project. Required for trace ingest — a key with
no project cannot file spans. Optional for keys that only call REST endpoints.
Response
string
Stable identifier for the key. Use this when revoking.
string
The full API key secret. This is the only time Egma returns the secret.
Copy it immediately — after this response it is gone.
string
The label you supplied, or
null if you did not provide one.string
Either
"project" (when project_id was supplied) or "organization".string
The organization this key belongs to. Always derived from your credential,
never from the request body.
string
The project this key is scoped to, or
null for an org-wide key.string
A display hint showing the prefix and the last four characters of the secret.
Used to identify a key without exposing it. All subsequent API responses use
this field instead of the secret.
string
The user account that minted this key.
string
ISO 8601 timestamp of when the key was created.
string | null
ISO 8601 timestamp of the most recent successful request using this key,
or
null if the key has never been used.string | null
ISO 8601 timestamp of when the key was revoked, or
null if the key is
still active.Using a Key
Include the key in theAuthorization header on every request:
Listing Keys
Fetch all keys visible to your credential:The list response never includes the
secret field — only the looks_like
hint. Admins see every key in the organization; other roles see only the keys
they created.Revoking a Key
Send aPOST request to /api/keys/:apiKeyId/revoke using the key’s id:
revoked_at populated:
404.
Project-Scoped vs. Org-Wide Keys
Project-scoped key
Created with a
project_id. Required for OTLP trace ingest — spans must
be filed under a specific project. Restricts all operations to that project.Org-wide key
Created without a
project_id. Can access resources across all projects
in the organization. Cannot ingest traces.Recommended Key Rotation Workflow
1
Create a replacement key
Mint a new key with
POST /api/keys, using the same name and project_id as the key you are replacing.2
Copy the secret immediately
The
secret field in the response is shown only once. Store it in your secrets manager before the response window closes.3
Deploy the new key
Update your CI environment, agent configuration, or application secrets to use the new key.
4
Revoke the old key
Once the new key is confirmed working, call
POST /api/keys/:oldKeyId/revoke. The old key stops working immediately.