- 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;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->jwtTemplates->list(
limit: 10,
offset: 0
);
if ($response->jwtTemplateList !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
paginated |
?bool | ➖ | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. |
limit |
?int | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
offset |
?int | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
?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;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$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\ClerkErrors | 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;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->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\ClerkErrors | 404 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Updates an existing JWT template
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$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\ClerkErrors | 400, 402, 422 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Delete a Template
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->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\ClerkErrors | 403, 404 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |