Tokens

Create an API token for scripts, MCP clients, or agents.

Issuance is atomic. Retry unchanged settings with the same Idempotency-Key after an uncertain outcome. Replay confirms the existing credential without returning its one-time secret; deliberately rotate it in Account Developer access for recovery.

post/api/v1/tokens

Request

  • Base URL: https://commentary.dev
  • URL: https://commentary.dev/api/v1/tokens
  • Auth: API key in cookie commentary_session

Headers

Idempotency-Keystring

Stable key for one issue. Omission preserves legacy non-idempotent requests.

Request body

labelstring
targetstring

Target string such as account, github:owner/repo, github:owner/repo:pull:123, github:owner/repo:branch:main, or draft:sessionId.

expiresAtstring date-time nullable

Response

Successful response.

okunknown required
idstring required
grantIdstring required
replayedboolean
tokenstring

One-time secret, present only for the original successful issue.

tokenHintstring required

Changes

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