Clerk Python SDK

repository·main·Indexed 41 days ago

https://github.com/clerk/clerk-sdk-python

Python Client SDK (version 7.0.0) for the Clerk User Management Platform, providing a backend interface to manage actor tokens, admin portal link tokens, agent tasks, allow-list identifiers, API keys, and instance settings.

Tokens
207.3K
Snippets
854
Records
1K
Agent score
49%

What's inside Clerk

  1. Overview of M2M (Machine-to-Machine) operations

    main

    The M2M (Machine-to-Machine) functionality in the Clerk Python SDK allows you to manage authentication tokens for non-human entities. You can perform the following operations:

    • create_token: Generate a new M2M Token.
    • list_tokens: Retrieve a list of existing M2M Tokens.
    • revoke_token: Invalidate an existing M2M Token.
    • verify_token: Validate the authenticity and status of an M2M Token.
  2. Overview of Organizations operations

    main

    The Organizations domain in the Clerk Python SDK allows you to manage organization resources, including their metadata, branding (logos), and billing information.

    Available operations include:

    • Lifecycle Management: list, create, get, update, and delete.
    • Metadata Management: merge_metadata and replace_metadata.
    • Branding: upload_logo and delete_logo.
    • Billing: get_billing_subscription, get_billing_credit_balance, and adjust_billing_credit_balance.
  3. Overview of Machine operations

    main

    The Machines API allows you to manage machine identities within an instance. You can perform lifecycle operations on machines, manage their secret keys, and control their access via scopes.

    Available operations include:

    • list: Get a list of machines for an instance
    • create: Create a machine
    • get: Retrieve a machine
    • update: Update a machine
    • delete: Delete a machine
    • get_secret_key: Retrieve a machine secret key
    • rotate_secret_key: Rotate a machine's secret key
    • create_scope: Create a machine scope
    • delete_scope: Delete a machine scope
  4. Manage Organization Roles

    main

    The OrganizationRoles resource allows you to manage the roles available within an organization. You can perform the following operations:

    • list: Retrieve a list of all organization roles.
    • create: Create a new organization role.
    • get: Retrieve the details of a specific organization role.
    • update: Update an existing organization role.
    • delete: Delete an organization role.
    • assign_permission: Add a specific permission to an organization role.
    • remove_permission: Remove a specific permission from an organization role.
  5. Manage EmailAddresses in Clerk

    main

    The email_addresses namespace in the Clerk Python SDK allows you to manage email addresses associated with users. You can perform operations such as creating, retrieving, deleting, updating, and verifying email addresses, as well as replacing a user's email address.

    Available operations include:

    • create: Create a new email address
    • get: Retrieve an email address
    • delete: Delete an email address
    • update: Update an email address
    • prepare_verification: Send a verification code to an email address
    • attempt_verification: Verify a code sent to an email address
    • replace_for_user: Replace a user's email address
  6. Manage RoleSets with the Clerk Python SDK

    main

    The RoleSets domain in the Clerk Python SDK allows you to manage collections of roles. You can perform various operations to control how roles are grouped and assigned within your application.

    Available operations include:

    • list: Retrieve a list of all role sets.
    • create: Create a new role set.
    • get: Retrieve the details of a specific role set.
    • update: Update an existing role set.
    • replace: Replace an existing role set.
    • add_roles: Add new roles to an existing role set.
    • replace_role: Replace a specific role within a role set.
  7. Manage Organization Domains with Clerk SDK

    main

    The organization_domains resource in the Clerk Python SDK allows you to manage domains associated with specific organizations. You can create new domains, list existing ones, update them, delete them, and verify ownership.

    Available operations include:

    • create: Create a new organization domain.
    • list: Get a list of all domains for a specific organization.
    • update: Update an existing organization domain.
    • delete: Remove a domain from an organization.
    • verify_ownership: Mark a domain's ownership as verified.
    • list_all: List all organization domains.
  8. Manage OAuth applications with the OAuthApplications SDK

    main
    The OauthApplications domain in the Clerk Python SDK allows you to manage OAuth applications associated with your Clerk instance. You can perform lifecycle operations such as creating, retrieving, updating, and deleting applications, as well as managing their security and branding (e.g., rotating secrets or uploading logos).
  9. Available Phone Number operations

    main

    The clerk.phone_numbers namespace provides the following operations:

    • create: Create a phone number
    • get: Retrieve a phone number
    • delete: Delete a phone number
    • update: Update a phone number
    • prepare_verification: Send a verification code to a phone number
    • attempt_verification: Verify a code sent to a phone number
    • replace_for_user: Replace a user's phone number
  10. Available Session operations

    main

    The clerk.sessions object provides the following operations:

    • list: List all sessions matching criteria.
    • create: Create a new active session (Testing only).
    • get: Retrieve a specific session.
    • refresh: Refresh a session.
    • revoke: Revoke a session.
    • create_token: Create a session token.
    • create_token_from_template: Create a session token from a JWT template.