Skip to main content
Encrypts and stores a credential for a specific provider, returning an AuthContextRecord with a masked token preview. Pass the returned auth_context_id in subsequent agent invocations instead of a raw token — the full token is never surfaced again.

Request Body

string
required
The DID of the subject who owns this credential (e.g. "did:key:z6Mk...").
string
required
The provider this credential is scoped to.
object
required
Describes how the credential is presented to the provider. The mode field is required:
string
required
The raw credential to encrypt and store. This value is never returned after registration.
string (ISO 8601)
Optional expiry timestamp for this credential. The node may reject invocations that reference an expired auth context.

Response

Returns 201 Created with an AuthContextRecord.
string (UUID)
required
The opaque identifier to pass as auth_context_id in invocation requests.
string (UUID)
required
Internal reference to the encrypted secret in the secret broker. Not needed for invocations.
string
required
The DID of the subject who owns this auth context.
string
required
The provider this auth context is scoped to.
object
required
The auth model as registered.
string
required
A masked preview of the stored token (e.g. "sk-...••••••"). The full token is never returned.
string (ISO 8601)
required
UTC timestamp when this auth context was created.
string (ISO 8601)
Expiry timestamp for this auth context, if one was provided at registration.

Example

Example response