Webhooks

$envless->webhooks->listEventTypes()

Read the catalogue of deliverable event names

php
/** @return EventTypesResource */
public function listEventTypes(int|float|null $timeout = null): array

Returns the authoritative list of event names this API can deliver. eventTypes on create and update is validated against exactly this catalogue, so read it before you build a subscription UI or hardcode a name, because anything absent from it is a 400.

This one is not paginated. There is no limit or offset and no page envelope: totalCount is simply the length of eventTypes. The catalogue is global rather than per workspace, so it is safe to fetch once and cache for the process lifetime.

The payload your receiver gets wraps one of these names in an envelope holding id, type, apiVersion, createdAt, workspaceId, actor and data, where data is the per event body. Read type to route, not the URL you registered.

Example

php
use Envless\Envless;

$envless = new Envless();

$catalogue = $envless->webhooks->listEventTypes();
$variableEvents = array_filter(
    $catalogue['eventTypes'],
    static fn(string $type): bool => str_starts_with($type, 'variable.'),
);

echo $catalogue['totalCount'], PHP_EOL;
echo implode(', ', $variableEvents), PHP_EOL;

Parameters

ParameterTypeRequiredDescription
$timeoutint|floatNoSeconds each attempt of this call may take, the response body included, before it throws Envless\Exception\NetworkException with isTimeout() true. Overrides the client's timeout for this call, and 0 turns the limit off.

Returns

EventTypesResource with eventTypes and totalCount.

Worth knowing

  • Treat the live response as the source of truth, the enum in the reference docs is only a snapshot.
  • Refused for project fenced keys even though the catalogue is not workspace specific.

Required scopes

webhooks:read

Underlying endpoint

GET /webhooks/event-types

Request and response schema, every error code, and a live playground.

In TypeScript

envless.webhooks.listEventTypes()

The same method in @goenvless/sdk, with the same request, retries and errors.