HTTP API Reference
The monitoring API listens on 127.0.0.1:7420 by default. All responses are JSON. Write endpoints require Authorization: Bearer <token>.
Queues
GET/v2/queues
List all queues with counters.
{
"queues": [
{"name": "emails", "ready": 12, "leased": 3, "failed": 0, "done_24h": 4821}
]
}
POST/v2/queues/{name}/pause
Stop leasing new jobs from the queue. In-flight jobs finish normally.
POST/v2/queues/{name}/resume
Resume a paused queue.
Jobs
POST/v2/queues/{name}/jobs
Enqueue a job.
| Field | Type | Description |
|---|---|---|
payload | object | Arbitrary JSON passed to the handler. |
run_at | RFC 3339 | Optional scheduled time. |
max_attempts | integer | Overrides retry.max_attempts. |
unique_key | string | Deduplicate jobs with the same key for 24h. |
curl -X POST http://127.0.0.1:7420/v2/queues/emails/jobs \
-H "Authorization: Bearer $LARKSPUR_TOKEN" \
-d '{"payload":{"to":"ada@example.com"},"max_attempts":5}'
GET/v2/jobs/{id}
Fetch a job, its attempts and the last error.
POST/v2/jobs/{id}/retry
Move a failed or dead job back to the ready state.
DELETE/v2/jobs/{id}
Cancel a pending job. Leased jobs cannot be cancelled.
Workers & health
GET/v2/workers
List connected workers, their hostnames and current leases.
GET/healthz
Returns 200 OK when the store is reachable.
GET/metrics
Prometheus exposition format. Key series: larkspur_jobs_total, larkspur_job_duration_seconds, larkspur_queue_depth.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_payload | Body is not valid JSON or a field has the wrong type. |
| 401 | unauthorized | Missing or invalid bearer token. |
| 404 | not_found | Queue or job does not exist. |
| 409 | duplicate | A job with the same unique_key exists. |