Niah Docs
Introduction

Authentication

All /v1 and /scim/v2 requests authenticate with an organization API key sent as a bearer token.

http
Authorization: Bearer nwk_live_a1b2c3...

Keys are minted from your workspace settings on niah.si and are scoped to a single organization. The full secret is displayed once at creation — after that only the key_prefix is visible. Rotate a key by creating a new one and deleting the old.

Key format

Niah API keys are prefixed with nwk_. Treat the entire string as a secret; never commit it, log it, or embed it in client-side code. Make requests from a trusted backend.

Scopes

Every key carries a list of scopes in the form resource:action. A request is rejected with 403 forbidden_scope if the key lacks the scope an endpoint requires. Grant the narrowest set each integration needs.

ScopeGrants
me:readRead /v1/me
consultations:readList/read consultations and responses
consultations:writeCreate and cancel consultations
batches:readList/read batches and results
batches:writeCreate and cancel batches
panels:readList panels
usage:readRead usage and billing data
webhooks:readList webhook configs and deliveries
webhooks:writeCreate/update/delete webhook configs
automations:readList/read automations and runs
automations:writeCreate/update/delete automations
automations:triggerTrigger automations
chat.completionsCall /v1/chat/completions
scim:read / scim:writeSCIM user/group provisioning
*Full access (use sparingly)

Check a key's scopes at runtime via GET /v1/me.

IP allowlists

A key can optionally be restricted to a set of source IPs. Requests from any other address are rejected. Configure the allowlist where you manage the key.

Plan requirements

API access is a paid feature. Keys on the starter plan are rejected with plan_no_api_access. Your plan also determines your rate limit.

Auth errors

StatusCodeMeaning
401unauthorizedMissing, malformed, or unknown API key
403forbidden_scopeKey is valid but lacks the required scope
403plan_no_api_accessOrganization's plan does not include API access
403ip_not_allowedSource IP is not on the key's allowlist
Other contexts: the Code gateway (/api/code/*) uses per-user session tokens, and internal service-to-service routes use a shared secret. Neither is part of the enterprise /v1 API. SCIM uses the same nwk_ keys with scim:* scopes.