(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
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$response = $sdk->jwtTemplates->list(
);
if ($response->jwtTemplateList !== null) {
// handle response
}
?Operations\ListJWTTemplatesResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\SDKException | 4XX, 5XX | */* |
Create a new JWT template
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
use Clerk\Backend\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$request = new Operations\CreateJWTTemplateRequestBody();
$response = $sdk->jwtTemplates->create(
request: $request
);
if ($response->jwtTemplate !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\CreateJWTTemplateRequestBody | ✔️ | The request object to use for the request. |
?Operations\CreateJWTTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors63 | 400, 402, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Retrieve the details of a given JWT template
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$response = $sdk->jwtTemplates->get(
templateId: '<id>'
);
if ($response->jwtTemplate !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateId |
string | ✔️ | JWT Template ID |
?Operations\GetJWTTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors64 | 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Updates an existing JWT template
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
use Clerk\Backend\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$requestBody = new Operations\UpdateJWTTemplateRequestBody();
$response = $sdk->jwtTemplates->update(
templateId: '<id>',
requestBody: $requestBody
);
if ($response->jwtTemplate !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateId |
string | ✔️ | The ID of the JWT template to update |
requestBody |
?Operations\UpdateJWTTemplateRequestBody | ➖ | N/A |
?Operations\UpdateJWTTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors65 | 400, 402, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Delete a Template
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$response = $sdk->jwtTemplates->delete(
templateId: '<id>'
);
if ($response->deletedObject !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateId |
string | ✔️ | JWT Template ID |
?Operations\DeleteJWTTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors66 | 403, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |