Create a Webhook
Create an outbound webhook subscription. Returns the generated signing secret once.
Needs write access. About keys
Request
curl -X POST "https://app.vyingfor.com/api/v1/webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Results alerts","url":"https://example.com/vying-events","preset":"json","events":["report.ready"]}'Body
| Field | Type | Description |
|---|---|---|
organizationId | string | Optional. If you send it, it must be your key's own workspace. |
brandId | string or null | Optional brand ID to scope this webhook to a single brand; null targets all brands in the organization. A key limited to some brands must name one of them here. |
name required | string | Display name for the webhook. Between 1 and 120 characters. |
url required | string | Public HTTPS endpoint URL. An https address on a public server, up to 2,048 characters, with no username or password in it. |
preset required | "json" | "slack" | "teams" | Payload formatting preset. |
events required | ("report.ready" | "action.verdict_settled" | "visibility.alert" | "sentiment.alert" | "webhook.test")[] | Subscribed event types. At least one event. |
enabled | boolean | Whether the webhook starts enabled (defaults to true). |
Response
201 Webhook subscription created
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the webhook subscription. |
organizationId | string | Organization identifier that owns this webhook. |
brandId | string or null | Brand identifier when scoped to a single brand, or null for all brands in the organization. |
name | string | Display name for the webhook. |
url | string | HTTPS destination URL (port 443, public IP only). |
preset | "json" | "slack" | "teams" | Payload formatting preset. |
events | ("report.ready" | "action.verdict_settled" | "visibility.alert" | "sentiment.alert" | "webhook.test")[] | Subscribed event types. |
secretLastFour | string | Last four characters of the current HMAC signing secret. |
enabled | boolean | Whether the webhook receives live events. |
consecutiveFailures | integer | Consecutive terminal delivery failures since the last successful delivery or URL/enable reset. |
disabledReason | string or null | Automatic disablement reason when the circuit breaker trips, or null. |
lastFailureAt | string or null | Timestamp of the most recent terminal delivery failure, or null. |
createdByUserId | string or null | User ID of the creator when created from the dashboard. Null when the webhook was made through the API. |
createdAt | string | Timestamp when the webhook was created. |
updatedAt | string | Timestamp when the webhook was last updated. |
signingSecret | string | One-time plaintext HMAC signing secret (only returned on creation and secret rotation). |
Errors
400Invalid request data401Authentication required403The key is valid but doesn't have the access this request needs.409The workspace already has the most webhooks allowed (25).429Per-key rate limit exceeded.500Internal server error