Skip to Content
The Ngamia platform API is in preview. Endpoints may change before general availability.
ConceptsAPI keys and scopes

API keys and scopes

API keys let your server call the platform without a person signed in.

  • A key looks like ngk_ followed by 43 characters (32 random bytes).
  • Only its SHA-256 hash is stored. The full key is returned once, when created.
  • A key belongs to one workspace, has scopes, and can expire (1–3650 days).
  • Revoking a key (DELETE /v1/api-keys/{id}) stops it immediately.
  • last_used_at shows whether a key is still in use.

Scopes

ScopeAllows
runsRun agents; read, stream, resume and cancel runs
agents:readRead agent definitions
agents:writeCreate, change and delete agents (includes agents:read)
knowledge:readSearch knowledge and read indexing jobs
knowledge:writeAdd and delete documents and files (includes knowledge:read)

Keys can never manage the workspace, members, invites, other keys or the audit trail; those need a person with the admin role.

Good practice

  • One key per app or integration, with only the scopes it needs. A website chat needs only runs.
  • Keep keys in a secret manager on your server. Never put a key in a browser, a mobile app, a prompt or a chat message.
  • Set an expiry and rotate keys: create the new key, deploy it, then revoke the old one.