clerk-http-client

ClerkHttpClient - the Ruby gem for the 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.

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

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 1.0.0
  • Generator version: 7.9.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://clerk.com/support

Installation

Build a gem

To build the Ruby code into a gem:

gem build clerk-http-client.gemspec

Then either install the gem locally:

gem install ./clerk-http-client-1.0.0.gem

(for development, run gem install --dev ./clerk-http-client-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'clerk-http-client', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'clerk-http-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'clerk-http-client'

# Setup authorization
ClerkHttpClient.configure do |config|
  # Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
  # Configure a proc to get access tokens in lieu of the static access_token configuration
  config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } 
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = ClerkHttpClient::ActorTokensApi.new
create_actor_token_request = ClerkHttpClient::CreateActorTokenRequest.new({user_id: 'user_id_example', actor: {"sub":"user_2OEpKhcCN1Lat9NQ0G6puh7q5Rb"}}) # CreateActorTokenRequest | 

begin
  #Create actor token
  result = api_instance.create_actor_token(create_actor_token_request)
  p result
rescue ClerkHttpClient::ApiError => e
  puts "Exception when calling ActorTokensApi->create_actor_token: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.clerk.com/v1

Class Method HTTP request Description
ClerkHttpClient::ActorTokensApi create_actor_token POST /actor_tokens Create actor token
ClerkHttpClient::ActorTokensApi revoke_actor_token POST /actor_tokens/actor_token_id/revoke Revoke actor token
ClerkHttpClient::AllowListBlockListApi create_allowlist_identifier POST /allowlist_identifiers Add identifier to the allow-list
ClerkHttpClient::AllowListBlockListApi create_blocklist_identifier POST /blocklist_identifiers Add identifier to the block-list
ClerkHttpClient::AllowListBlockListApi delete_allowlist_identifier DELETE /allowlist_identifiers/identifier_id Delete identifier from allow-list
ClerkHttpClient::AllowListBlockListApi delete_blocklist_identifier DELETE /blocklist_identifiers/identifier_id Delete identifier from block-list
ClerkHttpClient::AllowListBlockListApi list_allowlist_identifiers GET /allowlist_identifiers List all identifiers on the allow-list
ClerkHttpClient::AllowListBlockListApi list_blocklist_identifiers GET /blocklist_identifiers List all identifiers on the block-list
ClerkHttpClient::BetaFeaturesApi change_production_instance_domain POST /instance/change_domain Update production instance domain
ClerkHttpClient::BetaFeaturesApi update_instance_auth_config PATCH /beta_features/instance_settings Update instance settings
ClerkHttpClient::BetaFeaturesApi update_production_instance_domain PUT /beta_features/domain Update production instance domain
ClerkHttpClient::ClientsApi get_client GET /clients/client_id Get a client
ClerkHttpClient::ClientsApi get_client_list GET /clients List all clients
ClerkHttpClient::ClientsApi verify_client POST /clients/verify Verify a client
ClerkHttpClient::DomainsApi add_domain POST /domains Add a domain
ClerkHttpClient::DomainsApi delete_domain DELETE /domains/domain_id Delete a satellite domain
ClerkHttpClient::DomainsApi list_domains GET /domains List all instance domains
ClerkHttpClient::DomainsApi update_domain PATCH /domains/domain_id Update a domain
ClerkHttpClient::EmailAddressesApi create_email_address POST /email_addresses Create an email address
ClerkHttpClient::EmailAddressesApi delete_email_address DELETE /email_addresses/email_address_id Delete an email address
ClerkHttpClient::EmailAddressesApi get_email_address GET /email_addresses/email_address_id Retrieve an email address
ClerkHttpClient::EmailAddressesApi update_email_address PATCH /email_addresses/email_address_id Update an email address
ClerkHttpClient::EmailSMSTemplatesApi get_template GET /templates/template_type/slug Retrieve a template
ClerkHttpClient::EmailSMSTemplatesApi get_template_list GET /templates/template_type List all templates
ClerkHttpClient::EmailSMSTemplatesApi preview_template POST /templates/template_type/slug/preview Preview changes to a template
ClerkHttpClient::EmailSMSTemplatesApi revert_template POST /templates/template_type/slug/revert Revert a template
ClerkHttpClient::EmailSMSTemplatesApi toggle_template_delivery POST /templates/template_type/slug/toggle_delivery Toggle the delivery by Clerk for a template of a given type and slug
ClerkHttpClient::EmailSMSTemplatesApi upsert_template PUT /templates/template_type/slug Update a template for a given type and slug
ClerkHttpClient::InstanceSettingsApi update_instance PATCH /instance Update instance settings
ClerkHttpClient::InstanceSettingsApi update_instance_organization_settings PATCH /instance/organization_settings Update instance organization settings
ClerkHttpClient::InstanceSettingsApi update_instance_restrictions PATCH /instance/restrictions Update instance restrictions
ClerkHttpClient::InvitationsApi create_invitation POST /invitations Create an invitation
ClerkHttpClient::InvitationsApi list_invitations GET /invitations List all invitations
ClerkHttpClient::InvitationsApi revoke_invitation POST /invitations/invitation_id/revoke Revokes an invitation
ClerkHttpClient::JWKSApi get_jwks GET /jwks Retrieve the JSON Web Key Set of the instance
ClerkHttpClient::JWTTemplatesApi create_jwt_template POST /jwt_templates Create a JWT template
ClerkHttpClient::JWTTemplatesApi delete_jwt_template DELETE /jwt_templates/template_id Delete a Template
ClerkHttpClient::JWTTemplatesApi get_jwt_template GET /jwt_templates/template_id Retrieve a template
ClerkHttpClient::JWTTemplatesApi list_jwt_templates GET /jwt_templates List all templates
ClerkHttpClient::JWTTemplatesApi update_jwt_template PATCH /jwt_templates/template_id Update a JWT template
ClerkHttpClient::MiscellaneousApi get_public_interstitial GET /public/interstitial Returns the markup for the interstitial page
ClerkHttpClient::OAuthApplicationsApi create_o_auth_application POST /oauth_applications Create an OAuth application
ClerkHttpClient::OAuthApplicationsApi delete_o_auth_application DELETE /oauth_applications/oauth_application_id Delete an OAuth application
ClerkHttpClient::OAuthApplicationsApi get_o_auth_application GET /oauth_applications/oauth_application_id Retrieve an OAuth application by ID
ClerkHttpClient::OAuthApplicationsApi list_o_auth_applications GET /oauth_applications Get a list of OAuth applications for an instance
ClerkHttpClient::OAuthApplicationsApi rotate_o_auth_application_secret POST /oauth_applications/oauth_application_id/rotate_secret Rotate the client secret of the given OAuth application
ClerkHttpClient::OAuthApplicationsApi update_o_auth_application PATCH /oauth_applications/oauth_application_id Update an OAuth application
ClerkHttpClient::OrganizationDomainApi update_organization_domain PATCH /organizations/organization_id/domains/domain_id Update an organization domain.
ClerkHttpClient::OrganizationDomainsApi create_organization_domain POST /organizations/organization_id/domains Create a new organization domain.
ClerkHttpClient::OrganizationDomainsApi delete_organization_domain DELETE /organizations/organization_id/domains/domain_id Remove a domain from an organization.
ClerkHttpClient::OrganizationDomainsApi list_organization_domains GET /organizations/organization_id/domains Get a list of all domains of an organization.
ClerkHttpClient::OrganizationInvitationsApi create_organization_invitation POST /organizations/organization_id/invitations Create and send an organization invitation
ClerkHttpClient::OrganizationInvitationsApi create_organization_invitation_bulk POST /organizations/organization_id/invitations/bulk Bulk create and send organization invitations
ClerkHttpClient::OrganizationInvitationsApi get_organization_invitation GET /organizations/organization_id/invitations/invitation_id Retrieve an organization invitation by ID
ClerkHttpClient::OrganizationInvitationsApi list_instance_organization_invitations GET /organization_invitations Get a list of organization invitations for the current instance
ClerkHttpClient::OrganizationInvitationsApi list_organization_invitations GET /organizations/organization_id/invitations Get a list of organization invitations
ClerkHttpClient::OrganizationInvitationsApi list_pending_organization_invitations GET /organizations/organization_id/invitations/pending Get a list of pending organization invitations
ClerkHttpClient::OrganizationInvitationsApi revoke_organization_invitation POST /organizations/organization_id/invitations/invitation_id/revoke Revoke a pending organization invitation
ClerkHttpClient::OrganizationMembershipsApi create_organization_membership POST /organizations/organization_id/memberships Create a new organization membership
ClerkHttpClient::OrganizationMembershipsApi delete_organization_membership DELETE /organizations/organization_id/memberships/user_id Remove a member from an organization
ClerkHttpClient::OrganizationMembershipsApi instance_get_organization_memberships GET /organization_memberships Get a list of all organization memberships within an instance.
ClerkHttpClient::OrganizationMembershipsApi list_organization_memberships GET /organizations/organization_id/memberships Get a list of all members of an organization
ClerkHttpClient::OrganizationMembershipsApi update_organization_membership PATCH /organizations/organization_id/memberships/user_id Update an organization membership
ClerkHttpClient::OrganizationMembershipsApi update_organization_membership_metadata PATCH /organizations/organization_id/memberships/user_id/metadata Merge and update organization membership metadata
ClerkHttpClient::OrganizationsApi create_organization POST /organizations Create an organization
ClerkHttpClient::OrganizationsApi delete_organization DELETE /organizations/organization_id Delete an organization
ClerkHttpClient::OrganizationsApi delete_organization_logo DELETE /organizations/organization_id/logo
ClerkHttpClient::OrganizationsApi get_organization GET /organizations/organization_id Retrieve an organization by ID or slug
ClerkHttpClient::OrganizationsApi list_organizations GET /organizations Get a list of organizations for an instance
ClerkHttpClient::OrganizationsApi merge_organization_metadata PATCH /organizations/organization_id/metadata Merge and update metadata for an organization
ClerkHttpClient::OrganizationsApi update_organization PATCH /organizations/organization_id Update an organization
ClerkHttpClient::OrganizationsApi upload_organization_logo PUT /organizations/organization_id/logo Upload a logo for the organization
ClerkHttpClient::PhoneNumbersApi create_phone_number POST /phone_numbers Create a phone number
ClerkHttpClient::PhoneNumbersApi delete_phone_number DELETE /phone_numbers/phone_number_id Delete a phone number
ClerkHttpClient::PhoneNumbersApi get_phone_number GET /phone_numbers/phone_number_id Retrieve a phone number
ClerkHttpClient::PhoneNumbersApi update_phone_number PATCH /phone_numbers/phone_number_id Update a phone number
ClerkHttpClient::ProxyChecksApi verify_domain_proxy POST /proxy_checks Verify the proxy configuration for your domain
ClerkHttpClient::RedirectURLsApi create_redirect_url POST /redirect_urls Create a redirect URL
ClerkHttpClient::RedirectURLsApi delete_redirect_url DELETE /redirect_urls/id Delete a redirect URL
ClerkHttpClient::RedirectURLsApi get_redirect_url GET /redirect_urls/id Retrieve a redirect URL
ClerkHttpClient::RedirectURLsApi list_redirect_urls GET /redirect_urls List all redirect URLs
ClerkHttpClient::SAMLConnectionsApi create_saml_connection POST /saml_connections Create a SAML Connection
ClerkHttpClient::SAMLConnectionsApi delete_saml_connection DELETE /saml_connections/saml_connection_id Delete a SAML Connection
ClerkHttpClient::SAMLConnectionsApi get_saml_connection GET /saml_connections/saml_connection_id Retrieve a SAML Connection by ID
ClerkHttpClient::SAMLConnectionsApi list_saml_connections GET /saml_connections Get a list of SAML Connections for an instance
ClerkHttpClient::SAMLConnectionsApi update_saml_connection PATCH /saml_connections/saml_connection_id Update a SAML Connection
ClerkHttpClient::SessionsApi create_session_token_from_template POST /sessions/session_id/tokens/template_name Create a session token from a jwt template
ClerkHttpClient::SessionsApi get_session GET /sessions/session_id Retrieve a session
ClerkHttpClient::SessionsApi get_session_list GET /sessions List all sessions
ClerkHttpClient::SessionsApi revoke_session POST /sessions/session_id/revoke Revoke a session
ClerkHttpClient::SessionsApi verify_session POST /sessions/session_id/verify Verify a session
ClerkHttpClient::SignInTokensApi create_sign_in_token POST /sign_in_tokens Create sign-in token
ClerkHttpClient::SignInTokensApi revoke_sign_in_token POST /sign_in_tokens/sign_in_token_id/revoke Revoke the given sign-in token
ClerkHttpClient::SignUpsApi update_sign_up PATCH /sign_ups/id Update a sign-up
ClerkHttpClient::TestingTokensApi create_testing_token POST /testing_tokens Retrieve a new testing token
ClerkHttpClient::UsersApi ban_user POST /users/user_id/ban Ban a user
ClerkHttpClient::UsersApi create_user POST /users Create a new user
ClerkHttpClient::UsersApi create_user_totp POST /users/user_id/totp Create a TOTP for a user
ClerkHttpClient::UsersApi delete_backup_code DELETE /users/user_id/backup_code Disable all user's Backup codes
ClerkHttpClient::UsersApi delete_external_account DELETE /users/user_id/external_accounts/external_account_id Delete External Account
ClerkHttpClient::UsersApi delete_totp DELETE /users/user_id/totp Delete all the user's TOTPs
ClerkHttpClient::UsersApi delete_user DELETE /users/user_id Delete a user
ClerkHttpClient::UsersApi delete_user_profile_image DELETE /users/user_id/profile_image Delete user profile image
ClerkHttpClient::UsersApi disable_mfa DELETE /users/user_id/mfa Disable a user's MFA methods
ClerkHttpClient::UsersApi get_o_auth_access_token GET /users/user_id/oauth_access_tokens/provider Retrieve the OAuth access token of a user
ClerkHttpClient::UsersApi get_user GET /users/user_id Retrieve a user
ClerkHttpClient::UsersApi get_user_list GET /users List all users
ClerkHttpClient::UsersApi get_users_count GET /users/count Count users
ClerkHttpClient::UsersApi lock_user POST /users/user_id/lock Lock a user
ClerkHttpClient::UsersApi set_user_profile_image POST /users/user_id/profile_image Set user profile image
ClerkHttpClient::UsersApi unban_user POST /users/user_id/unban Unban a user
ClerkHttpClient::UsersApi unlock_user POST /users/user_id/unlock Unlock a user
ClerkHttpClient::UsersApi update_user PATCH /users/user_id Update a user
ClerkHttpClient::UsersApi update_user_metadata PATCH /users/user_id/metadata Merge and update a user's metadata
ClerkHttpClient::UsersApi user_passkey_delete DELETE /users/user_id/passkeys/passkey_identification_id Delete a user passkey
ClerkHttpClient::UsersApi user_web3_wallet_delete DELETE /users/user_id/web3_wallets/web3_wallet_identification_id Delete a user web3 wallet
ClerkHttpClient::UsersApi users_get_organization_invitations GET /users/user_id/organization_invitations Retrieve all invitations for a user
ClerkHttpClient::UsersApi users_get_organization_memberships GET /users/user_id/organization_memberships Retrieve all memberships for a user
ClerkHttpClient::UsersApi verify_password POST /users/user_id/verify_password Verify the password of a user
ClerkHttpClient::UsersApi verify_totp POST /users/user_id/verify_totp Verify a TOTP or backup code for a user
ClerkHttpClient::WebhooksApi create_svix_app POST /webhooks/svix Create a Svix app
ClerkHttpClient::WebhooksApi delete_svix_app DELETE /webhooks/svix Delete a Svix app
ClerkHttpClient::WebhooksApi generate_svix_auth_url POST /webhooks/svix_url Create a Svix Dashboard URL

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (sk__)