Skip to content

Latest commit

 

History

History
155 lines (98 loc) · 6.99 KB

File metadata and controls

155 lines (98 loc) · 6.99 KB

OrganizationDomains

(organizationDomains)

Overview

Available Operations

  • create - Create a new organization domain.
  • list - Get a list of all domains of an organization.
  • delete - Remove a domain from an organization.

create

Creates a new organization domain. By default the domain is verified, but can be optionally set to unverified.

Example Usage

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
}

Parameters

Parameter Type Required Description
organizationId string ✔️ The ID of the organization where the new domain will be created.
requestBody Operations\CreateOrganizationDomainRequestBody ✔️ N/A

Response

?Operations\CreateOrganizationDomainResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors84 400, 403, 404, 422 application/json
Errors\SDKException 4XX, 5XX */*

list

Get a list of all domains of an organization.

Example Usage

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
}

Parameters

Parameter Type Required Description
$request Operations\ListOrganizationDomainsRequest ✔️ The request object to use for the request.

Response

?Operations\ListOrganizationDomainsResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors85 401, 422 application/json
Errors\SDKException 4XX, 5XX */*

delete

Removes the given domain from the organization.

Example Usage

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
}

Parameters

Parameter Type Required Description
organizationId string ✔️ The ID of the organization the domain belongs to
domainId string ✔️ The ID of the domain

Response

?Operations\DeleteOrganizationDomainResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors87 400, 401, 404 application/json
Errors\SDKException 4XX, 5XX */*