Archive Station

POST /api/v1/stations/:id/archive

Mark a station as archived. Archived stations are hidden from the default list response, blocked from execution (scheduler skips them; POST /run rejects them), and excluded from the pull --all flow of CLI tools — but every work record and supporting document stays intact. Use archive when you want to retire a station without losing audit history; use delete when the data should go too.

This endpoint exists only on the canonical /stations/* surface. There is no /stations/* alias.

Path Parameters

ParameterTypeDescription
idstringThe station's unique identifier or short_code

Example Request

curl -X POST "https://orchestrator.assemblyline.sh/api/v1/stations/st_abc123/archive" \
  -H "api-key: al_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

Response

{
  "data": {
    "id": "st_abc123",
    "archived_at": "2026-06-17T05:12:34.000Z"
  }
}

If the station is already archived, the existing archived_at is returned unchanged (idempotent).

Side Effects

The archive transition is more than a flag — it forces consistent state across related fields:

FieldEffect
archived_atSet to current timestamp
schedule_enabledForced to false (so unarchive doesn't surprise-fire the cron)
next_run_atCleared to null
Event logA station.archived entry is written
is_enabledUnchanged — independent of archive state

What Archive Blocks

  • POST /api/v1/stations/:id/run returns 400 VALIDATION_ERROR with message Station is archived
  • The scheduled-station job (checkScheduledStations) skips archived stations even if schedule_enabled were somehow true
  • GET /api/v1/stations (list) excludes archived rows unless ?include_archived=true is passed

What Archive Preserves

  • All work_records for the station — queryable via GET /api/v1/work-records?station=<id>
  • All supporting_documents attached to those work records
  • All process_watchers (notification subscriptions)
  • The station definition itself, including its config, tags, and timestamps

Reversing the Action

See Unarchive. Unarchive clears archived_at but does not re-enable the schedule — that is opted in explicitly via PUT /api/v1/stations/:id { "schedule_enabled": true }.

Errors

CodeDescription
401Invalid or missing API credentials
403API key lacks stations:edit permission
404Station not found