Customer Access

Silkroute
API Reference

This page is accessible to Silkroute customers only. Enter your customer ID and password to continue.

Incorrect customer ID or password. Please try again.
Having trouble logging in? Contact our support team at technical@silkroutelabs.org and we will get back to you within one business day.

Silkroute
REST API

The Silkroute API lets you trigger workflows, submit documents for extraction, and manage your organization programmatically.

Base URL https://api.silkroutelabs.org/v1

All requests must be made over HTTPS. The API returns JSON. Dates are in ISO 8601 format (UTC).


Authentication

Authenticate by passing your API key in the Authorization header as a Bearer token.

API keys are generated in Settings → API Keys. Keys are environment-scoped — sandbox keys are prefixed sk_test_, production keys sk_live_.


Errors

The API uses standard HTTP status codes. Errors return a JSON body with a code and message.

StatusMeaning
200Success
400Bad request — invalid parameters
401Unauthorized — invalid or missing API key
403Forbidden — insufficient key scope
404Not found
422Unprocessable — document extraction failed
429Rate limit exceeded
500Internal server error

Rate Limits

Rate limits are applied per API key. Limits vary by plan. When you exceed a limit the API returns HTTP 429 with a Retry-After header.

Endpoint groupLimit
Workflows600 req / min
Runs600 req / min
Extractions120 req / min
Organization60 req / min

Workflows

GET /workflows

Returns a paginated list of all workflows in your organization.

ParameterTypeDescription
limit integer Optional Number of results. Default 20, max 100.
cursor string Optional Pagination cursor from previous response.
status string Optional Filter by status: active, draft, or paused.
GET /workflows/{workflow_id}

Retrieves a single workflow by ID.

POST /workflows

Creates a new workflow. The workflow is created in draft status.

Body fieldTypeDescription
name string Required Human-readable workflow name.
trigger object Required Trigger configuration. See trigger types in Docs.
actions array Required Ordered list of action objects.
description string Optional Internal description for your team.
PATCH /workflows/{workflow_id}

Updates a workflow. Pass only the fields you want to change. To activate a workflow set status to "active".

DELETE /workflows/{workflow_id}

Permanently deletes a workflow. Active workflows must be paused before deletion. Returns HTTP 204 on success.


Runs

GET /workflows/{workflow_id}/runs

Lists all runs for a workflow, most recent first.

ParameterTypeDescription
limit integer Optional Default 50, max 200.
status string Optional success, failed, or running.
since string Optional ISO 8601 timestamp. Returns runs after this date.
GET /runs/{run_id}

Retrieves a single run including step-level logs and any extracted output.

POST /workflows/{workflow_id}/trigger

Manually triggers a workflow run. Useful for testing or one-off executions outside the configured trigger.

Body fieldTypeDescription
payload object Optional Data passed into the workflow as the trigger payload.

Extractions

POST /extract

Submits a document to the TRACE engine. Returns an extraction ID. Extractions are processed asynchronously — poll /extractions/{id} or use a webhook for the result.

Body fieldTypeDescription
file file Required Multipart file upload. PDF, PNG, JPG, TIFF, or DOCX.
schema string Required Extraction schema identifier (e.g. purchase_order_v2).
confidence_threshold number Optional Minimum field-level confidence 0.0–1.0. Default 0.75.
webhook_url string Optional URL to POST results to on completion.
GET /extractions/{extraction_id}

Retrieves an extraction result. The status field will be pending, complete, or failed.


Organization

GET /org

Returns your organization details including name, plan, and active feature flags.

GET /org/keys

Lists all API keys for your organization. Key values are redacted — only the prefix and metadata are returned.

Authentication
curl https://api.silkroutelabs.org/v1/ping \
  -H "Authorization: Bearer sk_live_xxxx"
List Workflows
curl https://api.silkroutelabs.org/v1/workflows \
  -H "Authorization: Bearer $SILKROUTE_API_KEY"
Create Workflow
curl -X POST \
  https://api.silkroutelabs.org/v1/workflows \
  -H "Authorization: Bearer $SILKROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "PO Intake",
    "trigger": {
      "type": "email_received",
      "filter": { "subject_contains": "PO" }
    },
    "actions": [
      { "type": "trace_extract",
        "schema": "purchase_order_v2" },
      { "type": "erp_create_record",
        "integration": "sap_s4hana" }
    ]
  }'
Trigger a Run
curl -X POST \
  https://api.silkroutelabs.org/v1/workflows/wf_abc123/trigger \
  -H "Authorization: Bearer $SILKROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "payload": { "source": "manual" } }'
Extract a Document
curl -X POST \
  https://api.silkroutelabs.org/v1/extract \
  -H "Authorization: Bearer $SILKROUTE_API_KEY" \
  -F "file=@invoice.pdf" \
  -F "schema=invoice_v1" \
  -F "confidence_threshold=0.8"
Example Response
{
  "id": "ext_k8fh2nxp",
  "status": "complete",
  "schema": "invoice_v1",
  "fields": {
    "vendor_name": {
      "value": "Apex Supply Co.",
      "confidence": 0.98
    },
    "invoice_total": {
      "value": 14280.00,
      "confidence": 0.96
    },
    "due_date": {
      "value": "2026-05-15",
      "confidence": 0.91
    }
  },
  "processed_at": "2026-04-24T09:12:04Z"
}