cargopanel logocargopanel for developers

Create Webhook

POSThttps://api.cargopanel.co/v1/webhooks

Register an HTTPS endpoint that will receive shipment events for the shipments of your account. The webhook is bound to the API key used to create it. A signing secret is generated server-side.

Important: The secret is returned only once, in this response. Store it securely — it is required to verify the X-Cargopanel-Signature header. If you lose it, rotate it with POST /v1/webhooks/:id/rotate-secret.

Request Fields

urlstringrequired

Public HTTPS URL (max 2048 chars). URLs that resolve to localhost, private networks, link-local / cloud metadata addresses or that contain credentials are rejected. Redirects are not followed.

eventsstring[]required

One or more event types (unique):

  • shipment.measurement.adjusted
  • shipment.debt.adjusted
  • shipment.status.updated
  • shipment.created (coming soon)
  • shipment.delivered (coming soon)
  • shipment.cancelled (coming soon)
headersobjectoptional

Extra headers sent with every delivery. Only X-* headers are allowed; X-Cargopanel-*, Authorization, Host etc. are ignored.

isActivebooleanoptional

Defaults to true. Inactive webhooks receive no events.

Example Response

201
{
  "success": true,
  "data": {
    "id": "wh_k3j9x2m1q8w7e6r5t4y3u2i1",
    "userId": "usr_xyz789",
    "apiKeyId": "ck_live_abc123",
    "url": "https://example.com/webhooks/cargopanel",
    "events": [
      "shipment.measurement.adjusted",
      "shipment.debt.adjusted"
    ],
    "headers": {
      "X-Tenant": "store-42"
    },
    "isActive": true,
    "deletedAt": null,
    "hasSecret": true,
    "createdAt": "2026-11-10T10:30:00.000Z",
    "secret": "whsec_9f8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a39281706f5e4d3c2b1a0",
    "_warning": "Secret yalnızca bir kez gösterilir. İmza doğrulaması için güvenli bir yerde saklayın."
  }
}

Responses

201Webhook created
400Invalid body, unsupported event or URL not allowed
401Unauthorized (invalid or missing token)
429Too many requests (20/min)