View Source WorkOS.Portal (WorkOS SDK for Elixir v0.1.3)

The Portal module provides resource methods for working with the Admin Portal product

@see https://workos.com/docs/admin-portal/guide

Link to this section Summary

Functions

Generate a link to grant access to an organization's Admin Portal

Retrieve a list of organizations that have connections configured within your WorkOS dashboard.

Link to this section Functions

Link to this function

create_organization(params, opts \\ [])

View Source

Create an organization

parameters

Parameters

  • params (map)
    • domains (list of strings) List of domains that belong to the organization
    • name (string) A unique, descriptive name for the organization

example

Example

WorkOS.Portal.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.Portal.delete_organization("organization_12345")

Link to this function

generate_link(params, opts \\ [])

View Source

Generate a link to grant access to an organization's Admin Portal

parameters

Parameters

  • params (map)
    • intent (string) The access scope for the generated Admin Portal link. Valid values are: ["sso"]
    • organization (string) The ID of the organization the Admin Portal link will be generated for.
    • return_url (string) The URL that the end user will be redirected to upon exiting the generated Admin Portal. If none is provided, the default redirect link set in your WorkOS Dashboard will be used.

example

Example

WorkOS.Portal.generate_link(%{ intent: "sso", organization: "org_1234" })

Link to this function

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

View Source

Retrieve a list of organizations that have connections configured within your WorkOS dashboard.

parameters

Parameters

  • params (map)
    • domains (array of strings) Filter organizations to only return those that are associated with the provided domains.
    • before (string) A pagination argument used to request organizations before the provided Organization ID.
    • after (string) A pagination argument used to request organizations after the provided Organization ID.
    • limit (integer) A pagination argument used to limit the number of listed Organizations that are returned.

example

Example

WorkOS.Portal.list_organizations()