Auth0-PHP

Organizations extends ManagementEndpoint
in package
implements OrganizationsInterface

Organizations Handles requests to the Organizations endpoints of the v2 Management API.

Tags
see
https://auth0.com/docs/api/management/v2#!/Organizations

Interfaces, Classes, Traits and Enums

OrganizationsInterface
Interface OrganizationsInterface.

Table of Contents

$httpClient  : HttpClient
__construct()  : mixed
ManagementEndpoint constructor.
addEnabledConnection()  : ResponseInterface
Add a connection to an organization.
addMemberRoles()  : ResponseInterface
Add one or more roles to a member (user) in an organization.
addMembers()  : ResponseInterface
Add one or more users to an organization as members.
create()  : ResponseInterface
Create an organization.
createInvitation()  : ResponseInterface
Create an invitation for an organization Required scope: `create:organization_invitations`.
delete()  : ResponseInterface
Delete an organization.
deleteInvitation()  : ResponseInterface
Delete an invitation (by ID) for an organization Required scope: `delete:organization_invitations`.
get()  : ResponseInterface
Get a specific organization.
getAll()  : ResponseInterface
List available organizations.
getByName()  : ResponseInterface
Get details about an organization, queried by it's `name`.
getEnabledConnection()  : ResponseInterface
Get a connection (by ID) associated with an organization.
getEnabledConnections()  : ResponseInterface
List the enabled connections associated with an organization.
getHttpClient()  : HttpClient
Get the injected HttpClient instance.
getInvitation()  : ResponseInterface
Get an invitation (by ID) for an organization Required scope: `read:organization_invitations`.
getInvitations()  : ResponseInterface
List invitations for an organization Required scope: `read:organization_invitations`.
getLastRequest()  : HttpRequest|null
Return an instance of HttpRequest representing the last issued request.
getMemberRoles()  : ResponseInterface
List the roles a member (user) in an organization currently has.
getMembers()  : ResponseInterface
List the members (users) belonging to an organization Required scope: `read:organization_members`.
getResponsePaginator()  : HttpResponsePaginator
Return a ResponsePaginator instance configured for the last HttpRequest.
instance()  : static
removeEnabledConnection()  : ResponseInterface
Remove a connection from an organization.
removeMemberRoles()  : ResponseInterface
Remove one or more roles from a member (user) in an organization.
removeMembers()  : ResponseInterface
Remove one or more members (users) from an organization.
update()  : ResponseInterface
Update an organization.
updateEnabledConnection()  : ResponseInterface
Update a connection to an organization.

Properties

Methods

__construct()

ManagementEndpoint constructor.

public final __construct(HttpClient $httpClient) : mixed
Parameters
$httpClient : HttpClient

httpClient instance to use

Return values
mixed

addEnabledConnection()

Add a connection to an organization.

public addEnabledConnection(string $id, string $connectionId, array<string|int, mixed> $body[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: create:organization_connections.

Parameters
$id : string

organization (by ID) to add a connection to

$connectionId : string

connection (by ID) to add to organization

$body : array<string|int, mixed>

Additional body content to send with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

addMemberRoles()

Add one or more roles to a member (user) in an organization.

public addMemberRoles(string $id, string $userId, array<string|int, mixed> $roles[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: create:organization_member_roles.

Parameters
$id : string

organization (by ID) user belongs to

$userId : string

user (by ID) to add roles to

$roles : array<string|int, mixed>

one or more roles (by ID) to add to the user

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

addMembers()

Add one or more users to an organization as members.

public addMembers(string $id, array<string|int, mixed> $members[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:organization_members.

Parameters
$id : string

organization (by ID) to add new members to

$members : array<string|int, mixed>

one or more users (by ID) to add from the organization

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

create()

Create an organization.

public create(string $name, string $displayName[, array<string|int, mixed>|null $branding = null ][, array<string|int, mixed>|null $metadata = null ][, array<string|int, mixed>|null $body = null ][, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: create:organizations.

Parameters
$name : string

the name of the Organization

$displayName : string

the displayed name of the Organization

$branding : array<string|int, mixed>|null = null

Optional. An array containing branding customizations for the organization.

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

Optional. Additional metadata to store about the organization.

$body : array<string|int, mixed>|null = null

Optional. Additional body content to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

createInvitation()

Create an invitation for an organization Required scope: `create:organization_invitations`.

public createInvitation(string $id, string $clientId, array<string|int, mixed> $inviter, array<string|int, mixed> $invitee[, array<string|int, mixed>|null $body = null ][, RequestOptions|null $options = null ]) : ResponseInterface
Parameters
$id : string

organization (by ID) to create the invitation for

$clientId : string

Client (by ID) to create the invitation for. This Client must be associated with the Organization.

$inviter : array<string|int, mixed>

An array containing information about the inviter. Requires a 'name' key minimally.

  • 'name' Required. A name to identify who is sending the invitation.
$invitee : array<string|int, mixed>

An array containing information about the invitee. Requires an 'email' key.

  • 'email' Required. An email address where the invitation should be sent.
$body : array<string|int, mixed>|null = null

Optional. Additional body content to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

delete()

Delete an organization.

public delete(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: delete:organizations.

Parameters
$id : string

organization (by ID) to delete

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

deleteInvitation()

Delete an invitation (by ID) for an organization Required scope: `delete:organization_invitations`.

public deleteInvitation(string $id, string $invitationId[, RequestOptions|null $options = null ]) : ResponseInterface
Parameters
$id : string

organization (by ID) to request

$invitationId : string

invitation (by ID) to request

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

get()

Get a specific organization.

public get(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:organizations.

Parameters
$id : string

organization (by ID) to retrieve details for

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getAll()

List available organizations.

public getAll([RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:organizations.

Parameters
$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getByName()

Get details about an organization, queried by it's `name`.

public getByName(string $name[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:organizations.

Parameters
$name : string

organization (by name parameter provided during creation) to retrieve details for

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getEnabledConnection()

Get a connection (by ID) associated with an organization.

public getEnabledConnection(string $id, string $connectionId[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:organization_connections.

Parameters
$id : string

organization (by ID) that the connection is associated with

$connectionId : string

connection (by ID) to retrieve details for

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getEnabledConnections()

List the enabled connections associated with an organization.

public getEnabledConnections(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:organization_connections.

Parameters
$id : string

organization (by ID) to list connections of

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getInvitation()

Get an invitation (by ID) for an organization Required scope: `read:organization_invitations`.

public getInvitation(string $id, string $invitationId[, RequestOptions|null $options = null ]) : ResponseInterface
Parameters
$id : string

organization (by ID) to request

$invitationId : string

invitation (by ID) to request

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getInvitations()

List invitations for an organization Required scope: `read:organization_invitations`.

public getInvitations(string $id[, RequestOptions|null $options = null ]) : ResponseInterface
Parameters
$id : string

organization (by ID) to list invitations for

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getMemberRoles()

List the roles a member (user) in an organization currently has.

public getMemberRoles(string $id, string $userId[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:organization_member_roles.

Parameters
$id : string

organization (by ID) user belongs to

$userId : string

user (by ID) to add role to

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getMembers()

List the members (users) belonging to an organization Required scope: `read:organization_members`.

public getMembers(string $id[, RequestOptions|null $options = null ]) : ResponseInterface
Parameters
$id : string

organization (by ID) to list members of

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

removeEnabledConnection()

Remove a connection from an organization.

public removeEnabledConnection(string $id, string $connectionId[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: delete:organization_connections.

Parameters
$id : string

organization (by ID) to remove connection from

$connectionId : string

connection (by ID) to remove from organization

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

removeMemberRoles()

Remove one or more roles from a member (user) in an organization.

public removeMemberRoles(string $id, string $userId, array<string|int, mixed> $roles[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: delete:organization_member_roles.

Parameters
$id : string

organization (by ID) user belongs to

$userId : string

user (by ID) to remove roles from

$roles : array<string|int, mixed>

one or more roles (by ID) to remove from the user

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

removeMembers()

Remove one or more members (users) from an organization.

public removeMembers(string $id, array<string|int, mixed> $members[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: delete:organization_members.

Parameters
$id : string

organization (by ID) users belong to

$members : array<string|int, mixed>

one or more users (by ID) to remove from the organization

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

update()

Update an organization.

public update(string $id, string $name, string $displayName[, array<string|int, mixed>|null $branding = null ][, array<string|int, mixed>|null $metadata = null ][, array<string|int, mixed>|null $body = null ][, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:organizations.

Parameters
$id : string

organization (by ID) to update

$name : string

the name of the Organization

$displayName : string

the displayed name of the Organization

$branding : array<string|int, mixed>|null = null

Optional. An array containing branding customizations for the organization.

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

Optional. Additional metadata to store about the organization.

$body : array<string|int, mixed>|null = null

Optional. Additional body content to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

updateEnabledConnection()

Update a connection to an organization.

public updateEnabledConnection(string $id, string $connectionId, array<string|int, mixed> $body[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:organization_connections.

Parameters
$id : string

organization (by ID) to add a connection to

$connectionId : string

connection (by ID) to add to organization

$body : array<string|int, mixed>

Additional body content to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

Search results