Skip to main content

Get Rail

Read a Spec's pipeline rail with GET /v1/schemas/:id/rail: the ordered stages (source, extraction, resolution, validation, assembly) and per-stage config.

The rail is the ordered list of pipeline stages composed onto a Spec (a user_schema). It is what POST /v1/pipelines compiles and runs, so it is the prerequisite for running a Spec from the API without the UI. This endpoint returns the rail as it is stored. It reads back as an empty array until a rail has been set.

Each stage carries a type plus optional name, sub, and a per-stage json config. The compiler maps registry to transfer, schema to extraction, resolve to resolution (one phase per active policy), valid to a positional validation checkpoint, and assembly to a post-run compose. The source, deliver, reconcile, sanitize, and triage types are composition markers in the rail order.

Every stored stage also carries an id — the handle the Spec editor uses to select and reorder stages. Ids are assigned at write time when omitted (s-<type>, deduplicated), so a rail you set programmatically reads back with ids filled in even if you never sent any. Treat the read as the canonical form of what you last wrote: round-tripping the returned array back into [Set Rail](set-spec-rail) is always a legal no-op.

Read the rail before composing changes: because the PUT counterpart replaces the rail wholesale, the safe editing pattern is GET, modify the returned array, PUT it back. The read also tells you which validation checkpoints and Data Policies the Spec currently references (json.stage_ids, json.policy_ids), which you can dereference via the [validation-stages](validation-stages) and Data Policies endpoints.

GET/v1/schemas/{id}/rail

Path parameters

id*stringSpec (schema) UUID.

Get the rail

curl -H "Authorization: Bearer $TALONIC_API_KEY" \
  "https://api.talonic.com/v1/schemas/a1b2c3d4-e5f6-7890-abcd-ef1234567890/rail"

Response

Returns { "rail": [...] }, where each element is a stage object. The array reflects the stored composition order. An empty array means no rail has been set yet, in which case the Spec cannot be run until you set one.

Response fields

railarrayOrdered array of stage objects.
rail[].typestringStage kind: source, registry, schema, resolve, valid, assembly, deliver, reconcile, sanitize, triage.
rail[].idstringStage handle the Spec editor selects stages by. Assigned server-side (s-<type>, deduplicated) when omitted on write.
rail[].namestring | undefinedOptional display name for the stage.
rail[].substring | undefinedOptional sub-label for the stage.
rail[].jsonobject | undefinedPer-stage config (e.g. resolve policy_ids, valid stage_ids/target_phases, assembly grouping_field/anchor_field).

Response

{
  "rail": [
    { "type": "schema", "name": "Extraction", "id": "s-schema" },
    {
      "type": "resolve",
      "name": "Resolution",
      "id": "s-resolve",
      "json": { "policy_ids": ["b2c3d4e5-f6a7-8901-bcde-f23456789012"] }
    },
    {
      "type": "valid",
      "name": "Totals checkpoint",
      "id": "s-valid",
      "json": {
        "stage_ids": ["f1e2d3c4-b5a6-7890-abcd-ef1234567890"],
        "target_phases": ["resolve"]
      }
    }
  ]
}
The rail stores composition only; running it is a separate step. Compile and run the rail with POST /v1/pipelines followed by POST /v1/pipelines/:id/start.

Errors

Error responses

401unauthorizedMissing or invalid API key.
404not_foundNo Spec (schema) with this ID exists for your organization.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Frequently asked questions

What is the Spec rail?+
The rail is the ordered list of pipeline stages composed onto a Spec. POST /v1/pipelines compiles it into a runnable pipeline, so the rail is the prerequisite for running a Spec from the API.
What does an empty rail mean?+
No rail has been set yet. The endpoint returns `{ "rail": [] }` and the Spec cannot be run until you set a rail with PUT /v1/schemas/{id}/rail.
What stage types can appear in a rail?+
Ten types: `source`, `registry`, `schema`, `resolve`, `valid`, `assembly`, `deliver`, `reconcile`, `sanitize`, and `triage`. The compiler maps `registry`, `schema`, `resolve`, `valid`, and `assembly` to pipeline phases; the rest are composition markers in the rail order.
Why do the stages have ids I never set?+
Ids are assigned server-side at write time (`s-<type>`, deduplicated) when a stage arrives without one — the Spec editor selects and reorders stages by id, so an id-less rail would render as a dead editor. Keep the ids when you round-trip the rail; they are stable handles, not secrets.