Skip to content
On this page
  1. Base path and queue keys
  2. Monitoring
  3. Queue controls
  4. Pause notes (next release)
  5. Queue migrations
  6. Cache migrations
  7. Troubleshooting

HTTP API reference

Routes, capabilities, and operation parameters exposed by @queuebert/nest.

Base path and queue keys#

Routes below are relative to /admin/queue, or your configured path plus any Nest global prefix. Replace :queue with the registered queue's statsKey (the queue name by default), URL-encoded as a path segment. All routes inherit your configured auth guards and decorators.

This reference covers the library's current 0.0.1 controller, not additional endpoints your application may implement.

Monitoring#

MethodRouteCapabilityDescription
GET/statsAlways enabledStatistics for all registered queues and available capabilities.
GET/:queue/statsAlways enabledOne queue's statistics, plus Redis stats unless disabled.
GET/:queue/metricsmetricsDetailed queue counts and processor metrics when available.
bash
curl --fail \
  -H "Authorization: Bearer $QUEUEBERT_TOKEN" \
  http://localhost:3000/admin/queue/emails/stats

Processor duration and throughput are in-process measurements, not a persisted history of all workers. Retained failed/completed counts come from BullMQ and depend on retention settings. Job-type discovery uses sampling above its configured threshold.

Queue controls#

These routes are disabled by default. Enabling them can change processing or delete data; confirm the environment and target queue before sending requests.

MethodRouteCapabilityEffect
POST/pausepausePause all configured queues.
POST/resumeresumeResume all configured queues.
POST/:queue/pausepausePause one queue.
POST/:queue/resumeresumeResume one queue.
POST/:queue/cleancleanRemove old completed and failed jobs.
POST/:queue/draindrainRemove waiting jobs.

clean accepts query parameters grace (non-negative milliseconds, default 300000) and limit (positive integer, default 10000, applied separately to completed and failed jobs). Parameters are passed in the query string, not a JSON request body. These are destructive actions, not a way to retry failed jobs or reset in-process processor statistics.

Pause notes (next release)#

Check capabilities.canPauseWithReason before offering note controls. When true, both pause routes accept an optional JSON body:

json
{ "reason": "Deploying API v2.3; waiting for health checks" }

The reason is trimmed and limited to 200 UTF-16 code units (JavaScript string length). Reposting pause updates the note without resuming; a bare POST clears the note. Queue stats include pause: { reason?, pausedAt?, source } only while paused. Resume clears the saved note. Redis keys follow the queue's configured prefix and connection, including when statsKey differs from the queue name.

workerPauses[] contains live worker-local notes with workerId, reason, pausedAt, and source: "worker". These do not change the queue-wide paused flag: other workers may still process jobs. Worker notes disappear on resume or close, or after 90 seconds without a heartbeat. They are not a durable audit log or a request to pause a restarted worker. Avoid secrets in operational notes.

Automatic resume is not supported in this release: canPauseUntil is false, and a request containing until is rejected rather than silently ignored. Older servers without canPauseWithReason should receive a bare pause request.

Queue migrations#

All migration routes require the migrations capability. See the migration guide before starting a migration.

MethodRoutePurpose
GET/migrations/queuesDiscover queues available for migration.
GET/migrationsList tracked migrations.
GET/migrations/previewPreview a source and target migration.
GET/migrations/:migrationIdInspect progress.
POST/migrations/startStart in the background and return an ID.
POST/migrations/executeExecute and wait for a result.
POST/migrations/:migrationId/pausePause the migration.
POST/migrations/:migrationId/resumeResume the migration.
POST/migrations/:migrationId/cancelCancel the migration.

Start and execute take query parameters: required sourceQueue and targetQueue (actual BullMQ names, not statsKey), plus optional sourceRedis, targetRedis, jobType, states, limit, batchSize, and delayMs. states is a comma-separated list; waiting and delayed are the defaults, failed is an explicit opt-in. Use registered Redis IDs when selecting between deployments.

Cache migrations#

Managed caches come from processors' getCacheConfigs(). All of these routes also require migrations:

MethodRoutePurpose
GET/cache/listList registered managed caches.
GET/cache/migrationsList cache migrations.
GET/cache/migrations/previewPreview a cache migration.
GET/cache/migrations/:migrationIdInspect progress.
POST/cache/migrations/startStart a cache migration.
POST/cache/migrations/:migrationId/pausePause a cache migration.
POST/cache/migrations/:migrationId/resumeResume a cache migration.
POST/cache/migrations/:migrationId/cancelCancel a cache migration.

Troubleshooting#

  • 401: Your application's guard rejected or did not receive the credentials.
  • 403: Check application authorization; your guard may forbid an authenticated user from acting.
  • 404: Check the controller path, global prefix, queue statsKey, migration ID, and endpoints allowlist. Disabled capabilities return 404. Expired or process-local migration records may no longer exist.
  • Missing duration metrics: Register an instrumented processor provider and associate it with the queue. Counts alone do not imply processor instrumentation.
  • Browser requests fail but curl works: Check CORS, HTTPS/mixed content, and the browser's access to the API host.
Queuebert

© 2026 Queuebert