Quick Start
This guide walks you through your first API call to the Orchestrator. By the end you'll have a line, a station on it, and a run with its work record.
Prerequisites
- An organization account on the Orchestrator
- An API key with full access permissions
Step 1: Get Your API Credentials
- Log in to your Orchestrator dashboard
- Navigate to Settings → API Keys
- Click Create new API Key
- Copy the
api-keyandapi-secretvalues
export API_KEY="al_xxxxxxxxxxxx"
export API_SECRET="xxxxxxxxxxxxxxxx"
Step 2: Create a Line
A line is one SOP. Its location decides which factory session runs its stations.
curl -X POST "https://orchestrator.assemblyline.sh/api/v1/lines" \
-H "api-key: $API_KEY" \
-H "api-secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{ "code": "EX", "name": "Example: word count", "location": "office-mac" }'
Step 3: Create a Station
curl -X POST "https://orchestrator.assemblyline.sh/api/v1/stations" \
-H "api-key: $API_KEY" \
-H "api-secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"short_code": "EX0",
"line": "EX",
"name": "intake",
"config": { "source_dir": "samples" }
}'
EX0 runs the handler your factory repo defines in src/stations/EX0__intake/station.js,
with this config. In practice you push station files with
al-orc stations push --all instead of calling the API by hand; the
factory template ships this line.
Step 4: Run It
curl -X POST "https://orchestrator.assemblyline.sh/api/v1/stations/EX0/run" \
-H "api-key: $API_KEY" \
-H "api-secret: $API_SECRET"
{ "data": { "status": "success", "work_record_id": "wr8Hn2QpLx1c", "job_id": "..." } }
The run waits in pending until a factory session at office-mac polls and claims it.
Step 5: Check the Work Record
curl "https://orchestrator.assemblyline.sh/api/v1/work-records/wr8Hn2QpLx1c" \
-H "api-key: $API_KEY" \
-H "api-secret: $API_SECRET"
The work record shows the run's status, its output, the report and any attached documents. The Orchestrator UI shows the same under Work Records.
What's Next?
- Concepts — lines, stations, workpieces and work records
- Work Record Object — statuses, retries and how a run is queued and claimed
- API Reference — every endpoint