Skip to main content
POST
/
jwt-templates
Create JWT Template
curl --request POST \
  --url https://api.wacht.dev/jwt-templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "claims": {},
  "ttl": 15768030,
  "description": "<string>",
  "is_default": true
}
'
{
  "id": "<string>",
  "name": "Default JWT Template",
  "description": "<string>",
  "claims": {
    "sub": "{{user.id}}",
    "email": "{{user.email}}",
    "org_id": "{{user.organization_id}}"
  },
  "ttl": 3600,
  "is_default": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication using the Authorization header

Body

application/json
name
string
required
claims
object
required
ttl
integer
required
Required range: 60 <= x <= 31536000
description
string
is_default
boolean

Response

JWT template created successfully

id
string

(i64 formatted as string)

name
string
Example:

"Default JWT Template"

description
string
claims
object
Example:
{
"sub": "{{user.id}}",
"email": "{{user.email}}",
"org_id": "{{user.organization_id}}"
}
ttl
integer

Token time-to-live in seconds

Example:

3600

is_default
boolean
created_at
string<date-time>
updated_at
string<date-time>