WorkOS PHP SDK

Organizations
in package

Table of Contents

Properties

$client  : HttpClient

Methods

__construct()  : mixed
createItContact()  : ItContact
Create an IT contact
createOrganization()  : Organization
Create an Organization
deleteItContact()  : void
Delete an IT contact
deleteOrganization()  : void
Delete an Organization
getAuditLogConfiguration()  : AuditLogConfiguration
Get Audit Log Configuration
getOrganization()  : Organization
Get an Organization
getOrganizationByExternalId()  : Organization
Get an Organization by External ID
inviteItContact()  : mixed
Invite an IT contact
listAuthorizedApplications()  : PaginatedResponse<string|int, OrganizationAuthorizedConnectApplicationListData>
List authorized applications
listItContacts()  : ItContactList
List IT contacts
listOrganizations()  : PaginatedResponse<string|int, Organization>
List Organizations
revokeItContact()  : mixed
Revoke an IT contact's invitation
updateOrganization()  : Organization
Update an Organization

Properties

Methods

createItContact()

Create an IT contact

public createItContact(string $organizationId, string $email[, RequestOptions|null $options = null ]) : ItContact

Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.

Parameters
$organizationId : string

The ID of the organization.

$email : string

The email address of the IT contact.

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

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

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

$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

deleteItContact()

Delete an IT contact

public deleteItContact(string $organizationId, string $contactId[, RequestOptions|null $options = null ]) : void

Remove an IT contact from an organization and revoke the contact's active setup links.

Parameters
$organizationId : string

The ID of the organization.

$contactId : string

The ID of the IT contact.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

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

inviteItContact()

Invite an IT contact

public inviteItContact(string $organizationId, string $contactId, array<string|int, InviteItContactIntents> $intents[, RequestOptions|null $options = null ]) : mixed

Create an Admin Portal setup link and email it to the IT contact. An organization can have at most one active invitation.

Parameters
$organizationId : string

The ID of the organization.

$contactId : string

The ID of the IT contact.

$intents : array<string|int, InviteItContactIntents>

The Admin Portal features that the IT contact can configure.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

listAuthorizedApplications()

List authorized applications

public listAuthorizedApplications(string $organizationId[, string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, PaginationOrder $order = PaginationOrder::Desc ][, RequestOptions|null $options = null ]) : PaginatedResponse<string|int, OrganizationAuthorizedConnectApplicationListData>

Get a list of all Connect applications that users in the organization have authorized.

Parameters
$organizationId : string

The ID of the organization.

$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 : PaginationOrder = PaginationOrder::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 "desc".

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

listOrganizations()

List Organizations

public listOrganizations([string|null $before = null ][, string|null $after = null ][, int|null $limit = null ][, PaginationOrder $order = PaginationOrder::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 : PaginationOrder = PaginationOrder::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 "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>

revokeItContact()

Revoke an IT contact's invitation

public revokeItContact(string $organizationId, string $contactId[, RequestOptions|null $options = null ]) : mixed

Revoke the organization's active Admin Portal invitation.

Parameters
$organizationId : string

The ID of the organization.

$contactId : string

The ID of the IT contact.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

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