Integrate Twyft parcel delivery directly into your application. Create shipments, track parcels in real time, and receive push notifications via webhooks.
All API requests must include a Bearer token in the Authorization header. API keys are prefixed with twft_ and can be generated from your account settings. API access must be enabled on your account by Twyft — contact us if you need it activated.
Authorization: Bearer twft_your_api_key_here
Keep your API key secret. Never expose it in client-side code or public repositories. Rotate it immediately from your account settings if you suspect it has been compromised.
https://twyft.im/api/v1All endpoints are HTTPS only. HTTP requests will be rejected.
Error response shape
{ "error": "Human-readable error message" }Create, list, and retrieve shipments programmatically.
Webhooks let Twyft push tracking events to your server in real time, eliminating the need to poll the API. Configure endpoints from your account settings.
shipment.createdA new shipment has been created.shipment.status_updatedA tracking milestone has been reached (collected, in transit, out for delivery, etc.).shipment.deliveredThe shipment has been delivered.tracking.eventAny tracking event that does not change the top-level status.webhook.testSent when you click "Send test" in the dashboard.Every delivery includes an X-Twyft-Signature header containing sha256=<hex>. Compute HMAC-SHA256 of the raw request body using your endpoint secret and compare.
const crypto = require('crypto');
function verifySignature(rawBody, secret, header) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(header)
);
}If your endpoint returns a non-2xx response or times out (10s), Twyft will retry up to 3 times with exponential backoff: 5 seconds, 30 seconds, then 2 minutes. After 3 failures the delivery is abandoned and logged.
Your endpoint should return a 2xx response as quickly as possible — process the payload asynchronously if needed. Delivery logs are visible in your webhook settings.
pendingBooking confirmed, awaiting collection or drop-off.collectedParcel collected by Twyft driver or received at drop-off.at_depotParcel arrived at Twyft depot.in_transitParcel in transit (IOM domestic: en route; IOM-UK: crossing to the UK).out_for_deliveryOut for final delivery.deliveredDelivered to recipient.failedDelivery attempt failed.cancelledBooking cancelled.Ready to integrate?
Generate your API key and start building in minutes.