WorkOS PHP SDK

Webhooks
in package

Table of Contents

Properties

$client  : HttpClient

Methods

__construct()  : mixed
createWebhookEndpoint()  : WebhookEndpointJson
Create a Webhook Endpoint
deleteWebhookEndpoint()  : void
Delete a Webhook Endpoint
listWebhookEndpoints()  : PaginatedResponse<string|int, WebhookEndpointJson>
List Webhook Endpoints
updateWebhookEndpoint()  : WebhookEndpointJson
Update a Webhook Endpoint

Properties

Methods

createWebhookEndpoint()

Create a Webhook Endpoint

public createWebhookEndpoint(string $endpointUrl, array<string|int, CreateWebhookEndpointEvents$events[, RequestOptions|null $options = null ]) : WebhookEndpointJson

Create a new webhook endpoint to receive event notifications.

Parameters
$endpointUrl : string

The HTTPS URL where webhooks will be sent.

$events : array<string|int, CreateWebhookEndpointEvents>

The events that the Webhook Endpoint is subscribed to.

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

deleteWebhookEndpoint()

Delete a Webhook Endpoint

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

Delete an existing webhook endpoint.

Parameters
$id : string

Unique identifier of the Webhook Endpoint.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

listWebhookEndpoints()

List Webhook Endpoints

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

Get a list of all of your existing webhook endpoints.

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

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

updateWebhookEndpoint()

Update a Webhook Endpoint

public updateWebhookEndpoint(string $id[, string|null $endpointUrl = null ][, WebhookEndpointJsonStatus|null $status = null ][, array<string|int, CreateWebhookEndpointEvents>|null $events = null ][, RequestOptions|null $options = null ]) : WebhookEndpointJson

Update the properties of an existing webhook endpoint.

Parameters
$id : string

Unique identifier of the Webhook Endpoint.

$endpointUrl : string|null = null

The HTTPS URL where webhooks will be sent.

$status : WebhookEndpointJsonStatus|null = null

Whether the Webhook Endpoint is enabled or disabled.

$events : array<string|int, CreateWebhookEndpointEvents>|null = null

The events that the Webhook Endpoint is subscribed to.

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

        
On this page

Search results