Tokens

Allow one of your personal tokens to write the workspace guidance card, for a while

Requires the authenticated web session; every Bearer token, including admin scope, receives 403 FORBIDDEN (Guidance write grants require the web session). The caller must be an owner or admin of workspace (403 otherwise; a slug that is not the caller's answers 404 NOT_FOUND) and tokenId must be one of their own live personal tokens (404 NOT_FOUND otherwise); a workspace-bound token can only be allowed for its own workspace (400). The grant lasts durationMinutes (default 60, at most 1440) and supersedes any open grant on the same token and workspace. It never replaces the owner/admin role the token's person must still hold at write time, and the granted write itself must carry confirm: 'guidance' and expectedUpdatedAt (see updateCard). Every granted write is recorded on the events ledger with the grant and the person who allowed it.

post/api/tokens/{tokenId}/guidance-grant

Request

  • Base URL: https://tre-app.com
  • URL: https://tre-app.com/api/tokens/{tokenId}/guidance-grant
  • Auth: one of:
    • API key in cookie __Secure-authjs.session-token
    • API key in cookie authjs.session-token

Request body

workspacestring required

The workspace whose guidance card the token may write. The caller must be an owner or admin of it; a workspace-bound token can only be allowed for its own workspace.

durationMinutesinteger

How long the grant lasts, in minutes: 5 to 1440 (a day), default 60.

Response

Success

idstring uuid required
tokenIdstring uuid required
workspacestring required
grantedAtstring date-time required
expiresAtstring date-time required
revokedAtstring date-time nullable required
status'active' | 'expired' | 'revoked' required

Changes

No recorded changes to this operation across all 1 revision of this API.