Set the workspace webhook
Registers or replaces the workspace-wide endpoint and returns a fresh signing secret.
HTTP request
PUT https://www.asqiro.com/api/v1/webhooks
An API key created by a workspace member who can edit. A viewer's key answers 403.
Request body
| Parameter | Type | Description |
|---|---|---|
| targetUrl | string | Public HTTPS URL that receives the event. Private, loopback, and link-local hosts are rejected.Required |
Response body
| Field | Type | Description |
|---|---|---|
| enabled | boolean | Whether a workspace-wide webhook is currently configured. |
| targetUrl | string | The URL receiving events, or null when no webhook is configured. |
| signingSecret | string | Secret used to sign deliveries. Returned only by this call. |
Note One call covers every survey in the workspace, including surveys created afterwards. It has its own signing secret, unrelated to any survey webhook's.
Note Every call rotates the signing secret. Store the returned value before deploying, or deliveries will fail verification.
Errors
- unauthorized · 401 · The API key is missing, malformed, deleted, or its creator lost workspace access. Check the Authorization header, then the key itself.
- forbidden · 403 · The key is valid but lacks the access this call needs - most often a read-only key attempting a write.
- invalid_request · 400 · The request body or a parameter was missing or malformed. Fix the request; retrying it unchanged will fail again.
- plan_upgrade_required · 403 · The workspace owner's plan does not include API access. Upgrading the plan restores it; retrying will not.
- rate_limited · 429 · Too many requests. The Retry-After response header carries the number of seconds to wait.
Example request
bash
curl -X PUT "https://www.asqiro.com/api/v1/webhooks" \
-H "Authorization: Bearer $ASQIRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"targetUrl":"https://hooks.example.com/asqiro"}'Returns 200 on success.
json
{
"enabled": true,
"targetUrl": "https://hooks.example.com/asqiro",
"signingSecret": "a1b2c3d4e5f6..."
}