/legs/{legId}/actions

Execute an action on a leg. Three actions are supported, discriminated on type.

The two recovery actions are gated differently — retry on the LEG's state, return on the LOAD's:

  • retry reopens a load-failure Failed leg for a fresh delivery attempt: every load on the leg re-runs (its load stays with the leg, the failed status clears, and the shipment un-fails so the cargo can be routed onto a new tour). An optional re-attempt delivery window may be supplied. Because the whole leg re-runs, retry is illegal on a Delivered leg with a partial failure (one load failed while a sibling delivered) — recover that load via return instead.
  • return sends one recoverable failed load back to a chosen destination. It spawns a new return shipment that picks the load up at its current custody position and delivers it to the target; the original load is retired and linked to the return shipment so it is never planned again. It is legal wherever a load needs recovery: on a load-failure Failed leg, on a Delivered leg with a partial failure, and on a Cancelled leg holding cargo a completed predecessor stranded at a hub.

The metadata action is legal in any leg state:

  • set-properties merges tenant-defined custom-property values into the leg's existing properties (a null value clears that property; absent keys are left untouched). It has no effect on the leg's lifecycle. Values are validated against the property definitions scoped to leg; unknown ids or type mismatches are rejected with 400.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The ID of the leg to act on.

Body Params

The action to execute, discriminated on type (retry, return, or set-properties).

string
enum
required

Reopen a failed leg for a fresh attempt.

Allowed:
string
length ≤ 2000

Free-text note recorded in the leg's history explaining why the leg is being retried. Not shown on the leg itself.

integer
0 to 9007199254740991

Optional earliest delivery time for the reopened leg's dropoff, as epoch seconds.

integer
0 to 9007199254740991

Optional latest delivery time for the reopened leg's dropoff, as epoch seconds. Must not be earlier than dropoffTimeFrom.

Responses

400

Bad request - the leg is not in a recoverable failed state (recovery actions), the referenced load is not a recoverable failed load, a custom-property value fails validation (set-properties), or the action payload is invalid.

401

Unauthorized - invalid or missing API key.

403

Forbidden - the API key is not permitted to modify this shipment.

404

Leg not found.

409

Conflict - the shipment changed concurrently. Reload the latest version and retry.

503

A routing dependency is temporarily unavailable while materialising the return shipment's route - retry (return only).

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json