---
title: "Get a path from a train schedule given an infrastructure id and a train schedule id"
method: GET
path: "/train_schedules/{id}/path"
tags: ["train_schedule", "pathfinding"]
---

# Get a path from a train schedule given an infrastructure id and a train schedule id

`GET /train_schedules/{id}/path`

## Path parameters

- `id` integer, required

## Query parameters

- `infra_id` integer, required
- `exception_id` integer
- `begin_index` integer
- `end_index` integer

## Response `200`

The path

- union
  - object — A successful pathfinding result. This is also used for STDCM response.
    - `backtrack_path_items` integer[], nullable — The indexes of the path items where the train backtracks
    - `length` integer, required — Length of the path in mm
    - `path` CoreTrainPath, required — A valid train path, as returned from the pathfinding. Can be used as-is as input for other endpoints.
      - `blocks` CoreObjectRange[], required — Block ranges, in order.
        - `begin` integer, required — The beginning of the range in mm.
        - `end` integer, required — The end of the range in mm.
        - `id` string, required — The object identifier.
      - `routes` CoreObjectRange[], required — Route ranges, in order.
        - `begin` integer, required — The beginning of the range in mm.
        - `end` integer, required — The end of the range in mm.
        - `id` string, required — The object identifier.
      - `track_section_ranges` CoreTrackRange[], required — Track section ranges, in order.
        - `begin` integer, required — The beginning of the range in mm.
        - `direction` 'START_TO_STOP' | 'STOP_TO_START', required
        - `end` integer, required — The end of the range in mm.
        - `track_section` string, required — The track section identifier.
    - `path_item_positions` integer[], required — The path offset in mm of each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one is always equal to the `length` of the path in mm
    - `status` 'success', required
  - object
    - `error_type` 'invalid_path_items', required
    - `items` object[], required
      - `index` integer, required
      - `path_item` union, required — The location of a path waypoint
        - object
          - `offset` integer, required — Offset in mm
          - `track` string, required — Track section identifier
          - `type` 'track_offset', required
        - object
          - `local_track_name` string, nullable
          - `operational_point` union, required
            - object
              - …
            - object
              - …
            - object
              - …
          - `type` 'operational_point_part_reference', required
    - `failed_status` 'pathfinding_input_error', required
    - `status` 'failure', required
  - object
    - `error_type` 'not_enough_path_items', required
    - `failed_status` 'pathfinding_input_error', required
    - `status` 'failure', required
  - object
    - `error_type` 'rolling_stock_not_found', required
    - `rolling_stock_name` string, required
    - `failed_status` 'pathfinding_input_error', required
    - `status` 'failure', required
  - object
    - `error_type` 'zero_length_path', required
    - `failed_status` 'pathfinding_input_error', required
    - `status` 'failure', required
  - object
    - `error_type` 'not_found_in_blocks', required
    - `length` integer, required
    - `track_section_ranges` CoreTrackRange[], required
      - `begin` integer, required — The beginning of the range in mm.
      - `direction` 'START_TO_STOP' | 'STOP_TO_START', required
      - `end` integer, required — The end of the range in mm.
      - `track_section` string, required — The track section identifier.
    - `failed_status` 'pathfinding_not_found', required
    - `status` 'failure', required
  - object
    - `error_type` 'not_found_in_routes', required
    - `length` integer, required
    - `track_section_ranges` CoreTrackRange[], required
      - `begin` integer, required — The beginning of the range in mm.
      - `direction` 'START_TO_STOP' | 'STOP_TO_START', required
      - `end` integer, required — The end of the range in mm.
      - `track_section` string, required — The track section identifier.
    - `failed_status` 'pathfinding_not_found', required
    - `status` 'failure', required
  - object
    - `error_type` 'not_found_in_tracks', required
    - `failed_status` 'pathfinding_not_found', required
    - `status` 'failure', required
  - object
    - `error_type` 'incompatible_constraints', required
    - `incompatible_constraints` CoreIncompatibleConstraints, required
      - `incompatible_electrification_ranges` CoreIncompatibleOffsetRangeWithValue[], required
        - `range` CoreOffsetRange, required
          - `end` integer, required
          - `start` integer, required
        - `value` string, required
      - `incompatible_gauge_ranges` CoreIncompatibleOffsetRange[], required
        - `range` CoreOffsetRange, required
          - `end` integer, required
          - `start` integer, required
      - `incompatible_signaling_system_ranges` CoreIncompatibleOffsetRangeWithValue[], required
        - `range` CoreOffsetRange, required
          - `end` integer, required
          - `start` integer, required
        - `value` string, required
    - `relaxed_constraints_path` CorePathfindingResultSuccess, required — A successful pathfinding result. This is also used for STDCM response.
      - `backtrack_path_items` integer[], nullable — The indexes of the path items where the train backtracks
      - `length` integer, required — Length of the path in mm
      - `path` CoreTrainPath, required — A valid train path, as returned from the pathfinding. Can be used as-is as input for other endpoints.
        - `blocks` CoreObjectRange[], required — Block ranges, in order.
          - `begin` integer, required — The beginning of the range in mm.
          - `end` integer, required — The end of the range in mm.
          - `id` string, required — The object identifier.
        - `routes` CoreObjectRange[], required — Route ranges, in order.
          - `begin` integer, required — The beginning of the range in mm.
          - `end` integer, required — The end of the range in mm.
          - `id` string, required — The object identifier.
        - `track_section_ranges` CoreTrackRange[], required — Track section ranges, in order.
          - `begin` integer, required — The beginning of the range in mm.
          - `direction` 'START_TO_STOP' | 'STOP_TO_START', required
          - `end` integer, required — The end of the range in mm.
          - `track_section` string, required — The track section identifier.
      - `path_item_positions` integer[], required — The path offset in mm of each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one is always equal to the `length` of the path in mm
    - `failed_status` 'pathfinding_not_found', required
    - `status` 'failure', required

## Other responses

- `400` — Invalid path portion queried
- `404` — Infrastructure or Train schedule not found

---

[API](https://skmtc.net/openrailassociation/apis/osrd-editoast.md) · [All operations](https://skmtc.net/openrailassociation/apis/osrd-editoast/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrailassociation/osrd-editoast/revisions/1840dbbd64ac/schema)
