(clients)
The Client object tracks sessions, as well as the state of any sign in and sign up attempts, for a given device. https://clerk.com/docs/reference/clerkjs/client
Returns a list of all clients. The clients are returned sorted by creation date, with the newest clients appearing first. Warning: the endpoint is being deprecated and will be removed in future versions.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.clients.list(limit=20, offset=10)
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
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. |
Error Type | Status Code | Content Type |
---|---|---|
models.ClerkErrors | 400, 401, 410, 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Verifies the client in the provided token
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.clients.verify(request={
"token": "jwt_token_example",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.VerifyClientRequestBody | ✔️ | The request object to use for the request. |
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 | */* |
Returns the details of a client.
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as clerk:
res = clerk.clients.get(client_id="cli_123456789")
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
client_id |
str | ✔️ | Client ID. | cli_123456789 |
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 | */* |