SmartGare
API referenceEndpoints

Swap a coordination departure's coach with a later departure's

The departure's programmed coach cannot run it: the partner's coach takes it and the departure's coach takes the partner, the next departure of the line unless one is named. Kept beside the programme with its cause, reason, author and instant; the programme read and the designation before departure apply it, and every other departure keeps its coach. A coach already committed to either departure is replaced by the swapped one. **Required permission:** `traffic.programme-swap:write`

POST/traffic/v1/programme-swaps

The departure's programmed coach cannot run it: the partner's coach takes it and the departure's coach takes the partner, the next departure of the line unless one is named. Kept beside the programme with its cause, reason, author and instant; the programme read and the designation before departure apply it, and every other departure keeps its coach. A coach already committed to either departure is replaced by the swapped one.

Required permission: traffic.programme-swap:write

AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*RecordProgrammeSwapRequest

Response Body

*/*

*/*

curl -X POST "https://example.com/traffic/v1/programme-swaps" \  -H "Content-Type: application/json" \  -d '{    "cause": "string",    "departure_id": "string",    "reason": "string"  }'
{  "cause": "DRIVER_ABSENT",  "commitment_ids": [    "string"  ],  "departure_authorization_id": "string",  "departure_id": "string",  "departure_vehicle_id": "string",  "id": "string",  "line_id": "string",  "partner_authorization_id": "string",  "partner_departure_id": "string",  "partner_vehicle_id": "string",  "reason": "string",  "recorded_at": "2019-08-24T14:15:22Z",  "recorded_by": "string",  "withdrawn_at": "2019-08-24T14:15:22Z",  "withdrawn_by": "string"}