SmartGare
API referenceEndpoints

Assign a coach to a departure

Commits a coach to a scheduled departure for the window it is held, recording the authorization it runs under and the carrier accountable under that authorization. Eligibility is the register's answer; this operation carries a refusal through rather than restating it. A caller without the planner's right commits a coach only to a departure of the current station day. **Required permission:** `traffic.vehicle-assignment:commit`

POST/traffic/v1/vehicle-assignments

Commits a coach to a scheduled departure for the window it is held, recording the authorization it runs under and the carrier accountable under that authorization. Eligibility is the register's answer; this operation carries a refusal through rather than restating it. A caller without the planner's right commits a coach only to a departure of the current station day.

Required permission: traffic.vehicle-assignment:commit

AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*AssignVehicleRequest

Response Body

*/*

*/*

curl -X POST "https://example.com/traffic/v1/vehicle-assignments" \  -H "Content-Type: application/json" \  -d '{    "originated_from": "OPERATOR",    "planned_from": "2019-08-24T14:15:22Z",    "planned_until": "2019-08-24T14:15:22Z",    "scheduled_departure_id": "string",    "vehicle_id": "string"  }'
{  "accountable_carrier_id": "string",  "assigned_at": "2019-08-24T14:15:22Z",  "assigned_by": "string",  "eligibility_rule_version_id": "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",  "reason": "string",  "scheduled_departure_id": "string",  "status": "CONFIRMED",  "vehicle_id": "string"}