Create a webhook endpoint
POST/api/v1/workspaces/:workspace_id/webhook_endpoints
Creates a new webhook endpoint in the specified workspace. The response includes the signing_secret exactly once - it is never returned again except via regenerate_secret.
Request
Responses
- 201
- 401
- 403
- 422
The webhook endpoint was created. Its signing_secret is included in this response - save it now, as it is shown only this once and is never returned again except via regenerate_secret.
The request is missing a bearer token, or the token is invalid or expired.
The OAuth application's token is valid, but the application has no access grant for the requested workspace, or no such workspace exists.
The webhook_endpoint payload failed validation - url must use https and event_type must be one of the supported event types. Two rules are per-event rather than global, and both are stated as PROPERTIES rather than as a list of event types, because the list grows. includes may only name values the chosen event type allows: an includes value names invoice-document associations, so only an event type whose payload is a filtered invoice document accepts one - invoice.created does, and every other type delivers a body no include narrows and so accepts none. category_id may only be set on an event type fan-out can route by category, and fan-out derives a category from the event's invoice document - so an event type that carries no invoice document may not be bound to one, and a subscription that tried would never receive anything. The response body lists each invalid attribute and the reason under errors.