Auth0-PHP

RulesInterface
in

Interface RulesInterface.

Table of Contents

create()  : ResponseInterface
Create a new Rule.
delete()  : ResponseInterface
Delete a rule by ID.
get()  : ResponseInterface
Get a single rule by ID.
getAll()  : ResponseInterface
Get all Rules, by page if desired.
update()  : ResponseInterface
Update a Rule by ID.

Methods

create()

Create a new Rule.

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

Required scope: create:rules.

Parameters
$name : string

name of this rule

$script : string

code to be executed when this rule runs

$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.)

Tags
throws
ArgumentException

when an invalid name or script are provided

throws
NetworkException

when the API request fails due to a network error

see
https://auth0.com/docs/api/management/v2#!/Rules/post_rules
see
https://auth0.com/docs/rules/current#create-rules-with-the-management-api
Return values
ResponseInterface

delete()

Delete a rule by ID.

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

Required scope: delete:rules.

Parameters
$id : string

rule 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.)

Tags
throws
ArgumentException

when an invalid id is provided

throws
NetworkException

when the API request fails due to a network error

see
https://auth0.com/docs/api/management/v2#!/Rules/delete_rules_by_id
Return values
ResponseInterface

get()

Get a single rule by ID.

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

Required scope: read:rules.

Parameters
$id : string

rule ID to get

$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.)

Tags
throws
ArgumentException

when an invalid id is provided

throws
NetworkException

when the API request fails due to a network error

see
https://auth0.com/docs/api/management/v2#!/Rules/get_rules_by_id
Return values
ResponseInterface

getAll()

Get all Rules, by page if desired.

public getAll([array<string|int, int|string|null>|null $parameters = null ][, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:rules.

Parameters
$parameters : array<string|int, int|string|null>|null = null

Optional. Query parameters 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.)

Tags
throws
NetworkException

when the API request fails due to a network error

see
https://auth0.com/docs/api/management/v2#!/Rules/get_rules
Return values
ResponseInterface

update()

Update a Rule by ID.

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

Required scope: update:rules.

Parameters
$id : string

rule ID to delete

$body : array<string|int, mixed>

rule data to update

$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.)

Tags
throws
ArgumentException

when an invalid id or body are provided

throws
NetworkException

when the API request fails due to a network error

see
https://auth0.com/docs/api/management/v2#!/Rules/patch_rules_by_id
Return values
ResponseInterface

Search results