JWT Templates

JWT Templates allow you to generate custom authentication tokens tied to authenticated sessions, enabling you to integrate with third-party services.

List all templates

SecuritybearerAuth
Responses
200

List of JWT templates

get/jwt_templates
Response samples
application/json
[
  • {
    }
]

Create a JWT template

Create a new JWT template

SecuritybearerAuth
Request
Request Body schema: application/json
name
string

JWT template name

claims
object

JWT template claims in JSON format

lifetime
number or null [ 30 .. 315360000 ]

JWT token lifetime

allowed_clock_skew
number or null [ 0 .. 300 ]

JWT token allowed clock skew

custom_signing_key
boolean

Whether a custom signing key/algorithm is also provided for this template

signing_algorithm
string or null

The custom signing algorithm to use when minting JWTs

signing_key
string or null

The custom signing private key to use when minting JWTs

Responses
200

Success

400

Request was not successful

402

Payment required

422

Invalid request parameters

post/jwt_templates
Request samples
application/json
{
  • "name": "string",
  • "claims": { },
  • "lifetime": 30,
  • "allowed_clock_skew": 300,
  • "custom_signing_key": true,
  • "signing_algorithm": "string",
  • "signing_key": "string"
}
Response samples
application/json
{
  • "object": "jwt_template",
  • "id": "string",
  • "name": "string",
  • "claims": { },
  • "lifetime": 0,
  • "allowed_clock_skew": 0,
  • "custom_signing_key": true,
  • "signing_algorithm": "string",
  • "created_at": 0,
  • "updated_at": 0
}

Retrieve a template

Retrieve the details of a given JWT template

SecuritybearerAuth
Request
path Parameters
template_id
required
string

JWT Template ID

Responses
200

Success

404

Resource not found

get/jwt_templates/{template_id}
Response samples
application/json
{
  • "object": "jwt_template",
  • "id": "string",
  • "name": "string",
  • "claims": { },
  • "lifetime": 0,
  • "allowed_clock_skew": 0,
  • "custom_signing_key": true,
  • "signing_algorithm": "string",
  • "created_at": 0,
  • "updated_at": 0
}

Update a JWT template

Updates an existing JWT template

SecuritybearerAuth
Request
path Parameters
template_id
required
string

The ID of the JWT template to update

Request Body schema: application/json
name
string

JWT template name

claims
object

JWT template claims in JSON format

lifetime
number or null [ 30 .. 315360000 ]

JWT token lifetime

allowed_clock_skew
number or null [ 0 .. 300 ]

JWT token allowed clock skew

custom_signing_key
boolean

Whether a custom signing key/algorithm is also provided for this template

signing_algorithm
string or null

The custom signing algorithm to use when minting JWTs

signing_key
string or null

The custom signing private key to use when minting JWTs

Responses
200

Success

400

Request was not successful

402

Payment required

422

Invalid request parameters

patch/jwt_templates/{template_id}
Request samples
application/json
{
  • "name": "string",
  • "claims": { },
  • "lifetime": 30,
  • "allowed_clock_skew": 300,
  • "custom_signing_key": true,
  • "signing_algorithm": "string",
  • "signing_key": "string"
}
Response samples
application/json
{
  • "object": "jwt_template",
  • "id": "string",
  • "name": "string",
  • "claims": { },
  • "lifetime": 0,
  • "allowed_clock_skew": 0,
  • "custom_signing_key": true,
  • "signing_algorithm": "string",
  • "created_at": 0,
  • "updated_at": 0
}

Delete a Template

SecuritybearerAuth
Request
path Parameters
template_id
required
string

JWT Template ID

Responses
200

Deleted Object

403

Authorization invalid

404

Resource not found

delete/jwt_templates/{template_id}
Response samples
application/json
{
  • "object": "string",
  • "id": "string",
  • "slug": "string",
  • "deleted": true
}