---
title: "This function computes a STDCM and returns the result."
method: POST
path: "/timetable/{id}/stdcm"
tags: ["stdcm"]
---

# This function computes a STDCM and returns the result.

`POST /timetable/{id}/stdcm`

It first checks user authorization, then retrieves timetable, infrastructure,
train schedules, and rolling stock data, and runs train simulations.
The result contains the simulation output based on the train schedules
and infrastructure provided.

## Path parameters

- `id` integer, required

## Query parameters

- `infra` integer, required

## Request body

- object — An STDCM request
  - `allowed_track_sections` string[] — Set of authorized track section ids, empty means no restriction
  - `comfort` 'STANDARD' | 'AIR_CONDITIONING' | 'HEATING', required
  - `consist_schedule` ConsistSchedule, required
    - `boundaries` integer[], required — Indexes of steps where consist change occur It should not contain 0 and len(steps) and should be increasing
    - `values` ConsistConfiguration[], required — Consist configuration for each segment It should contain one more element than boundaries
      - `loading_gauge_type` 'G1' | 'G2' | 'GA' | 'GB' | 'GB1' | 'GC' | 'FR3.3' | 'FR3.3/GB/G2' | 'GLOTT'
      - `max_speed` number, double, nullable — Velocity in m·s⁻¹
      - `rolling_stock_id` integer, required
      - `speed_limit_tag` string, nullable — Train categories for speed limits
      - `total_length` number, double, nullable — Length in m
      - `total_mass` number, double, nullable — Mass in kg
      - `towed_rolling_stock_id` integer, nullable
  - `electrical_profile_set_id` integer, nullable
  - `margin` string, nullable — Can be a percentage `X%`, a time in minutes per 100 kilometer `Xmin/100km`
  - `maximum_departure_delay` integer, nullable — By how long we can shift the departure time in milliseconds Deprecated, first step data should be used instead
  - `maximum_run_time` integer, nullable — Specifies how long the total run time can be in milliseconds Deprecated, first step data should be used instead
  - `start_time` string, date-time, nullable — Deprecated, first step arrival time should be used instead
  - `steps` PathfindingItem[], required
    - `duration` integer, nullable — The stop duration in milliseconds, None if the train does not stop.
    - `location` 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
            - `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
    - `timing_data` StepTimingData
      - `arrival_time` string, date-time, required — Time at which the train should arrive at the location
      - `arrival_time_tolerance_after` integer, required — The train may arrive up to this duration after the expected arrival time
      - `arrival_time_tolerance_before` integer, required — The train may arrive up to this duration before the expected arrival time
  - `temporary_speed_limit_group_id` integer, nullable
  - `time_gap_after` integer — Margin after the train passage in milliseconds Enforces that the path used by the train should be free and available at least that many milliseconds after its passage.
  - `time_gap_before` integer — Margin before the train passage in seconds Enforces that the path used by the train should be free and available at least that many milliseconds before its passage.
  - `work_schedule_group_id` integer, nullable

## Response `200`

The simulation result

- union
  - object
    - `data` StdcmProgressionEvent, required
      - `best_travel_time` integer, required
      - `point` GeoJsonPoint, required
        - `coordinates` number[], required
        - `type` 'Point', required
    - `event` 'ongoing', required
  - object
    - `data` union, required
      - object
        - `departure_time` string, date-time, required
        - `pathfinding_result` 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.
              - …
            - `routes` CoreObjectRange[], required — Route ranges, in order.
              - …
            - `track_section_ranges` CoreTrackRange[], required — Track section ranges, in order.
              - …
          - `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
        - `simulation` SimulationResponseSuccess, required
          - `base` CoreReportTrain, required
            - `energy_consumption` number, double, required — Total energy consumption
            - `path_item_times` integer[], required — Time in ms at which the train *arrives* at each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one, the total time of the simulation (end of the path) In case multiple path items are at the same position, the stop duration of the earlier ones are added to the path item time of the next. For example, if A and B are at the same position, and A has a stop duration of 2s, then the path item time of B will be equal to the path item time of A plus 2s.
            - `positions` integer[], required — List of positions of a train Both positions (in mm) and times (in ms) must have the same length
            - `speeds` number[], required — List of speeds associated to a position
            - `times` integer[], required
          - `electrical_profiles` object, required
            - `boundaries` integer[], required — List of `n` boundaries of the ranges (block path). A boundary is a distance from the beginning of the path in mm.
            - `values` union[], required — List of `n+1` values associated to the ranges
              - …
          - `final_output` object, required — Simulation that takes into account the regularity margins and the schedule item times
            - `energy_consumption` number, double, required — Total energy consumption
            - `path_item_times` integer[], required — Time in ms at which the train *arrives* at each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one, the total time of the simulation (end of the path) In case multiple path items are at the same position, the stop duration of the earlier ones are added to the path item time of the next. For example, if A and B are at the same position, and A has a stop duration of 2s, then the path item time of B will be equal to the path item time of A plus 2s.
            - `positions` integer[], required — List of positions of a train Both positions (in mm) and times (in ms) must have the same length
            - `speeds` number[], required — List of speeds associated to a position
            - `times` integer[], required
            - `routing_requirements` CoreRoutingRequirement[], required
              - …
            - `signal_critical_positions` CoreSignalCriticalPosition[], required
              - …
            - `spacing_requirements` CoreSpacingRequirement[], required
              - …
            - `zone_updates` CoreZoneUpdate[], required
              - …
          - `mrsp` object, required — A MRSP computation result (Most Restrictive Speed Profile)
            - `boundaries` integer[], required — List of `n` boundaries of the ranges (block path). A boundary is a distance from the beginning of the path in mm.
            - `values` object[], required — List of `n+1` values associated to the ranges
              - …
          - `provisional` CoreReportTrain, required
            - `energy_consumption` number, double, required — Total energy consumption
            - `path_item_times` integer[], required — Time in ms at which the train *arrives* at each path item given as input of the pathfinding The first value is always `0` (beginning of the path) and the last one, the total time of the simulation (end of the path) In case multiple path items are at the same position, the stop duration of the earlier ones are added to the path item time of the next. For example, if A and B are at the same position, and A has a stop duration of 2s, then the path item time of B will be equal to the path item time of A plus 2s.
            - `positions` integer[], required — List of positions of a train Both positions (in mm) and times (in ms) must have the same length
            - `speeds` number[], required — List of speeds associated to a position
            - `times` integer[], required
        - `status` 'success', required
      - object
        - `status` 'path_not_found', required
      - object
        - `error` union, required
          - object
            - `base` CoreReportTrain, required
              - …
            - `electrical_profiles` object, required
              - …
            - `final_output` object, required — Simulation that takes into account the regularity margins and the schedule item times
              - …
            - `mrsp` object, required — A MRSP computation result (Most Restrictive Speed Profile)
              - …
            - `provisional` CoreReportTrain, required
              - …
            - `status` 'success', required
          - object
            - `pathfinding_failed` union, required
              - …
            - `status` 'pathfinding_failed', required
          - object
            - `core_error` InternalError, required
              - …
            - `status` 'simulation_failed', required
        - `status` 'preprocessing_simulation_error', required
      - object
        - `error` InternalError, required
          - `context` object, required
          - `message` string, required
          - `status` integer
          - `type` string, required
        - `status` 'internal_error', required
    - `event` 'completed', 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/revisions/1840dbbd64ac/schema)
