WorkOS PHP SDK

DirectorySync
in package

Table of Contents

Properties

$client  : HttpClient

Methods

__construct()  : mixed
deleteDirectory()  : void
Delete a Directory
getDirectory()  : Directory
Get a Directory
getGroup()  : DirectoryGroup
Get a Directory Group
getUser()  : DirectoryUserWithGroups
Get a Directory User
listDirectories()  : PaginatedResponse<string|int, Directory>
List Directories
listGroups()  : PaginatedResponse<string|int, DirectoryGroup>
List Directory Groups
listUsers()  : PaginatedResponse<string|int, DirectoryUserWithGroups>
List Directory Users

Properties

Methods

deleteDirectory()

Delete a Directory

public deleteDirectory(string $id[, RequestOptions|null $options = null ]) : void

Permanently deletes an existing directory. It cannot be undone.

Parameters
$id : string

Unique identifier for the Directory.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

listDirectories()

List Directories

public listDirectories([string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, string|null $organizationId = null ][, string|null $search = null ][, string|null $domain = null ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, Directory>

Get a list of all of your existing directories matching the criteria specified.

Parameters
$before : string|null = null

An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.

$after : string|null = null

An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.

$limit : int|null = null

Upper limit on the number of objects to return, between 1 and 100. Defaults to 10.

$order : EventsOrder = EventsOrder::Desc

Order the results by the creation time. Defaults to "desc".

$organizationId : string|null = null

Filter Directories by their associated organization.

$search : string|null = null

Searchable text to match against Directory names.

$domain : string|null = null

(deprecated) Filter Directories by their associated domain.

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
PaginatedResponse<string|int, Directory>

listGroups()

List Directory Groups

public listGroups([string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, string|null $directory = null ][, string|null $user = null ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, DirectoryGroup>

Get a list of all of existing directory groups matching the criteria specified.

Parameters
$before : string|null = null

An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with "obj_123", your subsequent call can include before="obj_123" to fetch a new batch of objects before "obj_123".

$after : string|null = null

An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with "obj_123", your subsequent call can include after="obj_123" to fetch a new batch of objects after "obj_123".

$limit : int|null = null

Upper limit on the number of objects to return, between 1 and 100. Defaults to 10.

$order : EventsOrder = EventsOrder::Desc

Order the results by the creation time. Supported values are "asc" (ascending), "desc" (descending), and "normal" (descending with reversed cursor semantics where before fetches older records and after fetches newer records). Defaults to descending. Defaults to "desc".

$directory : string|null = null

Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API.

$user : string|null = null

Unique identifier of the WorkOS Directory User. This value can be obtained from the WorkOS API.

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
PaginatedResponse<string|int, DirectoryGroup>

listUsers()

List Directory Users

public listUsers([string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, string|null $directory = null ][, string|null $group = null ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, DirectoryUserWithGroups>

Get a list of all of existing Directory Users matching the criteria specified.

Parameters
$before : string|null = null

An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with "obj_123", your subsequent call can include before="obj_123" to fetch a new batch of objects before "obj_123".

$after : string|null = null

An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with "obj_123", your subsequent call can include after="obj_123" to fetch a new batch of objects after "obj_123".

$limit : int|null = null

Upper limit on the number of objects to return, between 1 and 100. Defaults to 10.

$order : EventsOrder = EventsOrder::Desc

Order the results by the creation time. Supported values are "asc" (ascending), "desc" (descending), and "normal" (descending with reversed cursor semantics where before fetches older records and after fetches newer records). Defaults to descending. Defaults to "desc".

$directory : string|null = null

Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API.

$group : string|null = null

Unique identifier of the WorkOS Directory Group. This value can be obtained from the WorkOS API.

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
PaginatedResponse<string|int, DirectoryUserWithGroups>

        
On this page

Search results