Create Subscription
POST
https://api.cargopanel.co/webhooks/subscriptionsCreate a new webhook subscription. A secret and token will be generated server-side and returned in the response.
Important: The secret and token are returned only once in the creation response. Store them securely.
Request Fields
urlstringrequiredThe HTTPS URL where webhook events will be delivered.
eventsstring[]requiredArray of event types to subscribe to:
shipment.status.updatedshipment.milestone.updated
headersobjectoptionalCustom headers to include in webhook deliveries. Only X-* headers are allowed.
retryPolicyobjectoptionalCustom retry policy. Fields:
maxRetries— Max number of retry attempts (default: 5)initialDelayMs— Initial delay in ms (default: 10000)backoffMultiplier— Exponential backoff multiplier (default: 2)maxDelayMs— Maximum delay in ms (default: 3600000)
Example Response
201
{
"success": true,
"data": {
"id": "sub_abc123",
"url": "https://example.com/webhooks",
"events": ["shipment.status.updated", "shipment.milestone.updated"],
"secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"token": "whtok_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"headers": {
"X-Custom-Header": "my-value"
},
"retryPolicy": {
"maxRetries": 5,
"initialDelayMs": 10000,
"backoffMultiplier": 2,
"maxDelayMs": 3600000
},
"isActive": true,
"createdAt": "2026-06-20T14:30:00.000Z"
}
}Responses
201Subscription created successfully
400Invalid request body
401Unauthorized (invalid or missing API key)
429Too many requests (rate limit: 20/min)