Skip to content

Create Webhook

Request

Create a new webhook subscription for the specified event type.

Security
bearerAuth
Bodyapplication/jsonrequired
eventTypestringrequired

The type of event to subscribe to. Currently only PdvRequestCompleted is supported for self-service webhooks.

Value:"PdvRequestCompleted"
Example:"PdvRequestCompleted"
clientUrlstring, (uri)required

The HTTPS URL where webhook payloads will be delivered. Must be a valid HTTPS URL.

Example:"https://your-tms.example.com/webhooks/trucker-tools"
curl -i -X POST \
  https://developer.truckertools.com/_mock/apis/selfservicewebhooks/webhooks \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "eventType": "PdvRequestCompleted",
    "clientUrl": "https://your-tms.example.com/webhooks/trucker-tools"
  }'

Responses

Webhook created successfully

Headers
Locationstring

URL of the created webhook resource

Example:"/api/v1/webhooks/550e8400-e29b-41d4-a716-446655440000"
Bodyapplication/json
uuidstring, (uuid)

Unique identifier for the webhook

Example:"550e8400-e29b-41d4-a716-446655440000"
eventTypestring

The event type this webhook subscribes to

Example:"PdvRequestCompleted"
clientUrlstring

The URL where webhook payloads are delivered

Example:"https://your-tms.example.com/webhooks/trucker-tools"
isActiveboolean

Whether the webhook is currently active

Example:true
createdAtstring, (date-time)

When the webhook was created

Example:"2024-05-24T19:50:18.053Z"
Response
{ "uuid": "550e8400-e29b-41d4-a716-446655440000", "eventType": "PdvRequestCompleted", "clientUrl": "https://your-tms.example.com/webhooks/trucker-tools", "isActive": true, "createdAt": "2024-05-24T19:50:18.053Z" }