WorkOS PHP SDK

Organizations
in package

Table of Contents

Properties

$client  : HttpClient

Methods

__construct()  : mixed
createOrganization()  : Organization
Create an Organization
deleteOrganization()  : void
Delete an Organization
getAuditLogConfiguration()  : AuditLogConfiguration
Get Audit Log Configuration
getOrganization()  : Organization
Get an Organization
getOrganizationByExternalId()  : Organization
Get an Organization by External ID
listOrganizations()  : PaginatedResponse<string|int, Organization>
List Organizations
updateOrganization()  : Organization
Update an Organization

Properties

Methods

createOrganization()

Create an Organization

public createOrganization(string $name[, bool|null $allowProfilesOutsideOrganization = null ][, array<string|int, string>|null $domains = null ][, array<string|int, OrganizationDomainData>|null $domainData = null ][, array<string, string>|null $metadata = null ][, string|null $externalId = null ][, RequestOptions|null $options = null ]) : Organization

Creates a new organization in the current environment.

Parameters
$name : string

The name of the organization.

$allowProfilesOutsideOrganization : bool|null = null

Whether the organization allows profiles from outside the organization to sign in.

$domains : array<string|int, string>|null = null

The domains associated with the organization. Deprecated in favor of domain_data.

$domainData : array<string|int, OrganizationDomainData>|null = null

The domains associated with the organization, including verification state.

$metadata : array<string, string>|null = null

Object containing metadata key/value pairs associated with the Organization.

$externalId : string|null = null

An external identifier for the Organization.

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
Organization

deleteOrganization()

Delete an Organization

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

Permanently deletes an organization in the current environment. It cannot be undone.

Parameters
$id : string

Unique identifier of the Organization.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

listOrganizations()

List Organizations

public listOrganizations([string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, EventsOrder $order = EventsOrder::Desc ][, array<string|int, string>|null $domains = null ][, string|null $search = null ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, Organization>

Get a list of all of your existing organizations 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".

$domains : array<string|int, string>|null = null

The domains of an Organization. Any Organization with a matching domain will be returned.

$search : string|null = null

Searchable text for an Organization. Matches against the organization name.

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

updateOrganization()

Update an Organization

public updateOrganization(string $id[, string|null $name = null ][, bool|null $allowProfilesOutsideOrganization = null ][, array<string|int, string>|null $domains = null ][, array<string|int, OrganizationDomainData>|null $domainData = null ][, string|null $stripeCustomerId = null ][, array<string, string>|null $metadata = null ][, string|null $externalId = null ][, RequestOptions|null $options = null ]) : Organization

Updates an organization in the current environment.

Parameters
$id : string

Unique identifier of the Organization.

$name : string|null = null

The name of the organization.

$allowProfilesOutsideOrganization : bool|null = null

Whether the organization allows profiles from outside the organization to sign in.

$domains : array<string|int, string>|null = null

(deprecated) The domains associated with the organization. Deprecated in favor of domain_data.

$domainData : array<string|int, OrganizationDomainData>|null = null

The domains associated with the organization, including verification state.

$stripeCustomerId : string|null = null

The Stripe customer ID associated with the organization.

$metadata : array<string, string>|null = null

Object containing metadata key/value pairs associated with the Organization.

$externalId : string|null = null

An external identifier for the Organization.

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
Organization

        
On this page

Search results