Skip to content

Latest commit

 

History

History
137 lines (86 loc) · 9.47 KB

File metadata and controls

137 lines (86 loc) · 9.47 KB

AllowlistIdentifiers

(allowlist_identifiers)

Overview

Available Operations

  • list - List all identifiers on the allow-list
  • create - Add identifier to the allow-list
  • delete - Delete identifier from allow-list

list

Get a list of all identifiers allowed to sign up to an instance

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.allowlist_identifiers.list(paginated=False)

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
paginated Optional[bool] Whether to paginate the results.
If true, the results will be paginated.
If false, the results will not be paginated.
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
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[models.AllowlistIdentifier]

Errors

Error Type Status Code Content Type
models.ClerkErrors 401, 402 application/json
models.SDKError 4XX, 5XX */*

create

Create an identifier allowed to sign up to an instance

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.allowlist_identifiers.create(request={
        "identifier": "[email protected]",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request models.CreateAllowlistIdentifierRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AllowlistIdentifier

Errors

Error Type Status Code Content Type
models.ClerkErrors 400, 402, 422 application/json
models.SDKError 4XX, 5XX */*

delete

Delete an identifier from the instance allow-list

Example Usage

from clerk_backend_api import Clerk


with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:

    res = clerk.allowlist_identifiers.delete(identifier_id="example_identifier_id")

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
identifier_id str ✔️ The ID of the identifier to delete from the allow-list example_identifier_id
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DeletedObject

Errors

Error Type Status Code Content Type
models.ClerkErrors 402, 404 application/json
models.SDKError 4XX, 5XX */*