Skip to Content
ZITADEL Docs
APIsCore ResourcesV2User

Add a Personal Access Token

Personal access tokens (PAT) are the easiest way to authenticate to the Zitadel APIs. Make sure you store the returned PAT safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have personal access tokens.

Required permission:

  • user.write
POST
/v2/users/{user_id}/pats

Path Parameters

user_id*user_id

Request Body

application/json
  1. body
expirationDate?expiration_date

The timestamp when the token will expire.

Formatdate-time

Response Body

Success

application/json
  1. response
creationDate?creation_date

The timestamp of the personal access token creation.

Formatdate-time
tokenId?token_id

The tokens ID.

token?token

The personal access token that can be used to authenticate against the API

Example Request
curl -X POST 'https://example.com/v2/users/string/pats' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
{  "creationDate": "2023-01-15T01:30:15.01Z",  "tokenId": "string",  "token": "string"}

Was this page helpful?