Skip to content

API Reference

All endpoints are prefixed with {basePath}/api. The default base path is /, so endpoints are at /api/....

Queues

MethodPathDescription
GET/api/queuesList all queues (filtered by queues option if set)
GET/api/queues/:nameQueue detail: job counts and paused job names
POST/api/queues/:name/pausePause a queue or a specific job name
POST/api/queues/:name/resumeResume a queue or a specific job name
POST/api/queues/:name/drainDrain all waiting and delayed jobs
POST/api/queues/:name/cleanRemove jobs in a given state older than a grace period
POST/api/queues/:name/retryRetry all failed or completed jobs
POST/api/queues/:name/promotePromote all delayed jobs to waiting
DELETE/api/queues/:nameObliterate a queue (use ?force=true to force)

Pause / Resume Body

json
{ "jobName": "send-email" }

Omit jobName (or set to "__all__") to pause/resume the entire queue.

Clean Body

json
{ "state": "completed", "grace": 3600000 }

grace is in milliseconds. Removes jobs in the given state older than the grace period.

Retry Body

json
{ "state": "failed" }

state must be "failed" or "completed".

Jobs

MethodPathDescription
GET/api/queues/:name/jobsList jobs with pagination
POST/api/queues/:name/jobsAdd a new job
GET/api/queues/:name/jobs/:idJob detail
GET/api/queues/:name/jobs/:id/childrenList child jobs (flow)
POST/api/queues/:name/jobs/:id/retryRetry a single failed/completed job
POST/api/queues/:name/jobs/:id/promotePromote a single delayed job to waiting
POST/api/queues/:name/jobs/:id/cancelCancel an active job
PATCH/api/queues/:name/jobs/:idEdit job payload or priority
DELETE/api/queues/:name/jobs/:idRemove a job

List Jobs Query Parameters

ParameterDefaultDescription
statewaitingJob state to filter by
start0Pagination offset
end100Pagination end index (max page size: 1000)

Add Job Body

json
{
  "name": "send-email",
  "data": { "to": "[email protected]" },
  "opts": { "priority": 1, "delay": 5000 }
}

Edit Job Body

json
{
  "data": { "to": "[email protected]" },
  "opts": { "priority": 2 }
}

Cannot edit active jobs.

Groups

MethodPathDescription
GET/api/queues/:name/groupsList distinct groups with active/waiting counts

Flows

MethodPathDescription
GET/api/flowsList flow parent jobs

Query Parameters

ParameterDefaultDescription
stateallFilter by job state
MethodPathDescription
GET/api/searchSearch for jobs, queues, or payloads

Query Parameters

ParameterRequiredDescription
qyesSearch term (job ID, queue name substring, or payload text)
typeno"job" (default), "queue", or "payload"
queuefor payload searchQueue name to search within

Metrics

MethodPathDescription
GET/api/queues/:name/metricsPer-queue metrics buckets
GET/api/metrics/sparklinesBatch sparklines for all queues
GET/api/metrics/statusCheck if metrics are enabled

Metrics Query Parameters

ParameterDefaultDescription
granularityminute"minute" or "hour"
from1 hour agoISO 8601 date string
tonowISO 8601 date string

SSE Events

MethodPathDescription
GET/api/eventsSSE stream for all queues
GET/api/queues/:name/eventsSSE stream for a single queue

The SSE stream sends a connected event on connection, then real-time events as they occur.

Event Types

EventDescription
connectedInitial connection confirmation
job:waitingJob moved to waiting state
job:activeJob picked up by a worker
job:completedJob completed successfully
job:failedJob failed
job:delayedJob delayed
job:removedJob removed
job:progressJob progress updated
job:stalledJob detected as stalled
queue:pausedQueue or job name paused
queue:resumedQueue or job name resumed
queue:drainedQueue drained

SSE Client Example

typescript
const events = new EventSource('/api/events');

events.addEventListener('job:completed', (e) => {
  const event = JSON.parse(e.data);
  console.log(`Job ${event.jobId} completed in queue ${event.queueName}`);
});

events.addEventListener('job:failed', (e) => {
  const event = JSON.parse(e.data);
  console.log(`Job ${event.jobId} failed: ${event.data?.reason}`);
});

Response Format

Success (single item)

json
{
  "data": { ... }
}

Success (paginated)

json
{
  "data": [ ... ],
  "meta": {
    "total": 42,
    "start": 0,
    "end": 100
  }
}

Error

json
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "state must be \"failed\" or \"completed\""
  }
}

Common error codes: BAD_REQUEST, NOT_FOUND, FORBIDDEN (read-only mode), UNAUTHORIZED (auth failed), METRICS_DISABLED.

OpenAPI Specification

The complete OpenAPI 3.1 spec is available at /openapi.json.

You can import it into tools like Swagger Editor or Scalar for an interactive API explorer.

Released under the MIT License.