(JwtTemplates)
- 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
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.JwtTemplates.ListAsync();
// handle response
ListJWTTemplatesResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Create a new JWT template
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
CreateJWTTemplateRequestBody req = new CreateJWTTemplateRequestBody() {
Name = "Example Template",
Claims = new Models.Operations.Claims() {},
Lifetime = 3600D,
AllowedClockSkew = 5D,
CustomSigningKey = false,
SigningAlgorithm = "RS256",
SigningKey = "PRIVATE_KEY_PLACEHOLDER",
};
var res = await sdk.JwtTemplates.CreateAsync(req);
// handle response
CreateJWTTemplateResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 402, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Retrieve the details of a given JWT template
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.JwtTemplates.GetAsync(templateId: "template_123");
// handle response
Parameter |
Type |
Required |
Description |
Example |
TemplateId |
string |
✔️ |
JWT Template ID |
template_123 |
GetJWTTemplateResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Updates an existing JWT template
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.JwtTemplates.UpdateAsync(
templateId: "<id>",
requestBody: new UpdateJWTTemplateRequestBody() {}
);
// handle response
Parameter |
Type |
Required |
Description |
TemplateId |
string |
✔️ |
The ID of the JWT template to update |
RequestBody |
UpdateJWTTemplateRequestBody |
✔️ |
N/A |
UpdateJWTTemplateResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 402, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Delete a Template
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.JwtTemplates.DeleteAsync(templateId: "<id>");
// handle response
Parameter |
Type |
Required |
Description |
TemplateId |
string |
✔️ |
JWT Template ID |
DeleteJWTTemplateResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
403, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |