Перейти к содержимому

Webhooks

Это содержимое пока не доступно на вашем языке.

Webhooks push event notifications to your HTTP endpoint when something changes on TrucklineMP. Configure them in the Developer Console.

Webhooks complement the Public API. Use the API to poll or fetch data on demand. Use webhooks when your service should react immediately to platform changes.

  1. Open Webhooks in the Developer Console.
  2. Click Create Webhook.
  3. Enter a name, HTTPS endpoint URL, and select the events you want.
  4. Copy the signing secret when it is shown. You need it to verify deliveries.

Each webhook belongs to your developer account. You can create multiple endpoints for different environments (staging, production).

TrucklineMP sends an HTTP POST with a JSON body:

{
"event": "vtc.member_joined",
"event_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-06-30T12:00:00.000Z",
"data": {
"vtcId": 42,
"userId": "user_abc",
"role": "Driver"
}
}
HeaderDescription
Content-Typeapplication/json
X-TrucklineMP-SignatureHMAC-SHA256 signature (sha256=<hex>)
X-TrucklineMP-EventEvent type (for example vtc.member_joined)
X-TrucklineMP-DeliveryUnique delivery ID (matches event_id)

You can also attach custom headers in the webhook settings. Sensitive header names (Authorization, Cookie, and similar) are stripped from delivery logs.

Compute the expected signature over the raw request body using your webhook secret:

expected = "sha256=" + HMAC_SHA256(secret, raw_body)

Compare expected to the X-TrucklineMP-Signature header using a constant-time comparison. Reject requests with invalid signatures before processing the payload.

Example (Node.js):

import { createHmac, timingSafeEqual } from "crypto";
function verifySignature(rawBody, signatureHeader, secret) {
const expected = "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex");
if (!signatureHeader || signatureHeader.length !== expected.length) return false;
return timingSafeEqual(Buffer.from(signatureHeader), Buffer.from(expected));
}

Failed deliveries are retried automatically. Default retry delays:

AttemptDelay after failure
130 seconds
22 minutes
310 minutes

A delivery succeeds when your endpoint returns HTTP 2xx. Redirects (3xx) are treated as failures. Timeouts default to 30 seconds per attempt.

Delivery history and status are visible in the console. Use Send Test to trigger a webhook.test event against your endpoint.

Subscribe only to events your integration needs.

EventDescription
user.updatedA user’s profile was updated
user.bannedA user was banned
user.unbannedA user’s ban was removed
EventDescription
vtc.createdA new VTC was created
vtc.member_joinedA user joined a VTC
vtc.member_leftA user left a VTC
vtc.updatedVTC details were updated
EventDescription
event.createdA new event was published
event.updatedAn event was updated
event.cancelledAn event was cancelled
event.rsvpA user RSVPed to an event
EventDescription
ban.issuedA ban was issued
ban.appealedA ban appeal was filed
ban.appeal_resolvedA ban appeal was resolved
EventDescription
api.rate_limit_hitOne of your API tokens hit its rate limit
api.token_revokedAn API token was revoked
EventDescription
webhook.testManual test delivery from the console

Exact payload fields vary by event. Treat data as the event-specific object and ignore unknown fields for forward compatibility.

  • Use HTTPS in production.
  • Respond with 2xx quickly. Offload heavy work to a background queue.
  • Return 2xx only after you have accepted the payload. TrucklineMP will not retry successful deliveries.
  • Do not follow redirects on the receiving side. Redirect responses fail delivery.

Private network URLs and unsafe destinations are blocked by the platform.

VTC announcement webhooks (separate feature)

Section titled “VTC announcement webhooks (separate feature)”

VTC owners can configure Discord announcement webhooks from their VTC management panel. Those webhooks post formatted embeds to Discord when VTC events occur (member joins, applications, and similar).

Developer Console webhooks are different. They are account-level HTTP endpoints for your integration code. See VTC Announcements for the Discord-focused feature.