API Tokens

Give an agent its own API key in one call

Creates a token bound to this agent identity, confined to the mailboxes the agent operates, with the minimal scopes an agent needs (assistant:read, assistant:write, email:read, email:write). With that key the agent reads only its own Today, its mailboxes and the items handed to it; naming another agent answers 403 and owner-only routes (settings, backfill, export) refuse it. The full key is returned only in this response. Requires tokens:write. An agent that operates no mailbox gets no mail scopes by default, and asking for them answers 400 AGENT_MAILBOXES_REQUIRED: a key with no mailboxes would reach every mailbox of the account.

post/api/agents/identity/{slug}/tokens

Request

  • Base URL: https://domani.run
  • URL: https://domani.run/api/agents/identity/{slug}/tokens
  • Auth: HTTP bearer

Path parameters

slugstring required

The agent identity handle.

Request body

namestring

Defaults to '<slug> agent'.

scopesstring[]

Defaults to assistant:read, assistant:write, email:read, email:write. Cannot exceed the caller's own scopes.

mailboxesstring[]

Mailbox addresses the token is confined to. Defaults to the mailboxes the agent operates.

expires_ininteger

Seconds until expiry (max one year).

Response

Token created; the key is shown once

successboolean
hintstring

Changes

No recorded changes to this operation across all 2 revisions of this API.