Skip to main content
POST
/
deployments
/
{deployment_id}
/
token
Generate JWT Token
curl --request POST \
  --url https://api.wacht.dev/deployments/{deployment_id}/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": 1234567890,
  "template": "custom-claims"
}
'
{
  "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires": 1734567890000
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication using the Authorization header

Path Parameters

deployment_id
integer<int64>
required

The deployment ID

Body

application/json
session_id
integer<int64>
required

The session ID to generate a token for

Example:

1234567890

template
string

Name of the JWT template to use. If not provided, 'default' template will be used.

Example:

"custom-claims"

Response

Successfully generated JWT token

token
string

The generated JWT token

Example:

"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9..."

expires
integer<int64>

Token expiration timestamp in milliseconds

Example:

1734567890000