(organizationDomains)
- create - Create a new organization domain.
- list - Get a list of all domains of an organization.
- delete - Remove a domain from an organization.
Creates a new organization domain. By default the domain is verified, but can be optionally set to unverified.
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\CreateOrganizationDomainRequestBody();
$response = $sdk->organizationDomains->create(
organizationId: '<id>',
requestBody: $requestBody
);
if ($response->organizationDomain !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
organizationId |
string | ✔️ | The ID of the organization where the new domain will be created. |
requestBody |
Operations\CreateOrganizationDomainRequestBody | ✔️ | N/A |
?Operations\CreateOrganizationDomainResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors84 | 400, 403, 404, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Get a list of all domains of an organization.
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\ListOrganizationDomainsRequest(
organizationId: '<id>',
);
$response = $sdk->organizationDomains->list(
request: $request
);
if ($response->organizationDomains !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\ListOrganizationDomainsRequest | ✔️ | The request object to use for the request. |
?Operations\ListOrganizationDomainsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors85 | 401, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Removes the given domain from the organization.
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->organizationDomains->delete(
organizationId: '<id>',
domainId: '<id>'
);
if ($response->deletedObject !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
organizationId |
string | ✔️ | The ID of the organization the domain belongs to |
domainId |
string | ✔️ | The ID of the domain |
?Operations\DeleteOrganizationDomainResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors87 | 400, 401, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |