Personal access tokens

Update a personal access token

Changed on

Updates one of your personal access tokens. Send only what you want to change.

  • The expiration can only move later, up to a year from now. An expired token can't be extended. Send it as expires_in or expires_at, not both.
  • grants replaces all of the token's grants.
  • Switching to same_as_user drops the token's grants. Switching back to grants requires the grants it should have.
patch/pat/{id}

Request

  • Base URL
    https://api.nullplatform.com
  • URL
    https://api.nullplatform.com/pat/{id}
  • Auth
    HTTP bearer

Path parameters

idinteger required

The unique identifier for the personal access token.

Request body

namestring

A descriptive name for the token.

expires_ininteger

A later expiration, in seconds (at least 60), counted from the server's clock when it receives the request. Send this or expires_at, not both.

The same rules as expires_at apply to the date it resolves to. Only expires_at is stored and returned.

expires_atstring date-time

A later expiration, at most a year from now. The expiration can't move earlier, and an expired token can't be extended. Send this or expires_in, not both.

access'grants' | 'same_as_user'

Leave it out to keep the token's current access. same_as_user drops the token's grants; switching back to grants requires grants.

Example request

{
  "name": "local-scripts",
  "expires_in": 7776000,
  "expires_at": "2027-04-06T00:00:00Z",
  "access": "same_as_user",
  "grants": [
    {
      "nrn": "organization=1:account=1:namespace=1:application=4",
      "role_slug": "machine:ci"
    }
  ],
  "tags": [
    {
      "key": "team",
      "value": "platform"
    }
  ]
}

Response

The operation was successful.

idinteger required

Unique ID for the token.

namestring required

The descriptive name given to the token.

masked_api_keystring

The token, masked.

access'grants' | 'same_as_user' required

Whether the token follows your access (same_as_user) or holds its own grants (grants).

personalboolean

Always true for a personal access token.

owner_idinteger

The ID of the user who created the token.

acting_user_idinteger

The ID of the user the token acts as: you.

last_used_atstring date-time nullable

The ISO-8601 UTC timestamp of when the token was last exchanged for an access token.

expires_atstring date-time required

The ISO-8601 UTC timestamp of when the token stops working.

expiredboolean

Whether the token has expired.

created_atstring date-time required

The ISO-8601 UTC timestamp of when the token was created.

updated_atstring date-time required

The ISO-8601 UTC timestamp of when the token was last updated.

Example response

{
  "id": 1234,
  "name": "local-scripts",
  "masked_api_key": "AAAAxxxxxPTs=",
  "access": "same_as_user",
  "tags": [
    {
      "key": "team",
      "value": "platform"
    }
  ],
  "grants": [
    {
      "id": 5678,
      "nrn": "organization=1:account=2",
      "role_id": 700317756,
      "role_slug": "developer",
      "actions": [
        "application:read",
        "deployment:create"
      ]
    }
  ],
  "personal": true,
  "owner_id": 42,
  "acting_user_id": 42,
  "last_used_at": "2026-10-08T12:00:00.000Z",
  "expires_at": "2027-01-06T00:00:00.000Z",
  "created_at": "2026-10-08T00:00:00.000Z",
  "updated_at": "2026-10-08T00:00:00.000Z"
}

Changes