SmartGare
API referenceEndpoints

Replace a departure's coach

Moves the departure to another coach under a controlled reason, a breakdown among them. The commitment that stood is ended and readable as it was; the one that now stands is a new record over the same window, under the authorization settled afresh for the replacing coach. A caller without the planner's right replaces a coach only on a departure of the current station day. **Required permission:** `traffic.vehicle-assignment:commit`

POST/traffic/v1/vehicle-assignments/{id}/replacement

Moves the departure to another coach under a controlled reason, a breakdown among them. The commitment that stood is ended and readable as it was; the one that now stands is a new record over the same window, under the authorization settled afresh for the replacing coach. A caller without the planner's right replaces a coach only on a departure of the current station day.

Required permission: traffic.vehicle-assignment:commit

AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*ReplaceVehicleRequest

Response Body

*/*

*/*

curl -X POST "https://example.com/traffic/v1/vehicle-assignments/string/replacement" \  -H "Content-Type: application/json" \  -d '{    "reason": "string",    "vehicle_id": "string"  }'
{  "accountable_carrier_id": "string",  "assigned_at": "2019-08-24T14:15:22Z",  "assigned_by": "string",  "grant_id": "string",  "grant_number": "string",  "id": "string",  "originated_from": "OPERATOR",  "planned_from": "2019-08-24T14:15:22Z",  "planned_until": "2019-08-24T14:15:22Z",  "previous_vehicle_id": "string",  "replaced_assignment_id": "string",  "replacement_reason": "BREAKDOWN",  "scheduled_departure_id": "string",  "status": "CONFIRMED",  "subcontracted_from_carrier_id": "string",  "vehicle_id": "string"}