View Source WorkOS.Organizations (WorkOS SDK for Elixir v0.4.0)
The Organizations module provides resource methods for working with Organizations
Link to this section Summary
Functions
Create an organization
Delete an organization
Get an organization
List organizations
Update an organization
Link to this section Functions
Create an organization
parameters
Parameters
- params (map)
- name (string) A unique, descriptive name for the organization
- allow_profiles_outside_organization (boolean - optional) Whether the Connections within this Organization should allow Profiles that do not have a domain that is set
- domains (array of strings - optional) List of domains that belong to the organization
example
Example
WorkOS.Organizations.create_organization(%{ domains: ["workos.com"], name: "WorkOS" })
Delete an organization
parameters
Parameters
- organization_id (string) the id of the organization to delete
example
Example
WorkOS.Organizations.delete_organization("organization_12345")
Get an organization
parameters
Parameters
- organization_id (string) the id of the organization to update
example
Example
WorkOS.Organizations.get_organization(organization="org_123")
List organizations
parameters
Parameters
- params (map)
- domains (array of strings - optional) List of domains that belong to the organization
- limit (number - optional) Upper limit on the number of objects to return, between 1 and 100. The default value is 10
- before (string - optional) An object ID that defines your place in the list
- after (string - optional) An object ID that defines your place in the list
- order ("asc" or "desc" - optional) Supported values are "asc" and "desc" for ascending and descending order respectively
example
Example
WorkOS.Organizations.list_organizations()
Update an organization
parameters
Parameters
- organization (string) The ID of the organization to update
- params (map)
- name (string) Name of organization
- allow_profiles_outside_organization (boolean - optional) Whether the Connections within this Organization should allow Profiles that do not have a domain that is set
- domains (array of strings - optional) List of domains that belong to the organization
example
Example
WorkOS.Organizations.update_organization(organization="organization_12345", %{ domains: ["workos.com"], name: "WorkOS" })