Operations for the ApiKeys API.
Summary
Functions
Expire an API key
Create an API key for an organization
Validate API key
Delete an API key
List API keys for an organization
Functions
@spec create_api_key_expire(WorkOS.Client.t(), String.t(), map(), keyword()) :: {:ok, WorkOS.ApiKey.t()} | {:error, WorkOS.Error.error()}
Expire an API key
Expire an API key immediately, schedule a future expiration, or clear a scheduled future expiration.
Parameters
id— The unique ID of the API key.params— request body mapopts— per-request options (seeWorkOS.Client.request/5)
@spec create_organization_api_key(WorkOS.Client.t(), String.t(), map(), keyword()) :: {:ok, WorkOS.OrganizationApiKeyWithValue.t()} | {:error, WorkOS.Error.error()}
Create an API key for an organization
Create a new API key for an organization.
Parameters
organization_id— Unique identifier of the Organization.params— request body mapopts— per-request options (seeWorkOS.Client.request/5)
@spec create_validation(WorkOS.Client.t(), map(), keyword()) :: {:ok, WorkOS.ApiKeyValidationResponse.t()} | {:error, WorkOS.Error.error()}
Validate API key
Validate an API key value and return the API key object if valid.
Parameters
params— request body mapopts— per-request options (seeWorkOS.Client.request/5)
@spec delete_api_key(WorkOS.Client.t(), String.t(), keyword()) :: {:ok, term()} | {:error, WorkOS.Error.error()}
Delete an API key
Permanently deletes an API key. This action cannot be undone. Once deleted, any requests using this API key will fail authentication.
Parameters
id— The unique ID of the API key.opts— per-request options (seeWorkOS.Client.request/5)
@spec list_organization_api_keys(WorkOS.Client.t(), String.t(), map(), keyword()) :: {:ok, WorkOS.Page.t(WorkOS.OrganizationApiKey.t())} | {:error, WorkOS.Error.error()}
List API keys for an organization
Get a list of all API keys for an organization.
Parameters
organization_id— Unique identifier of the Organization.params— query parameters::before,:after_,:limit,:orderopts— per-request options (seeWorkOS.Client.request/5)