Skip to content

Latest commit

 

History

History
129 lines (86 loc) · 7.19 KB

File metadata and controls

129 lines (86 loc) · 7.19 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

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.OrganizationDomains.CreateAsync(
    organizationId: "<id>",
    requestBody: new CreateOrganizationDomainRequestBody() {}
);

// handle response

Parameters

Parameter Type Required Description
OrganizationId string ✔️ The ID of the organization where the new domain will be created.
RequestBody CreateOrganizationDomainRequestBody ✔️ N/A

Response

CreateOrganizationDomainResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 403, 404, 422 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

List

Get a list of all domains of an organization.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

ListOrganizationDomainsRequest req = new ListOrganizationDomainsRequest() {
    OrganizationId = "<id>",
    Limit = 20,
    Offset = 10,
};

var res = await sdk.OrganizationDomains.ListAsync(req);

// handle response

Parameters

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

Response

ListOrganizationDomainsResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 401, 422 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Delete

Removes the given domain from the organization.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.OrganizationDomains.DeleteAsync(
    organizationId: "<id>",
    domainId: "<id>"
);

// 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

DeleteOrganizationDomainResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*