Metadata-Version: 2.1
Name: clerk-backend-api
Version: 1.2.0
Summary: Python Client SDK for clerk.dev
Home-page: https://github.com/clerk/clerk-sdk-python.git
Author: Clerk
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: cryptography (>=43.0.1,<44.0.0)
Requires-Dist: eval-type-backport (>=0.2.0,<0.3.0)
Requires-Dist: httpx (>=0.27.0,<0.28.0)
Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
Requires-Dist: pydantic (>=2.9.2,<2.10.0)
Requires-Dist: pyjwt (>=2.9.0,<3.0.0)
Requires-Dist: python-dateutil (==2.8.2)
Requires-Dist: typing-inspect (>=0.9.0,<0.10.0)
Project-URL: Repository, https://github.com/clerk/clerk-sdk-python.git
Description-Content-Type: text/markdown

<div align="center">
  <a href="https://clerk.com?utm_source=github&utm_medium=clerk_javascript" target="_blank" rel="noopener noreferrer">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://images.clerk.com/static/logo-dark-mode-400x400.png">
      <img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="100">
    </picture>
  </a>
   <p>The most comprehensive User Management Platform</p>
   <a href="https://clerk.com/docs/reference/backend-api"><img src="https://img.shields.io/static/v1?label=Docs&message=API Ref&color=000000&style=for-the-badge" /></a>
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" /></a>
</div>
<br></br>

[![chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://clerk.com/discord)
[![twitter](https://img.shields.io/twitter/follow/ClerkDev?style=social)](https://twitter.com/intent/follow?screen_name=ClerkDev)

<!-- Start Summary [summary] -->
## Summary

Clerk Backend API: The Clerk REST Backend API, meant to be accessed by backend
servers.

### Versions

When the API changes in a way that isn't compatible with older versions, a new version is released.
Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview).


Please see https://clerk.com/docs for more information.

More information about the API can be found at https://clerk.com/docs
<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents

* [SDK Installation](https://github.com/clerk/clerk-sdk-python/blob/master/#sdk-installation)
* [IDE Support](https://github.com/clerk/clerk-sdk-python/blob/master/#ide-support)
* [SDK Example Usage](https://github.com/clerk/clerk-sdk-python/blob/master/#sdk-example-usage)
* [Available Resources and Operations](https://github.com/clerk/clerk-sdk-python/blob/master/#available-resources-and-operations)
* [File uploads](https://github.com/clerk/clerk-sdk-python/blob/master/#file-uploads)
* [Retries](https://github.com/clerk/clerk-sdk-python/blob/master/#retries)
* [Error Handling](https://github.com/clerk/clerk-sdk-python/blob/master/#error-handling)
* [Server Selection](https://github.com/clerk/clerk-sdk-python/blob/master/#server-selection)
* [Custom HTTP Client](https://github.com/clerk/clerk-sdk-python/blob/master/#custom-http-client)
* [Authentication](https://github.com/clerk/clerk-sdk-python/blob/master/#authentication)
* [Debugging](https://github.com/clerk/clerk-sdk-python/blob/master/#debugging)
<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
## SDK Installation

The SDK can be installed with either *pip* or *poetry* package managers.

### PIP

*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

```bash
pip install clerk-backend-api
```

### Poetry

*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.

```bash
poetry add clerk-backend-api
```
<!-- End SDK Installation [installation] -->

<!-- Start IDE Support [idesupport] -->
## IDE Support

### PyCharm

Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.

- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
<!-- End IDE Support [idesupport] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```python
# Synchronous Example
from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.email_addresses.get(email_address_id="email_address_id_example")

if res is not None:
    # handle response
    pass
```

</br>

The same SDK client can also be used to make asychronous requests by importing asyncio.
```python
# Asynchronous Example
import asyncio
from clerk_backend_api import Clerk

async def main():
    s = Clerk(
        bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
    )
    res = await s.email_addresses.get_async(email_address_id="email_address_id_example")
    if res is not None:
        # handle response
        pass

asyncio.run(main())
```
<!-- End SDK Example Usage [usage] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

<details open>
<summary>Available methods</summary>

### [actor_tokens](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/actortokens/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/actortokens/README.md#create) - Create actor token
* [revoke](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/actortokens/README.md#revoke) - Revoke actor token

### [allowlist_blocklist](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistblocklist/README.md)

* [list_allowlist_identifiers](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistblocklist/README.md#list_allowlist_identifiers) - List all identifiers on the allow-list
* [create_allowlist_identifier](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistblocklist/README.md#create_allowlist_identifier) - Add identifier to the allow-list
* [create_blocklist_identifier](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistblocklist/README.md#create_blocklist_identifier) - Add identifier to the block-list
* [delete_blocklist_identifier](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistblocklist/README.md#delete_blocklist_identifier) - Delete identifier from block-list

### [allowlist_identifiers](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistidentifiers/README.md)

* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/allowlistidentifiers/README.md#delete) - Delete identifier from allow-list

### [beta_features](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/betafeatures/README.md)

* [update_instance_settings](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/betafeatures/README.md#update_instance_settings) - Update instance settings
* [~~update_domain~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/betafeatures/README.md#update_domain) - Update production instance domain :warning: **Deprecated**
* [change_production_instance_domain](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/betafeatures/README.md#change_production_instance_domain) - Update production instance domain

### [blocklist_identifiers](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/blocklistidentifierssdk/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/blocklistidentifierssdk/README.md#list) - List all identifiers on the block-list


### [clients](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clients/README.md)

* [~~list~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clients/README.md#list) - List all clients :warning: **Deprecated**
* [verify](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clients/README.md#verify) - Verify a client
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clients/README.md#get) - Get a client

### [domains](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/domainssdk/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/domainssdk/README.md#list) - List all instance domains
* [add](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/domainssdk/README.md#add) - Add a domain
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/domainssdk/README.md#delete) - Delete a satellite domain
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/domainssdk/README.md#update) - Update a domain

### [email_addresses](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailaddresses/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailaddresses/README.md#create) - Create an email address
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailaddresses/README.md#get) - Retrieve an email address
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailaddresses/README.md#delete) - Delete an email address
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailaddresses/README.md#update) - Update an email address

### [~~email_and_sms_templates~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailandsmstemplates/README.md)

* [~~upsert~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailandsmstemplates/README.md#upsert) - Update a template for a given type and slug :warning: **Deprecated**

### [~~email_sms_templates~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailsmstemplates/README.md)

* [~~list~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailsmstemplates/README.md#list) - List all templates :warning: **Deprecated**
* [~~revert~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailsmstemplates/README.md#revert) - Revert a template :warning: **Deprecated**
* [~~get~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailsmstemplates/README.md#get) - Retrieve a template :warning: **Deprecated**
* [~~toggle_template_delivery~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/emailsmstemplates/README.md#toggle_template_delivery) - Toggle the delivery by Clerk for a template of a given type and slug :warning: **Deprecated**

### [instance_settings](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/instancesettingssdk/README.md)

* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/instancesettingssdk/README.md#update) - Update instance settings
* [update_restrictions](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/instancesettingssdk/README.md#update_restrictions) - Update instance restrictions
* [update_organization_settings](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/instancesettingssdk/README.md#update_organization_settings) - Update instance organization settings

### [invitations](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/invitations/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/invitations/README.md#create) - Create an invitation
* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/invitations/README.md#list) - List all invitations
* [revoke](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/invitations/README.md#revoke) - Revokes an invitation

### [jwks](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwks/README.md)

* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwks/README.md#get) - Retrieve the JSON Web Key Set of the instance

### [jwt_templates](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwttemplates/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwttemplates/README.md#list) - List all templates
* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwttemplates/README.md#create) - Create a JWT template
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwttemplates/README.md#get) - Retrieve a template
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwttemplates/README.md#update) - Update a JWT template
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/jwttemplates/README.md#delete) - Delete a Template

### [miscellaneous](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/miscellaneous/README.md)

* [get_interstitial](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/miscellaneous/README.md#get_interstitial) - Returns the markup for the interstitial page

### [oauth_applications](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md#list) - Get a list of OAuth applications for an instance
* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md#create) - Create an OAuth application
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md#get) - Retrieve an OAuth application by ID
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md#update) - Update an OAuth application
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md#delete) - Delete an OAuth application
* [rotate_secret](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/oauthapplicationssdk/README.md#rotate_secret) - Rotate the client secret of the given OAuth application

### [organization_domain](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationdomainsdk/README.md)

* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationdomainsdk/README.md#update) - Update an organization domain.

### [organization_domains](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationdomainssdk/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationdomainssdk/README.md#create) - Create a new organization domain.
* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationdomainssdk/README.md#list) - Get a list of all domains of an organization.
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationdomainssdk/README.md#delete) - Remove a domain from an organization.

### [organization_invitations](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md)

* [get_all](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#get_all) - Get a list of organization invitations for the current instance
* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#create) - Create and send an organization invitation
* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#list) - Get a list of organization invitations
* [bulk_create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#bulk_create) - Bulk create and send organization invitations
* [~~list_pending~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#list_pending) - Get a list of pending organization invitations :warning: **Deprecated**
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#get) - Retrieve an organization invitation by ID
* [revoke](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationinvitationssdk/README.md#revoke) - Revoke a pending organization invitation

### [organization_memberships](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md#create) - Create a new organization membership
* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md#list) - Get a list of all members of an organization
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md#update) - Update an organization membership
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md#delete) - Remove a member from an organization
* [update_metadata](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md#update_metadata) - Merge and update organization membership metadata
* [get_all](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationmembershipssdk/README.md#get_all) - Get a list of all organization memberships within an instance.

### [organizations](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#list) - Get a list of organizations for an instance
* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#create) - Create an organization
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#get) - Retrieve an organization by ID or slug
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#update) - Update an organization
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#delete) - Delete an organization
* [merge_metadata](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#merge_metadata) - Merge and update metadata for an organization
* [upload_logo](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#upload_logo) - Upload a logo for the organization
* [delete_logo](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/organizationssdk/README.md#delete_logo) - Delete the organization's logo.

### [phone_numbers](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/phonenumbers/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/phonenumbers/README.md#create) - Create a phone number
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/phonenumbers/README.md#get) - Retrieve a phone number
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/phonenumbers/README.md#delete) - Delete a phone number
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/phonenumbers/README.md#update) - Update a phone number

### [proxy_checks](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/proxychecks/README.md)

* [verify](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/proxychecks/README.md#verify) - Verify the proxy configuration for your domain

### [redirect_ur_ls](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/redirecturls/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/redirecturls/README.md#list) - List all redirect URLs

### [redirect_urls](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clerkredirecturls/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clerkredirecturls/README.md#create) - Create a redirect URL
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clerkredirecturls/README.md#get) - Retrieve a redirect URL
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/clerkredirecturls/README.md#delete) - Delete a redirect URL

### [saml_connections](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/samlconnectionssdk/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/samlconnectionssdk/README.md#list) - Get a list of SAML Connections for an instance
* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/samlconnectionssdk/README.md#create) - Create a SAML Connection
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/samlconnectionssdk/README.md#get) - Retrieve a SAML Connection by ID
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/samlconnectionssdk/README.md#update) - Update a SAML Connection
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/samlconnectionssdk/README.md#delete) - Delete a SAML Connection

### [sessions](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/sessions/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/sessions/README.md#list) - List all sessions
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/sessions/README.md#get) - Retrieve a session
* [revoke](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/sessions/README.md#revoke) - Revoke a session
* [~~verify~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/sessions/README.md#verify) - Verify a session :warning: **Deprecated**
* [create_token_from_template](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/sessions/README.md#create_token_from_template) - Create a session token from a jwt template

### [sign_in_tokens](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/signintokens/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/signintokens/README.md#create) - Create sign-in token
* [revoke](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/signintokens/README.md#revoke) - Revoke the given sign-in token

### [sign_ups](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/signups/README.md)

* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/signups/README.md#update) - Update a sign-up

### [~~templates~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/templates/README.md)

* [~~preview~~](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/templates/README.md#preview) - Preview changes to a template :warning: **Deprecated**

### [testing_tokens](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/testingtokens/README.md)

* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/testingtokens/README.md#create) - Retrieve a new testing token

### [users](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md)

* [list](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#list) - List all users
* [create](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#create) - Create a new user
* [count](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#count) - Count users
* [get](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#get) - Retrieve a user
* [update](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#update) - Update a user
* [delete](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete) - Delete a user
* [ban](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#ban) - Ban a user
* [unban](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#unban) - Unban a user
* [lock](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#lock) - Lock a user
* [unlock](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#unlock) - Unlock a user
* [set_profile_image](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#set_profile_image) - Set user profile image
* [delete_profile_image](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete_profile_image) - Delete user profile image
* [update_metadata](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#update_metadata) - Merge and update a user's metadata
* [get_o_auth_access_token](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#get_o_auth_access_token) - Retrieve the OAuth access token of a user
* [get_organization_memberships](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#get_organization_memberships) - Retrieve all memberships for a user
* [get_organization_invitations](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#get_organization_invitations) - Retrieve all invitations for a user
* [verify_password](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#verify_password) - Verify the password of a user
* [verify_totp](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#verify_totp) - Verify a TOTP or backup code for a user
* [disable_mfa](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#disable_mfa) - Disable a user's MFA methods
* [delete_backup_codes](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete_backup_codes) - Disable all user's Backup codes
* [delete_passkey](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete_passkey) - Delete a user passkey
* [delete_web3_wallet](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete_web3_wallet) - Delete a user web3 wallet
* [create_totp](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#create_totp) - Create a TOTP for a user
* [delete_totp](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete_totp) - Delete all the user's TOTPs
* [delete_external_account](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/users/README.md#delete_external_account) - Delete External Account

### [webhooks](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/webhooks/README.md)

* [create_svix_app](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/webhooks/README.md#create_svix_app) - Create a Svix app
* [delete_svix_app](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/webhooks/README.md#delete_svix_app) - Delete a Svix app
* [generate_svix_auth_url](https://github.com/clerk/clerk-sdk-python/blob/master/docs/sdks/webhooks/README.md#generate_svix_auth_url) - Create a Svix Dashboard URL

</details>
<!-- End Available Resources and Operations [operations] -->

<!-- Start File uploads [file-upload] -->
## File uploads

Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.

> [!TIP]
>
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
>

```python
from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.users.set_profile_image(user_id="usr_test123", file={
    "file_name": "example.file",
    "content": open("example.file", "rb"),
    "content_type": "<value>",
})

if res is not None:
    # handle response
    pass

```
<!-- End File uploads [file-upload] -->

<!-- Start Retries [retries] -->
## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
```python
from clerk.utils import BackoffStrategy, RetryConfig
from clerk_backend_api import Clerk

s = Clerk()

s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d",
    RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))

# Use the SDK ...

```

If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
```python
from clerk.utils import BackoffStrategy, RetryConfig
from clerk_backend_api import Clerk

s = Clerk(
    retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
)

s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d")

# Use the SDK ...

```
<!-- End Retries [retries] -->

<!-- Start Error Handling [errors] -->
## Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.

By default, an API error will raise a models.SDKError exception, which has the following properties:

| Property        | Type             | Description           |
|-----------------|------------------|-----------------------|
| `.status_code`  | *int*            | The HTTP status code  |
| `.message`      | *str*            | The error message     |
| `.raw_response` | *httpx.Response* | The raw HTTP response |
| `.body`         | *str*            | The response content  |

When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `verify_async` method may raise the following exceptions:

| Error Type         | Status Code        | Content Type       |
| ------------------ | ------------------ | ------------------ |
| models.ClerkErrors | 400, 401, 404      | application/json   |
| models.SDKError    | 4XX, 5XX           | \*/\*              |

### Example

```python
from clerk_backend_api import Clerk, models

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)

res = None
try:
    res = s.clients.verify(request={
        "token": "jwt_token_example",
    })

    if res is not None:
        # handle response
        pass

except models.ClerkErrors as e:
    # handle e.data: models.ClerkErrorsData
    raise(e)
except models.SDKError as e:
    # handle exception
    raise(e)
```
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://api.clerk.com/v1` | None |

#### Example

```python
from clerk_backend_api import Clerk

s = Clerk(
    server_idx=0,
)

s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d")

# Use the SDK ...

```


### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
```python
from clerk_backend_api import Clerk

s = Clerk(
    server_url="https://api.clerk.com/v1",
)

s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d")

# Use the SDK ...

```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.

For example, you could specify a header for every request that this sdk makes as follows:
```python
from clerk_backend_api import Clerk
import httpx

http_client = httpx.Client(headers={"x-custom-header": "someValue"})
s = Clerk(client=http_client)
```

or you could wrap the client with your own custom logic:
```python
from clerk_backend_api import Clerk
from clerk_backend_api.httpclient import AsyncHttpClient
import httpx

class CustomClient(AsyncHttpClient):
    client: AsyncHttpClient

    def __init__(self, client: AsyncHttpClient):
        self.client = client

    async def send(
        self,
        request: httpx.Request,
        *,
        stream: bool = False,
        auth: Union[
            httpx._types.AuthTypes, httpx._client.UseClientDefault, None
        ] = httpx.USE_CLIENT_DEFAULT,
        follow_redirects: Union[
            bool, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
    ) -> httpx.Response:
        request.headers["Client-Level-Header"] = "added by client"

        return await self.client.send(
            request, stream=stream, auth=auth, follow_redirects=follow_redirects
        )

    def build_request(
        self,
        method: str,
        url: httpx._types.URLTypes,
        *,
        content: Optional[httpx._types.RequestContent] = None,
        data: Optional[httpx._types.RequestData] = None,
        files: Optional[httpx._types.RequestFiles] = None,
        json: Optional[Any] = None,
        params: Optional[httpx._types.QueryParamTypes] = None,
        headers: Optional[httpx._types.HeaderTypes] = None,
        cookies: Optional[httpx._types.CookieTypes] = None,
        timeout: Union[
            httpx._types.TimeoutTypes, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
        extensions: Optional[httpx._types.RequestExtensions] = None,
    ) -> httpx.Request:
        return self.client.build_request(
            method,
            url,
            content=content,
            data=data,
            files=files,
            json=json,
            params=params,
            headers=headers,
            cookies=cookies,
            timeout=timeout,
            extensions=extensions,
        )

s = Clerk(async_client=CustomClient(httpx.AsyncClient()))
```
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name          | Type          | Scheme        |
| ------------- | ------------- | ------------- |
| `bearer_auth` | http          | HTTP Bearer   |

To authenticate with the API the `bearer_auth` parameter must be set when initializing the SDK client instance. For example:
```python
from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)

s.miscellaneous.get_interstitial(frontend_api="frontend-api_1a2b3c4d", publishable_key="pub_1a2b3c4d")

# Use the SDK ...

```
<!-- End Authentication [security] -->

<!-- Start Debugging [debug] -->
## Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass your own logger class directly into your SDK.
```python
from clerk_backend_api import Clerk
import logging

logging.basicConfig(level=logging.DEBUG)
s = Clerk(debug_logger=logging.getLogger("clerk_backend_api"))
```
<!-- End Debugging [debug] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development

## Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
looking for the latest version.

## Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. 
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. 

### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)

