Create a webhook endpoint
POST /api/v1/webhooks/endpoints
Creates an active webhook endpoint for the authenticated organization. Requires webhooks.manage and the write ability. url must be a publicly reachable HTTPS endpoint on port 443 without URL credentials; private, loopback, reserved, and metadata destinations return 422. Redirects are not followed during delivery. url is limited to 512 characters. events is optional; when supplied it must be a non-empty list of registered event names, *, or a registered namespace wildcard such as receipt.*. The HMAC secret is returned once and must be stored by the caller.
Authenticate with a portal session token.
Request body
application/json object
eventsarray of stringItems: at least 1 itemsurlstring (uri) requiredPublicly reachable HTTPS URL on port 443; private, loopback, reserved, and metadata targets are rejected.
Length: at most 512 characters
Example
{
"events": [
"receipt.signed"
],
"url": "https://hooks.example.com/cloakapi"
}Responses
201 Endpoint created; secret is returned once.
application/json object
eventsarray of string requiredidinteger requiredis_activeboolean requiredValue:truemessagestring requiredsecretstring requiredWrite onlyurlstring (uri) required
Generated sample
{
"events": [
"string"
],
"id": 0,
"is_active": true,
"message": "string",
"secret": "string",
"url": "https://example.com"
}401 Missing or invalid bearer token.
application/json object
Any keys are accepted.
403 The authenticated user has not verified their email or accepted the Terms of Service and Privacy Policy, or lacks the required write ability or webhooks.manage permission.
application/json object
Any keys are accepted.
422 Validation failed or the destination URL is unsafe.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 The request was rate limited. API-generated responses are JSON;
Response headers
Retry-Afterstring headerSeconds to wait before retrying, when provided.
X-RateLimit-Scopestring headerIdentifies the scope of the request limit, when provided.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string