Personal Access Tokens (PATs)

Create Personal Access Token

Creates a new Personal Access Token (PAT) for the current user. The full secret is only returned once in this response and will never be shown again. Both human users and agent users may call this endpoint; PATs are always scoped to the calling user.

post/pats

Request

  • Base URL: https://api.carbonvoice.app
  • URL: https://api.carbonvoice.app/pats
  • Auth: one of:
    • API key in header pxtoken
    • OAuth 2 (implicit, authorization URL https://api.carbonvoice.app/oauth/authorize)

Request body

namestring

Human-readable name for this Personal Access Token

scopesstring[]

Scopes granted to this PAT. Defaults to cv:read and cv:write if omitted.

expires_in_secondsnumber

Optional time-to-live in seconds. Defaults to 1 year if omitted. Maximum 2 years.

Example request

{
  "scopes": [
    "cv:read",
    "cv:write"
  ],
  "expires_in_seconds": 2592000
}

Response

idstring required
namestring
scopesstring[] required
created_atstring date-time required
expires_atstring date-time
revoked_atstring date-time
last_used_atstring date-time
display_tokenstring required

Masked preview of the PAT. The full secret is only returned once at creation time.

patstring required

Full PAT secret. This value is only returned once on creation and will never be shown again.

Example response

{
  "display_token": "cv_pat_91x23...x1201"
}

Changes

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