(emailAddresses)
- create - Create an email address
- get - Retrieve an email address
- delete - Delete an email address
- update - Update an email address
Create a new email address
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\CreateEmailAddressRequestBody();
$response = $sdk->emailAddresses->create(
request: $request
);
if ($response->emailAddress !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\CreateEmailAddressRequestBody | ✔️ | The request object to use for the request. |
?Operations\CreateEmailAddressResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors3 | 400, 401, 403, 404, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Returns the details of an email address.
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->emailAddresses->get(
emailAddressId: '<id>'
);
if ($response->emailAddress !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
emailAddressId |
string | ✔️ | The ID of the email address to retrieve |
?Operations\GetEmailAddressResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors4 | 400, 401, 403, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Delete the email address with the given ID
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->emailAddresses->delete(
emailAddressId: '<id>'
);
if ($response->deletedObject !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
emailAddressId |
string | ✔️ | The ID of the email address to delete |
?Operations\DeleteEmailAddressResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors5 | 400, 401, 403, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Updates an email address.
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\UpdateEmailAddressRequestBody();
$response = $sdk->emailAddresses->update(
emailAddressId: '<id>',
requestBody: $requestBody
);
if ($response->emailAddress !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
emailAddressId |
string | ✔️ | The ID of the email address to update |
requestBody |
?Operations\UpdateEmailAddressRequestBody | ➖ | N/A |
?Operations\UpdateEmailAddressResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors6 | 400, 401, 403, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |