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 RequestThe request body isn't valid JSON, or something failed on our side.
- 401UnauthorizedThe token is missing, expired or invalid. Sign in again.
- 422Unprocessable ContentThe request was refused.
errorsays why in one sentence, anderrorslists each reason.
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"}}