Skip to main content
POST
Create a workspace webhook
This creates a real webhook, and events start going to its URL right away. The response carries the plwh_ signing secret only this once. See Workspace webhooks.

Authorizations

x-api-key
string
header
required

Your ps_ API key

Headers

x-workspace-id
string

Only with an account key (ps_account_): the workspace to act on, from GET /v1/workspaces. Without it an account key gets 400 WORKSPACE_ID_REQUIRED.

Body

application/json
url
string
required

Must be https and reach a public address. A URL that points to an internal or private network address — localhost, a loopback or private IP, a host without a dot, or a name that resolves to one — → 400 WEBHOOK_URL_REFUSED.

Example:

"https://hooks.example.com/pilot/phone-lines"

events
enum<string>[]
required

One or more of the phone-line events, or "*" for all of them (inside this registry "*" means every phone-line event, including any added later). Duplicates are removed. An empty list or an unknown event → 400 INVALID_WEBHOOK.

Minimum array length: 1
Available options:
phone_line.purchased,
phone_line.audio_received,
phone_line.code_received,
phone_line.code_failed,
phone_line.renewed,
phone_line.payment_failed,
phone_line.suspended,
phone_line.returned,
phone_line.canceled,
phone_line.verification_updated,
*
Example:
name
string

Optional, up to 100 characters (400 INVALID_WEBHOOK_NAME above that). Blank or absent → the URL's host.

Maximum string length: 100
Example:

"Phone lines — production"

Response

Created — secret is returned only this once

webhook
object