Developers › API reference › Webhooks
PATCH /api/v1/webhooks/{id}
Change events, URL or status.
- Scope
webhooks:write - operationId
webhooksUpdate
The token needs the scope webhooks:write, and the person or service account behind it needs the matching privileges and account permissions, exactly as on the screens. See Scopes.
Request
PATCH /api/v1/webhooks/{id}
Path parameters
| Name | Description | Example |
|---|---|---|
id | The id of the webhook. | 2 |
Headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer <token>: an OAuth access token (vat_…) or a personal access token (vpt_…). Get a token |
Content-Type | yes | application/json |
Body: WebhookIn
| Field | Type | Required | Description |
|---|---|---|---|
url | string | no | Your HTTPS endpoint (public address). |
events | list of string | no | Event types to send. |
status | string | no | "active" or "paused". |
description | string | no | A note for you. |
rotate_secret | boolean | no | True to get a new signing secret (shown once). |
Decimals (money, prices, quantities, percentages) are sent as strings, ids as strings, times as ISO 8601 UTC.
Examples
Keep the token in an environment variable (VESTORIS_TOKEN), never in the script.
curl
curl -X PATCH "https://vestoris.com/api/v1/webhooks/2" \
-H "Authorization: Bearer $VESTORIS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"paused"}'
Python (requests)
import os, requests
r = requests.patch(
"https://vestoris.com/api/v1/webhooks/2",
headers={
"Authorization": f"Bearer {os.environ['VESTORIS_TOKEN']}",
},
json={
"status": "paused"
},
timeout=30,
)
r.raise_for_status() # errors are application/problem+json with a stable "code"
print(r.json())
JavaScript (fetch)
const res = await fetch("https://vestoris.com/api/v1/webhooks/2", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.VESTORIS_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"status": "paused"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.detail}`); // problem+json
console.log(data);
Response
200 OK, application/json: Webhook. Rate-limit headers: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset.
Response fields
| Field | Type | Description |
|---|---|---|
id | id (string) | The record's id (a string of digits). |
url | string | Your HTTPS endpoint. |
events | list of string | Event types to send (see the webhook guide). |
status | string | "active" or "paused". |
description | string | A note for you. |
failing_deliveries | integer | Deliveries currently failing. |
created_at | date-time or null | When it was created. |
last_delivery_at | date-time or null | When the last delivery was tried. |
secret | string | The new signing secret (only when rotated). |
secret_note | string | A reminder that the secret is shown once. |
Example response
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "1042",
"url": "https://hooks.example.com/vestoris",
"events": [
"fill.created",
"violation.created"
],
"status": "active",
"description": "Fills to the risk system",
"failing_deliveries": 0,
"created_at": "2026-10-27T14:30:00Z",
"last_delivery_at": null,
"secret": "text",
"secret_note": "Shown once. Store it now."
}
Example values. Your values depend on your firm's data; prices, orders and fills are simulated.
Status codes and errors
Errors are application/problem+json (RFC 9457) with a stable code to program against; the detail says what to fix. See Errors.
| Status | When | Problem codes |
|---|---|---|
| 200 | Success | |
| 400 | The request is malformed | invalid_request invalid_json |
| 401 | No token, or it is invalid or expired | invalid_token |
| 403 | The token lacks the scope, or the person or service account behind it lacks the privilege or account permission | insufficient_scope forbidden ip_not_allowed |
| 404 | Not found, or not visible to you (the API never confirms what you may not see) | not_found |
| 409 | Not possible in the current state | invalid_transition conflict |
| 422 | Validation failed (the detail says which field), or blocked | validation_failed |
| 429 | Rate limited: wait for Retry-After seconds | rate_limited |
{
"type": "https://vestoris.com/developers/errors#validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "Quantity must be greater than zero.",
"code": "validation_failed",
"instance": "/api/v1/webhooks/2"
}
On the screens
The same thing in the app is explained in: