Nurama Developers
Namespaces

token

Methods and types of the `token` namespace (`client.token` / `bot.token`).

Interfaces

CreateTokenData

Properties

PropertyTypeDescription
expiresAt?string | nullOptional ISO date. Null / omitted = non-expiring.
namestringCustomer-facing label. 1–80 characters.
scopesTokenScope[]At least one scope. The server rejects unknown scopes.

CreateTokenResponse

The shape returned by listTokens and (without the token field) the metadata half of createToken. Never includes the raw secret — that is shown exactly once at creation time and is the caller's responsibility to capture.

Extends

Properties

PropertyTypeDescriptionInherited from
createdAtstring-TokenSummary.createdAt
expiresAt?string | null-TokenSummary.expiresAt
idstring-TokenSummary.id
kindTokenKind-TokenSummary.kind
lastUsed?string | null-TokenSummary.lastUsed
namestring-TokenSummary.name
prefixstring-TokenSummary.prefix
scopesTokenScope[]-TokenSummary.scopes
tokenstringThe raw secret. Returned ONLY in this response. The server keeps a one-way hash and cannot recover this value — the customer must capture it immediately (typical pattern: reveal-once modal with a copy button).-

TokenSummary

The shape returned by listTokens and (without the token field) the metadata half of createToken. Never includes the raw secret — that is shown exactly once at creation time and is the caller's responsibility to capture.

Extended by

Properties

PropertyType
createdAtstring
expiresAt?string | null
idstring
kindTokenKind
lastUsed?string | null
namestring
prefixstring
scopesTokenScope[]

Type Aliases

TokenKind

type TokenKind = "pat" | "oauthAccess" | "oauthRefresh" | "botAccess";

Personal Access Token kinds. v1 only mints pat; the rest are reserved for the future OAuth grant flow and are listed here so callers can switch on the kind.


TokenScope

type TokenScope = 
  | "chat:read"
  | "chat:write"
  | "tasks:read"
  | "tasks:write"
  | "assets:read"
  | "assets:write"
  | "projects:read"
  | "workspaces:read";

Granted action verbs on a token. The server validates requested scopes against this set. Fall back to string in your own code if it accepts arbitrary scopes from configuration.

Functions

default()

function default(client): {
  createToken: Promise<CreateTokenResponse>;
  deleteToken: Promise<void>;
  listTokens: Promise<TokenSummary[]>;
};

Personal Access Token surface — auth-gated, owner-scoped. Any logged-in user can mint, list, and revoke their own tokens; there is no admin-on-behalf surface here (admins managing bot keys do that via the bot methods).

Parameters

ParameterType
clientdefault

Returns

NameTypeDescription
createToken()(data) => Promise<CreateTokenResponse>Mint a new Personal Access Token for the calling user. The raw secret is in the response's token field — store it immediately, it cannot be retrieved again.
deleteToken()(tokenId) => Promise<void>Revoke one of the caller's Personal Access Tokens. The revocation is immediate — the token will return 401 on the very next request.
listTokens()() => Promise<TokenSummary[]>List the caller's Personal Access Tokens. Bot-access keys held by the same user (rare but possible — admin who's also a bot owner) are filtered out server-side and surface via the bot management screens instead.

On this page