View Source WorkOS.Organizations (WorkOS SDK for Elixir v0.3.0)

The Organizations module provides resource methods for working with Organizations

Link to this section Summary

Link to this section Functions

Link to this function

create_organization(params, opts \\ [])

View Source

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" })

Link to this function

delete_organization(organization, opts \\ [])

View Source

Delete an organization

parameters

Parameters

  • organization_id (string) the id of the organization to delete

example

Example

WorkOS.Organizations.delete_organization("organization_12345")

Link to this function

get_organization(organization, opts \\ [])

View Source

Get an organization

parameters

Parameters

  • organization_id (string) the id of the organization to update

example

Example

WorkOS.Organizations.get_organization(organization="org_123")

Link to this function

list_organizations(params \\ %{}, opts \\ [])

View Source

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()

Link to this function

update_organization(organization, params, opts \\ [])

View Source

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" })