Create a Webhook

Creates a webhook in ACTIVE state, so it starts receiving notifications immediately. Send the destination url, a name that is unique within the account, and at least one trigger. The response includes the id you use to retrieve, update and delete it.

To secure how WHITELABEL calls your endpoint, add the fields of any delivery authentication method to the same body. They are optional and you can combine them. The secrets you configure come back masked, and the rest come back as null.

To set oauth2_scope, use Update a Webhook.

An account can have several webhooks pointing at the same url, as long as they listen to different events. A webhook is rejected with 409 WEBHOOK_ALREADY_EXISTS when the account already has one with the same name, or one with the same url that listens to one of the same events.

POST/webhooks

Creates a webhook in active state, subscribed to the events you select. It requires at least one trigger, and starts receiving notifications immediately.

Body application/json

account_idstring<uuid>required

The unique identifier of the account the webhook belongs to.

namestringrequired

Your name for the webhook. It must be unique within the account.

urlstringrequired

The endpoint WHITELABEL sends the notifications to. It must be an http or https URL that resolves to a public, routable address.

api_keystring

Sent to your endpoint as the x-api-key header on every delivery.

secretstring

Sent to your endpoint as the x-secret header on every delivery.

hmac_client_secretstring

The key WHITELABEL signs the payload with. The signature travels in the x-hmac-signature header.

oauth2_authentication_urlstring

Your token endpoint. It must use HTTPS. Send oauth2_authentication_url, oauth2_client_id, oauth2_client_secret and oauth2_grant_type together.

oauth2_client_idstring

The client identifier WHITELABEL authenticates with. Send oauth2_authentication_url, oauth2_client_id, oauth2_client_secret and oauth2_grant_type together.

oauth2_client_secretstring

The client secret WHITELABEL authenticates with. Send oauth2_authentication_url, oauth2_client_id, oauth2_client_secret and oauth2_grant_type together.

oauth2_grant_typestring

The grant type WHITELABEL requests the token with. Send oauth2_authentication_url, oauth2_client_id, oauth2_client_secret and oauth2_grant_type together.

oauth2_authorization_namestring

The header WHITELABEL sends the token in. Defaults to Authorization.

oauth2_include_client_idboolean

Send the client identifier as a header on the token request as well.

enrollment_triggers"ENROLL" | "UNENROLL"[]

The enrollment events the webhook subscribes to.

payment_triggers"AUTHORIZE" | "CANCEL" | "CAPTURE" | "CHARGEBACK" | "PRECHARGEBACK" | "PURCHASE" | "REFUND" | "VERIFY"[]

The payment events the webhook subscribes to.

report_triggers"CREATE" | "UPDATE"[]

The report events the webhook subscribes to.

subscription_triggers"ACTIVE" | "CANCEL" | "CLOSE_TO_RENEWAL" | "COMPLETE" | "CREATE" | "PAUSE" | "PLAN_CHANGE_CANCELED" | "PLAN_CHANGE_SCHEDULED" | "PLAN_CHANGED" | "RESUME"[]

The subscription events the webhook subscribes to.

onboarding_triggers"BLOCKED" | "CANCELLED" | "CREATED" | "DECLINED" | "ERROR" | "EXPIRED" | "INACTIVE" | "PENDING" | "SUCCEEDED" | "TRANSFERRED" | "UNBLOCKED"[]

The onboarding events the webhook subscribes to.

renewal_daysinteger

How many days before a renewal WHITELABEL sends the CLOSE_TO_RENEWAL notification. It must be 1 or more, and it is valid only when subscription_triggers contains CLOSE_TO_RENEWAL.

Response

The webhook you created. The secrets you configured come back masked, and the ones you left out come back as null.

idstring

The unique identifier of the webhook.

account_idstring<uuid>

The unique identifier of the account the webhook belongs to.

namestring

Your name for the webhook.

state"ACTIVE" | "INACTIVE"

ACTIVE webhooks receive notifications, INACTIVE ones do not. A webhook starts out ACTIVE.

urlstring

The endpoint WHITELABEL sends the notifications to.

api_keystringnull

Masked as ***, or null when you have not configured it.

secretstringnull

Masked as ***, or null when you have not configured it.

hmac_client_secretstringnull

Masked as ***, or null when you have not configured it.

oauth2_authentication_urlstringnull

Your token endpoint.

oauth2_client_secretstringnull

Masked as ***, or null when you have not configured it.

oauth2_client_idstringnull

The client identifier WHITELABEL authenticates with.

oauth2_grant_typestringnull

The grant type WHITELABEL requests the token with.

oauth2_scopestringnull

The scope WHITELABEL requests the token with.

oauth2_authorization_namestringnull

The header WHITELABEL sends the token in.

oauth2_include_client_idboolean

Whether WHITELABEL also sends the client identifier as a header on the token request.

enrollment_triggersarraynull

The enrollment events the webhook subscribes to.

payment_triggersarraynull

The payment events the webhook subscribes to.

report_triggersarraynull

The report events the webhook subscribes to.

subscription_triggersarraynull

The subscription events the webhook subscribes to.

onboarding_triggersarraynull

The onboarding events the webhook subscribes to.

renewal_daysintegernull

How many days before a renewal WHITELABEL sends the CLOSE_TO_RENEWAL notification.

created_atstring<date-time>

The date and time the webhook was created, in ISO 8601.

updated_atstring<date-time>

The date and time the webhook was last updated, in ISO 8601. It matches created_at until you update the webhook for the first time.

The request is invalid. The code tells you which rule it broke.

code"WEBHOOK_INVALID_REQUEST" | "INVALID_ACCOUNT_ID" | "WEBHOOK_INVALID_TRIGGER" | "WEBHOOK_INVALID_OAUTH2" | "WEBHOOK_INVALID_RENEWAL_DAYS" | "WEBHOOK_URL_UNSAFE"

Machine-readable error code.

messagesstring[]

Human-readable description of the error.

Your API credentials are missing or invalid.

code"NOT_AUTHENTICATED" | "INVALID_CREDENTIALS"

Machine-readable error code.

messagesstring[]

Human-readable description of the error.

The account already has a webhook with that name, or one with the same URL that listens to one of the same events.

code"WEBHOOK_ALREADY_EXISTS"

Machine-readable error code.

messagesstring[]

Human-readable description of the error.

The webhook service is temporarily unavailable.

code"WEBHOOK_UPSTREAM_ERROR"

Machine-readable error code.

messagesstring[]

Human-readable description of the error.

Request
curl -X POST "https://api-sandbox.whitelabel.com/v1/webhooks" \
  -H "Content-Type: application/json" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>" \
  -d '{
  "account_id": "493e9374-510a-4201-9e09-de669d75f256",
  "name": "Production payments listener",
  "url": "https://api.acme.com/whitelabel/webhooks",
  "api_key": "my-webhook-key",
  "secret": "my-webhook-secret",
  "hmac_client_secret": "my-hmac-secret",
  "oauth2_authentication_url": "https://api.acme.com/oauth/token",
  "oauth2_client_id": "acme_client_id",
  "oauth2_client_secret": "acme_client_secret",
  "oauth2_grant_type": "client_credentials",
  "oauth2_authorization_name": "Authorization",
  "oauth2_include_client_id": false,
  "enrollment_triggers": [
    "ENROLL",
    "UNENROLL"
  ],
  "payment_triggers": [
    "AUTHORIZE",
    "CAPTURE",
    "REFUND"
  ],
  "report_triggers": [
    "UPDATE"
  ],
  "subscription_triggers": [
    "CREATE",
    "CLOSE_TO_RENEWAL"
  ],
  "onboarding_triggers": [
    "CREATED",
    "SUCCEEDED"
  ],
  "renewal_days": 5
}'
Response
{
  "id": "12345",
  "account_id": "493e9374-510a-4201-9e09-de669d75f256",
  "name": "Production payments listener",
  "state": "ACTIVE",
  "url": "https://api.acme.com/whitelabel/webhooks",
  "api_key": "***",
  "secret": "***",
  "hmac_client_secret": "***",
  "oauth2_authentication_url": "https://api.acme.com/oauth/token",
  "oauth2_client_secret": "***",
  "oauth2_client_id": "acme_client_id",
  "oauth2_grant_type": "client_credentials",
  "oauth2_scope": "webhooks:write",
  "oauth2_authorization_name": "Authorization",
  "oauth2_include_client_id": true,
  "enrollment_triggers": [
    "ENROLL",
    "UNENROLL"
  ],
  "payment_triggers": [
    "AUTHORIZE",
    "CAPTURE",
    "REFUND"
  ],
  "report_triggers": [
    "UPDATE"
  ],
  "subscription_triggers": [
    "CREATE",
    "CLOSE_TO_RENEWAL"
  ],
  "onboarding_triggers": [
    "CREATED",
    "SUCCEEDED"
  ],
  "renewal_days": 5,
  "created_at": "2026-07-09T13:05:36.482913Z",
  "updated_at": "2026-07-11T16:20:44.918330Z"
}