Tokens

List and revoke your own personal access tokens from the API.

/me/tokens is the one place a token touches credentials — and only its owner's own. It needs no scope: any valid token may call it.

It is self-only: you see and revoke the tokens you minted in this organization, never anyone else's. (An Admin sees and revokes every token in the organization in the portal only, under Settings → API Tokens.) Tokens are created only in the portal, with re-authentication, so a leaked token can never renew or widen itself. See Personal access tokens.

The token object

FieldTypeNotes
idstringOpaque id.
namestring
prefixstringMasked form, e.g. tf-pat_AbCdE...a91f. The secret is never returned.
scopesstring[]Fixed at mint.
statusstringactive, revoked or expired (past expires_at and not revoked).
created_atstring
expires_atstring | nullWhen the token expires. null only if your organization allows tokens that never expire.
last_used_atstring | null
created_byobject{ "id", "email" } — you.
owner_role_at_creationstring | nulladmin or member: your role when the token was created.
revoked_atstring | nullWhen it was revoked; null unless status is revoked.
revoked_reasonstring | nullowner, admin, org_revoke_all, member_removed, member_disabled or member_moved; null unless status is revoked (and for tokens revoked before 0.18.5).

List your tokens

GET /api/v1/mgmt/me/tokens

Paginated, newest first.

Query parameterNotes
statusactive, revoked or expired. Any other value → 422 validation_failed.
curl https://portal.<domain>/api/v1/mgmt/me/tokens \
  -H "Authorization: Bearer $TF_PAT"
{
  "data": [
    {
      "id": "d9e8f7a6-b5c4-4d3e-9f2a-1b0c9d8e7f6a",
      "name": "CI · payments-deploy",
      "prefix": "tf-pat_AbCdE...a91f",
      "scopes": ["projects:read", "keys:read", "keys:write", "catalog:read"],
      "status": "active",
      "created_at": "2026-03-20T09:00:00Z",
      "expires_at": "2027-03-20T09:00:00Z",
      "last_used_at": "2026-09-24T10:05:31Z",
      "created_by": { "id": "8e7d6c5b-4a39-4281-9f0e-1d2c3b4a5968", "email": "[email protected]" }
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Revoke one of your tokens

DELETE /api/v1/mgmt/me/tokens/{id}

Revocation is immediate and permanent — the next call with that token fails with 401 token_revoked. You may revoke the token you are calling with, and revoking an already-revoked token succeeds again. Returns 204 No Content. A token id that is not yours returns 404.

Like every non-GET Management API call, this route requires Idempotency-Key: a missing header is 400 idempotency_key_required, and reusing a key for a different request is 409 idempotency_conflict — see Idempotency.

curl -X DELETE https://portal.<domain>/api/v1/mgmt/me/tokens/d9e8f7a6-b5c4-4d3e-9f2a-1b0c9d8e7f6a \
  -H "Authorization: Bearer $TF_PAT_NEW" \
  -H "Idempotency-Key: rotate-ci-token-2026-09"

The revocation is recorded in the audit log as pat_revoke.

We use strictly necessary cookies to record your choice and run this site. We do not use cookies for advertising or tracking. See the Cookie Policy.