View Source WorkOS.DirectorySync (WorkOS SDK for Elixir v0.2.0)

The Directory Sync module provides convenience methods for working with the WorkOS Directory Sync platform. You'll need a valid API key and to have created a Directory Sync connection on your WorkOS dashboard.

@see https://docs.workos.com/directory-sync/overview

Link to this section Summary

Functions

Delete the directory with the given ID.

Retrieve the directory with the given ID.

Retrieve the directory group with the given ID.

Retrieve the directory group with the given ID.

Retrieve directory groups.

Retrieve directory users.

Link to this section Functions

Link to this function

delete_directory(directory, opts \\ [])

View Source

Delete the directory with the given ID.

parameters

Parameters

  • directory (string) the id of the directory to delete

example

Example

WorkOS.DirectorySync.delete_directory("directory_12345")

Link to this function

get_directory(directory, opts \\ [])

View Source

Retrieve the directory with the given ID.

parameters

Parameters

  • directory (string) the id of the directory to retrieve

example

Example

WorkOS.DirectorySync.get_directory("directory_12345")

Link to this function

get_group(group, opts \\ [])

View Source

Retrieve the directory group with the given ID.

parameters

Parameters

  • group (string) the id of the group to retrieve

example

Example

WorkOS.DirectorySync.get_group("directory_group_12345")

Link to this function

get_user(user, opts \\ [])

View Source

Retrieve the directory group with the given ID.

parameters

Parameters

  • user (string) the id of the user to retrieve

example

Example

WorkOS.DirectorySync.get_user("directory_user_12345")

Link to this function

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

View Source

Retrieve directories.

parameters

Parameters

  • params (map)
    • domain (string) the id of the domain to list directories for
    • search (string) the keyword to search directories for
    • 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
    • organization_id (string) the id of the organization to list directories for

example

Example

WorkOS.DirectorySync.list_directories(%{domain: "workos.com"})

Link to this function

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

View Source

Retrieve directory groups.

parameters

Parameters

  • params (map)
    • directory (string) the id of the directory to list groups for
    • user (string) the id of the user to list groups for
    • 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.DirectorySync.list_groups(%{directory: "directory_12345"})

Link to this function

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

View Source

Retrieve directory users.

parameters

Parameters

  • params (map)
    • directory (string) the id of the directory to list users for
    • group (string) the id of the group to list users for
    • 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.DirectorySync.list_users(%{directory: "directory_12345"})