Skip to main content

Fake Background Job & Queue API

MOCK DATA

Generate coherent queue-job fixtures with bounded attempts, retry timing, dead-letter states and queue-specific payloads.

Generated test data for fixtures and development

Base URL
/api/background-jobs
Capabilities
1 route Seedable
Last updated
July 29, 2026

GET /api/background-jobs

Live requestRuns against the public API
No key required
GET/api/background-jobs?queue=media&status=retrying&maxAttempts=5&count=8&seed=42

Request parameters

Only generate jobs and payloads for this queue.

Pin the exact queue-job lifecycle status.

Pin low, normal, high or critical priority.

Retry limit. Retrying requires at least 2; failed/deadLettered use the full limit.

Earliest creation time. With only from, to resolves 30 elapsed days later; with neither, defaults 30 UTC days before today.

Latest creation time. With only to, from resolves 30 elapsed days earlier; with neither, defaults to today's UTC end.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/background-jobs?queue=media&status=retrying&maxAttempts=5&count=8&seed=42"
const res = await fetch("https://randomapi.dev/api/background-jobs?queue=media&status=retrying&maxAttempts=5&count=8&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/background-jobs?queue=media&status=retrying&maxAttempts=5&count=8&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/background-jobs?queue=media&status=retrying&maxAttempts=5&count=8&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 6
queue enum

Only generate jobs and payloads for this queue.

allowed: email | exports | media | billing
example: queue=media
status enum

Pin the exact queue-job lifecycle status.

allowed: queued | scheduled | running | retrying | succeeded | failed | deadLettered | cancelled
example: status=retrying
priority enum

Pin low, normal, high or critical priority.

allowed: low | normal | high | critical
example: priority=high
maxAttempts int

Retry limit. Retrying requires at least 2; failed/deadLettered use the full limit.

default: 3
allowed: 1 – 8
example: maxAttempts=5
from date

Earliest creation time. With only from, to resolves 30 elapsed days later; with neither, defaults 30 UTC days before today.

example: from=2026-02-01
to date

Latest creation time. With only to, from resolves 30 elapsed days earlier; with neither, defaults to today's UTC end.

example: to=2026-02-28T23:59:59.999Z
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=id,queue
exclude list

Return all fields except these (comma-separated).

example: exclude=attempts
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 16
id string

Distinct fictional job ID.

example: job_5819cd40d202_00

queue string

email | exports | media | billing.

example: media

type string

Queue-coherent fictional worker operation.

example: resizeImage

status string

Current lifecycle status.

example: retrying

priority string

low | normal | high | critical.

example: high

payload object

Small queue/type-specific synthetic payload.

example: {"source":"https://assets.example.com/files/demo.png","width":640,"height":480}

createdAt string (ISO 8601)

Creation time inside from/to.

example: 2026-02-10T10:00:00.000Z

scheduledAt string (ISO 8601) nullable

Planned first execution; null only while merely queued.

example: 2026-02-10T10:01:00.000Z

startedAt string (ISO 8601) nullable

First attempt start, else null.

example: 2026-02-10T10:01:00.000Z

finishedAt string (ISO 8601) nullable

Terminal completion/cancellation time, else null.

example: null

attemptCount integer

Exact number of nested attempts.

example: 2

maxAttempts integer

Configured retry limit, at most eight.

example: 5

nextRetryAt string (ISO 8601) nullable

Present only for retrying jobs.

example: 2026-02-10T10:10:00.000Z

deadLetteredAt string (ISO 8601) nullable

Present only for deadLettered jobs.

example: null

error string nullable

Last failure for retrying/failed/deadLettered jobs, else null.

example: temporary dependency failure

attempts object[]

Zero to eight chronological attempts with exact outcome/date masks.

example: [{"number":1,"startedAt":"2026-02-10T10:01:00.000Z","finishedAt":"2026-02-10T10:01:02.000Z","durationMs":2000,"outcome":"failure","error":"temporary dependency failure"}]

Documented examples

Build-generated requests and complete responses
3
Retrying media jobs
GET /api/background-jobs?queue=media&status=retrying&maxAttempts=5&count=8&seed=42
{
  "data": [
    {
      "id": "job_58016cfb6a5c85ea_00",
      "queue": "media",
      "type": "resizeImage",
      "status": "retrying",
      "priority": "normal",
      "payload": {
        "source": "https://assets.example.com/files/c58cdd40fb15.png",
        "width": 640,
        "height": 480
      },
      "createdAt": "2026-07-17T12:59:21.881Z",
      "scheduledAt": "2026-07-17T13:24:43.493Z",
      "startedAt": "2026-07-17T13:24:43.493Z",
      "finishedAt": null,
      "attemptCount": 3,
      "maxAttempts": 5,
      "nextRetryAt": "2026-07-17T13:37:47.731Z",
      "deadLetteredAt": null,
      "error": "payload could not be processed",
      "attempts": [
        {
          "number": 1,
          "startedAt": "2026-07-17T13:24:43.493Z",
          "finishedAt": "2026-07-17T13:25:06.731Z",
          "durationMs": 23238,
          "outcome": "failure",
          "error": "temporary dependency failure"
        },
        {
          "number": 2,
          "startedAt": "2026-07-17T13:26:32.222Z",
          "finishedAt": "2026-07-17T13:26:34.744Z",
          "durationMs": 2522,
          "outcome": "failure",
          "error": "downstream service unavailable"
        },
        {
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Dead-lettered export jobs
GET /api/background-jobs?queue=exports&status=deadLettered&maxAttempts=3&count=5&seed=17
{
  "data": [
    {
      "id": "job_755abf24f73252bc_00",
      "queue": "exports",
      "type": "exportCsv",
      "status": "deadLettered",
      "priority": "high",
      "payload": {
        "dataset": "orders",
        "rowLimit": 4242
      },
      "createdAt": "2026-07-14T19:08:44.521Z",
      "scheduledAt": "2026-07-14T19:37:16.780Z",
      "startedAt": "2026-07-14T19:37:16.780Z",
      "finishedAt": "2026-07-14T19:41:09.421Z",
      "attemptCount": 3,
      "maxAttempts": 3,
      "nextRetryAt": null,
      "deadLetteredAt": "2026-07-14T19:41:09.421Z",
      "error": "worker execution timed out",
      "attempts": [
        {
          "number": 1,
          "startedAt": "2026-07-14T19:37:16.780Z",
          "finishedAt": "2026-07-14T19:37:29.018Z",
          "durationMs": 12238,
          "outcome": "failure",
          "error": "temporary dependency failure"
        },
        {
          "number": 2,
          "startedAt": "2026-07-14T19:38:38.814Z",
          "finishedAt": "2026-07-14T19:38:48.322Z",
          "durationMs": 9508,
          "outcome": "failure",
          "error": "worker execution timed out"
        },
        {
          "number": 3,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Successful critical jobs in February
GET /api/background-jobs?status=succeeded&priority=critical&from=2026-02-01&to=2026-02-28&count=10&seed=8
{
  "data": [
    {
      "id": "job_5a0ad10ec4981258_00",
      "queue": "exports",
      "type": "exportCsv",
      "status": "succeeded",
      "priority": "critical",
      "payload": {
        "dataset": "audit-events",
        "rowLimit": 1349
      },
      "createdAt": "2026-02-21T07:36:04.439Z",
      "scheduledAt": "2026-02-21T08:53:59.407Z",
      "startedAt": "2026-02-21T08:53:59.407Z",
      "finishedAt": "2026-02-21T08:58:06.273Z",
      "attemptCount": 3,
      "maxAttempts": 3,
      "nextRetryAt": null,
      "deadLetteredAt": null,
      "error": null,
      "attempts": [
        {
          "number": 1,
          "startedAt": "2026-02-21T08:53:59.407Z",
          "finishedAt": "2026-02-21T08:53:59.574Z",
          "durationMs": 167,
          "outcome": "failure",
          "error": "downstream service unavailable"
        },
        {
          "number": 2,
          "startedAt": "2026-02-21T08:55:26.694Z",
          "finishedAt": "2026-02-21T08:55:40.551Z",
          "durationMs": 13857,
          "outcome": "failure",
          "error": "downstream service unavailable"
        },
        {
          "number": 3,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates fictional background jobs for queue consoles, worker dashboards and retry handling. The top-level lifecycle and nested attempts are derived together: queued and scheduled jobs have no attempts, running jobs have one unfinished attempt, retrying jobs expose a future nextRetryAt, successful jobs end in one success, and failed or dead-lettered jobs exhaust maxAttempts.

queue changes both the job type and its payload. Email jobs use reserved example recipients, export jobs have bounded row limits, media jobs reference example.com assets, and billing jobs use fictional invoice IDs. status, priority, maxAttempts and the creation-time from/to window genuinely constrain every record.

Attempts are synchronous to generate, capped at eight per job and deterministically spaced with bounded backoff. This is a generic fixture model for application tests, not a Cloudflare, AWS, RabbitMQ or other queue-provider wire schema.

Use it for

  • Populate queue and worker-operation dashboards
  • Test retry, terminal failure and dead-letter UI states
  • Create stable job-attempt histories for automated tests

Frequently asked questions

Do retrying jobs include a next retry time?

Yes. A retrying job has one or more completed failed attempts, remains below maxAttempts, and exposes a later nextRetryAt.

When is a job marked dead-lettered?

Only after all maxAttempts have failed. The final attempt, top-level error, finish time and deadLetteredAt all describe the same terminal transition.

Are queue payloads internally consistent?

Yes. Each queue maps to one documented job type and payload shape, such as email to sendEmail and media to resizeImage.

Does the JSON match a particular queue vendor?

No. It is a deliberately generic mock lifecycle and does not claim compatibility with any hosted queue or broker protocol.

Standards & references