Skip to main content
Everything that talks to Niadra talks through a key, and every key belongs to a source inside a space. Those three names decide where data lives, who is reading and what each agent may do with the memory. Knowing them before you integrate settles most permission questions up front.

Project, environment and space

A project is the memory of one company, or of a business line that has to stay separate. Every project has two environments: sandbox, for building and testing, and production, for real traffic. A space is the pair of project and environment. It is Niadra’s unit of isolation: the space is the first column of every database key, cache key and encryption context, so a sandbox event never shows up in a production read, and one company’s data never decrypts under another company’s key. Each space lives in one region, its project’s, and has a stable address:
The SDK builds that address from the key. You configure no URL at all, except to point at the local emulator.

Sources

A source is anything that talks to the memory: one vendor’s voice agent, another vendor’s WhatsApp agent, your internal billing agent, the CRM that sends events by webhook, the human attendant who gets context inside the tool your company already uses. Every source has: You create and configure sources in the Console or through the control API. Access to memory is denied by default and granted by purpose: broad access to the ERP does not give an internal agent broad access to the memory. Before you grant access, POST /v1/policy/simulate shows what a source, audience or purpose would see of a profile, item by item, with what would be withheld and why.

Keys

Each source has one or more keys. The format carries everything the SDK needs to find the address:
  • live reaches production spaces; test reaches sandbox spaces.
  • region and space become the address https://<space>.<region>.api.niadra.com.
  • key_id is public and shows up in logs; on its own it never authenticates.
  • The secret is shown once, when the key is created. Store it in your secret manager.
The key goes in the Authorization: Bearer header. The SDKs read the NIADRA_API_KEY environment variable when you do not pass a key to the constructor.
A source key is a server secret. Never put a key in a browser, a mobile app or a model prompt. To bind a customer to an MCP connection, your backend mints a 15-minute subject_token.

Scopes

Each key has scopes. The route checks the scope before anything else, and a missing scope comes back as 403 with the code scope_missing. The act scope deserves care. track alone does not record actions: an action can close a promise made to a customer, so only a source holding act may record it, and a source that declares trusted_action_ops (for example only credit) records nothing else. It is the first barrier against an action forged through prompt injection. An operation outside the list comes back as an item error with the code operation_not_allowed. When you create a key without naming scopes, it gets the defaults of the source audience: customer_agent gets track, context, search and identify; internal_agent also gets act; human gets context and search; analyst gets only analytics. A common split: People from your team use the Console with their own token and roles (admin, security, integration, review, analysis, vendor), never a source key. See Limits and conventions.

Rotate and revoke

Rotate a key to get a new one with the same scopes; grace_seconds (up to 7 days) keeps the old one valid while you roll the new one out through your secret manager. To cut access, revoke the key or the whole source, with a reason, in the Console or through the control API. The revocation reaches every instance of the cell in seconds. The cell also takes a direct cut, POST /v1/sources/{source_id}/revoke, for the security role: every key of the source stops authenticating there at once. When a key gets a 401 or 403, the SDK drops the context it held for that key and returns an empty context. That way, cutting a vendor’s access also covers what was already in that vendor’s cache.

Next steps

Events and the batch

what each source sends and how the batch answers.

Identity and verification

handles, profiles and levels V0 to V4.

Limits and conventions

versioning, idempotency, rate limits and ETag.

Errors

the code catalog, including scope_missing.