Skip to main content

Create a webhook

POST/client_api/v2/webhooks

Registers a URL that we send a POST to whenever one of the chosen events happens.

Parameters

  • webhookobjectRequired

    The webhook's settings.

Returns

Returns the webhook.

Errors

  • 400Bad Request
    The request body isn't valid JSON, or something failed on our side.
  • 401Unauthorized
    The token is missing, expired or invalid. Sign in again.
  • 422Unprocessable Content
    The request was refused. error says why in one sentence, and errors lists each reason.
View as Markdown
POST /client_api/v2/webhooks
1curl -X POST "https://sandbox-api.vatit-stream.com/client_api/v2/webhooks" \
2 -H "Authorization: Bearer $API_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "webhook": {
6 "target_url": "https://hooks.globaltradecorp.example/stream",
7 "events": [
8 "shipment.updated.status",
9 "shipment.updated.waybill"
10 ]
11 }
12 }'
Response
{
"webhook": {
"events": [
"shipment.updated.status",
"shipment.updated.waybill"
],
"id": 3,
"status": "active",
"target_url": "https://hooks.globaltradecorp.example/stream",
"token": "q7Vt2mX9pL4sKe8RzW1nYg"
}
}
API ExplorerSandbox

Pick a call on the right and run it. Every call goes to the sandbox, so nothing is really shipped or charged. The answer appears here.