Skip to main content

Spec Document, Graph & Share

Compose the customer-facing Spec document, derive the read-only workflow graph DAG, and create, rotate, or revoke the public share token for a Spec via API.

These endpoints surface the customer-facing views of a Spec. The document endpoint composes the Spec specification (field definitions, rules, gates, samples, and delivery) on every request so it never drifts from the live configuration. The graph endpoint derives the read-only Workflow Graph (a DAG) from the Spec rail and validation gates. The share endpoints manage a public token that exposes the composed document to people without an API key.

The composed document and the graph are configuration only. They describe how the Spec is set up: field definitions, rules, gates, and sample filenames. They never include cell values or document ids. This is what makes the share link safe to hand to a customer: the unguessable token is the authorization, and the surface behind it carries no extracted data.

Creating a share token when one already exists rotates it, which revokes the old link. Reading the share endpoint returns the current token, or null when there is no active link. Revoking removes the link entirely.

GET/v1/schemas/{id}/document
GET/v1/schemas/{id}/graph
GET/v1/schemas/{id}/share
POST/v1/schemas/{id}/share
DELETE/v1/schemas/{id}/share

Read the workflow graph

curl -s https://api.talonic.com/v1/schemas/a1b2c3d4-e5f6-7890-abcd-ef1234567890/graph \
  -H "Authorization: Bearer tlnc_your_api_key"

Response

The document is the composed specification. The graph is { nodes, edges }: each node carries an id, a kind (source, registry, extraction, validation, resolution, review, delivery, …), a display label, an optional sub line, and a config object tying it back to the rail (railId, phaseType, and for a validation node the validationStageId plus the targetPhases it checks). Edges carry kind: "sequence" for the main flow and kind: "outcome" for implicit branches, such as a blocking gate's fail path into a review node. A Spec with no rail set derives the graph from the default stage sequence. The share endpoints return a { token } object.

Graph fields

nodesarrayPipeline stages plus implicit branch outcomes. Each: { id, kind, label, sub?, config? }.
nodes[].configobjectRail linkage: railId, phaseType, and for validation nodes validationStageId + targetPhases; a review node carries the gateId that routes into it.
edgesarrayDirected connections: { id, from, to, kind } where kind is sequence or outcome; outcome edges add outcome ("fail") and a label.

Response (GET graph)

{
  "nodes": [
    { "id": "n0-source", "kind": "source", "label": "Source", "config": { "railId": "s-source" } },
    {
      "id": "n1-extraction",
      "kind": "extraction",
      "label": "Extraction",
      "config": { "phaseType": "extraction", "railId": "s-schema" }
    },
    {
      "id": "n2-validation",
      "kind": "validation",
      "label": "Totals must reconcile",
      "config": {
        "phaseType": "validation",
        "railId": "s-valid",
        "validationStageId": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
        "targetPhases": ["extraction"]
      }
    },
    {
      "id": "n3-review",
      "kind": "review",
      "label": "Review",
      "sub": "human queue",
      "config": { "railId": "s-valid", "gateId": "f1e2d3c4-b5a6-7890-abcd-ef1234567890" }
    }
  ],
  "edges": [
    { "id": "e0", "from": "n0-source", "to": "n1-extraction", "kind": "sequence" },
    { "id": "e1", "from": "n1-extraction", "to": "n2-validation", "kind": "sequence" },
    {
      "id": "e2",
      "from": "n2-validation",
      "to": "n3-review",
      "kind": "outcome",
      "outcome": "fail",
      "label": "fail → review"
    }
  ]
}

Response (GET / POST share)

{
  "token": "G1MxmRrMyTQBIKToCtncO7riARpT8v5S"
}

The share token is an unguessable 32-character base64url string. GET share returns { "token": null } when no link is active. DELETE share returns { "revoked": true }.

Rotating the share token (POST when one already exists) revokes the previous link. Anyone holding the old URL loses access. Distribute the new token after rotating.

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

Does the share link expose extracted data?+
No. The composed document and graph are configuration only: field definitions, rules, gates, and sample filenames. They never include cell values or document ids, so the link is safe to hand to a customer.
What happens when I create a share token that already exists?+
It rotates. The old token is revoked and a new one is issued, so any previously shared URL stops working. Distribute the new token afterward.
Why is the document recomposed on every request?+
So it never drifts from the live configuration. The endpoint reads the current Spec setup each time rather than serving a stored snapshot, meaning edits show up immediately.
How do validation gates appear in the graph?+
A gate becomes a validation node whose config carries its validationStageId and the targetPhases it checks; a blocking gate additionally derives a review node, connected by an outcome edge (kind: "outcome", outcome: "fail") showing where failing fields route. Sequence edges carry the main flow.