(organization_domains)
- 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.
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.organization_domains.create(organization_id="<id>", name="<value>", enrollment_mode="<value>", verified=True)
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
organization_id |
str | ✔️ | The ID of the organization where the new domain will be created. |
name |
Optional[str] | ➖ | The name of the new domain |
enrollment_mode |
Optional[str] | ➖ | The enrollment_mode for the new domain. This can be automatic_invitation , automatic_suggestion or manual_invitation |
verified |
OptionalNullable[bool] | ➖ | The status of domain's verification. Defaults to true |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.ClerkErrors | 400, 403, 404, 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Get a list of all domains of an organization.
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.organization_domains.list(organization_id="<id>", limit=20, offset=10, verified="<value>", enrollment_mode="<value>")
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
organization_id |
str | ✔️ | The organization ID. | |
limit |
Optional[int] | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset . |
20 |
offset |
Optional[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 . |
10 |
verified |
Optional[str] | ➖ | Filter domains by their verification status. true or false |
|
enrollment_mode |
Optional[str] | ➖ | Filter domains by their enrollment mode | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.ClerkErrors | 401, 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Removes the given domain from the organization.
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.organization_domains.delete(organization_id="<id>", domain_id="<id>")
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
organization_id |
str | ✔️ | The ID of the organization the domain belongs to |
domain_id |
str | ✔️ | The ID of the domain |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.ClerkErrors | 400, 401, 404 | application/json |
models.SDKError | 4XX, 5XX | */* |