PATCH/jwt_templates/{template_id}

Update a JWT template

Updates an existing JWT template's configuration. Include name and claims; lifetime and allowed_clock_skew must fall within their permitted ranges, and custom signing details are required when custom_signing_key is true. The response returns the updated template.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 7 body fields
template_idstringrequired
The unique identifier of the JWT template to update.

JWT template fields to update. name and claims are required.

namestringrequired
JWT template name
claimsobjectrequired
JWT template claims in JSON format
lifetimeintegeroptional
JWT lifetime
allowed_clock_skewintegeroptional
JWT allowed clock skew
custom_signing_keybooleanoptional
Whether a custom signing key/algorithm is also provided for this template
signing_algorithmstringoptional
The custom signing algorithm to use when minting JWTs. Required if `custom_signing_key` is `true`.
signing_keystringoptional
The custom signing private key to use when minting JWTs. Required if `custom_signing_key` is `true`.

4 status codes
200Returns the updated JWT template, including its ID, claims, lifetime, signing settings, and creation and update timestamps.
objectstringrequired
Allowed:jwt_template
idstringrequired
namestringrequired
claimsobjectrequired
lifetimeintegerrequired
allowed_clock_skewintegerrequired
custom_signing_keybooleanrequired
signing_algorithmstringrequired
created_atintegerrequired
Unix timestamp of creation.
updated_atintegerrequired
Unix timestamp of last update.
400Returned when the request is unsuccessful.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
402Returned when payment is required.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
422Returned when request parameters are invalid.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional

Error handling

A 400 is returned when the request is unsuccessful; a 402 indicates payment is required; a 422 indicates invalid request parameters. The template_id path parameter must identify the JWT template to update; name and claims are required, and lifetime and allowed_clock_skew must be within their defined ranges. When custom_signing_key is true, provide signing_algorithm and signing_key.