(jwt_templates)
- list - List all templates
- create - Create a JWT template
- get - Retrieve a template
- update - Update a JWT template
- delete - Delete a Template
List all templates
from clerk_backend_api import Clerk
s = Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.jwt_templates.list()
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
List[models.JWTTemplate]
Error Object |
Status Code |
Content Type |
models.SDKError |
4xx-5xx |
/ |
Create a new JWT template
from clerk_backend_api import Clerk
s = Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.jwt_templates.create(request={
"name": "Example Template",
"claims": {},
"lifetime": 3600,
"allowed_clock_skew": 5,
"custom_signing_key": False,
"signing_algorithm": "RS256",
"signing_key": "PRIVATE_KEY_PLACEHOLDER",
})
if res is not None:
# handle response
pass
models.JWTTemplate
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
400,402,422 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Retrieve the details of a given JWT template
from clerk_backend_api import Clerk
s = Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.jwt_templates.get(template_id="template_123")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
Example |
template_id |
str |
✔️ |
JWT Template ID |
template_123 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.JWTTemplate
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
404 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Updates an existing JWT template
from clerk_backend_api import Clerk
s = Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.jwt_templates.update(template_id="<value>", request_body={
"name": "<value>",
"claims": {},
"lifetime": 8574.78,
"allowed_clock_skew": 245.55,
"custom_signing_key": False,
"signing_algorithm": "<value>",
"signing_key": "<value>",
})
if res is not None:
# handle response
pass
models.JWTTemplate
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
400,402,422 |
application/json |
models.SDKError |
4xx-5xx |
/ |
Delete a Template
from clerk_backend_api import Clerk
s = Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.jwt_templates.delete(template_id="<value>")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
template_id |
str |
✔️ |
JWT Template ID |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.DeletedObject
Error Object |
Status Code |
Content Type |
models.ClerkErrors |
403,404 |
application/json |
models.SDKError |
4xx-5xx |
/ |