---
title: "Compute a pathfinding"
method: POST
path: "/infra/{infra_id}/pathfinding/blocks"
tags: ["pathfinding"]
---

# Compute a pathfinding

`POST /infra/{infra_id}/pathfinding/blocks`

## Path parameters

- `infra_id` integer, required

## Request body

- PathfindingInput — Path input is described by some rolling stock information and a list of path waypoints
  - `allowed_track_sections` string[] — Set of authorized track section ids, empty means no restriction
  - `path_items` PathItemLocation[], required — List of waypoints given to the pathfinding
    - union — 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
            - `operational_point` string, required — The object id of an operational point
            - `type` 'id', required
          - object
            - `country_code` string, required
            - `main_code` string, required — The operational point main code
            - `secondary_code` string, nullable — An optional secondary code to identify a more specific location
            - `type` 'domestic', required
          - object
            - `secondary_code` string, nullable — An optional secondary code to identify a more specific location
            - `type` 'uic', required
            - `uic` integer, required — The [UIC](https://en.wikipedia.org/wiki/List_of_UIC_country_codes) code of an operational point
        - `type` 'operational_point_part_reference', required
  - `rolling_stock_is_thermal` boolean, required — Can the rolling stock run on non-electrified tracks
  - `rolling_stock_length` integer, required — Rolling stock length in millimeters
  - `rolling_stock_loading_gauge` 'G1' | 'G2' | 'GA' | 'GB' | 'GB1' | 'GC' | 'FR3.3' | 'FR3.3/GB/G2' | 'GLOTT', required
  - `rolling_stock_maximum_speed` number, double, required — Rolling stock maximum speed
  - `rolling_stock_supported_electrifications` string[], required — List of supported electrification modes. Empty if does not support any electrification
  - `rolling_stock_supported_signaling_systems` string[], required — List of supported signaling systems
  - `speed_limit_tag` string, nullable — Speed limit tag, used to estimate the travel time
  - `stops_at_end_of_block` boolean, nullable — Stop the train at the next block-delimiting signal, staying in the same block and keeping the tail on the initial position

## Response `200`

Pathfinding Result

- 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

---

[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/versions/1840dbbd64ac/schema)
