Queues API reference
The Queues API creates and manages pushq queues. A queue holds tasks and decides how they are delivered: how fast (rate_limits), how failures are retried (retry), where relative task paths point and which headers are forced (target), and where permanently failed tasks go (dead_letter_queue). To put work on a queue, see the Tasks API reference.
All examples use the hosted API at https://api.pushqueue.dev and an API key in $PUSHQ_API_KEY. Self-hosted servers expose the same endpoints at their own URL.
Create an SDK client
Section titled “Create an SDK client”Every example on this page is shown in TypeScript, Python, Go, Java and .NET, plus the raw curl request. The SDK snippets assume a client named pq, created like this (see install and configure an SDK for self-hosted URLs, timeouts and other options):
import { Pushq } from "pushq";
const pq = new Pushq({ apiKey: process.env.PUSHQ_API_KEY });import osfrom pushq import Pushq, RateLimits, Retry, Target
pq = Pushq(api_key=os.environ["PUSHQ_API_KEY"])import ( "context" "os"
pushq "github.com/blissfulrays/pushq/sdks/go")
pq := pushq.New("", os.Getenv("PUSHQ_API_KEY")) // "" = https://api.pushqueue.devctx := context.Background()import io.pushq.*;
Pushq pq = Pushq.builder().apiKey(System.getenv("PUSHQ_API_KEY")).build();using Pushq;
using var pq = new PushqClient(apiKey: Environment.GetEnvironmentVariable("PUSHQ_API_KEY"));Parameter tables on this page use the JSON field names (rate_limits.max_dispatches_per_second). The SDKs use their language’s casing for the same fields: camelCase in TypeScript and Java (maxDispatchesPerSecond), snake_case in Python, PascalCase in Go and .NET (MaxDispatchesPerSecond).
Queue API permissions
Section titled “Queue API permissions”| Endpoint | Writer API key | Admin API key | Dashboard roles |
|---|---|---|---|
| Create, upsert, patch, pause, resume, purge | yes | yes | member, admin |
| Get a queue, get stats | yes | yes | viewer, member, admin |
| List queues | no | yes | viewer, member, admin |
| Delete a queue | no | yes | member, admin |
A request without valid credentials gets 401 unauthenticated; a key or role that lacks the permission gets 403 permission_denied. On the hosted service each team has its own queue namespace: two teams can both have a queue called emails and never see each other’s.
Queue names and folders
Section titled “Queue names and folders”A queue name is 1–200 characters made of /-separated segments. Each segment starts with a lowercase letter or digit and contains only a-z, 0-9 and - (regex ^[a-z0-9][a-z0-9-]*(/[a-z0-9][a-z0-9-]*)*$). Folders have no configuration of their own; they exist as long as some queue name uses them.
Pass folder names to the SDKs as-is; they URL-encode the name as one path segment for you:
await pq.upsertQueue("user/instagram", { target: { baseUrl: "https://api.example.com" } });await pq.createTask("user/instagram", { path: "/sync", jsonBody: { user_id: 42 } });pq.upsert_queue("user/instagram", target=Target(base_url="https://api.example.com"))pq.create_task("user/instagram", path="/sync", json_body={"user_id": 42})_, err := pq.UpsertQueue(ctx, "user/instagram", pushq.QueueConfig{ Target: &pushq.Target{BaseURL: "https://api.example.com"},})_, err = pq.CreateTask(ctx, "user/instagram", pushq.TaskCreate{ Path: "/sync", JSONBody: map[string]any{"user_id": 42},})pq.upsertQueue("user/instagram", QueueConfig.builder() .target(Target.builder().baseUrl("https://api.example.com").build()) .build());pq.createTask("user/instagram", TaskCreate.builder() .path("/sync") .jsonBody(Map.of("user_id", 42)) .build());await pq.UpsertQueueAsync("user/instagram", new QueueConfig{ Target = new Target { BaseUrl = "https://api.example.com" },});await pq.CreateTaskAsync("user/instagram", new TaskCreate { Path = "/sync", JsonBody = new { user_id = 42 } });curl -X PUT https://api.pushqueue.dev/v1/queues/user%2Finstagram \ -H "Authorization: Bearer $PUSHQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target":{"base_url":"https://api.example.com"}}'
curl -X POST https://api.pushqueue.dev/v1/queues/user%2Finstagram/tasks \ -H "Authorization: Bearer $PUSHQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{"path":"/sync","json_body":{"user_id":42}}'List one folder with name_prefix=user/ on list queues. For a full walkthrough, see per-tenant queues.
The queue object
Section titled “The queue object”Every endpoint on this page except delete and stats returns a queue object.
{ "name": "emails", "state": "running", "rate_limits": { "max_dispatches_per_second": 50, "max_burst_size": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "max_retry_duration_seconds": 3600, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 5 }, "target": { "base_url": "https://app.example.com", "method": "POST", "headers": { "X-Source": "pushq" }, "has_signing_secret": true }, "dead_letter_queue": "emails-dead", "purged_at": "2026-11-27T09:00:00Z", "created_at": "2026-11-20T14:02:11.512Z", "updated_at": "2026-11-28T10:15:00.12Z"}| Field | Type | Description |
|---|---|---|
name |
string | The queue name. |
state |
string | running (dispatching), paused (accepting tasks, not dispatching) or disabled (rejects new tasks and force-runs). |
rate_limits.max_dispatches_per_second |
number | Maximum rate at which tasks are started. |
rate_limits.max_burst_size |
integer | Effective token-bucket size. If you configured 0 (auto), this is the resolved value: ceil(max_dispatches_per_second) clamped to 1–500. |
rate_limits.max_concurrent_dispatches |
integer | Maximum requests in flight at once for this queue. |
retry.max_attempts |
integer | Total attempts including the first. -1 means unlimited. |
retry.max_retry_duration_seconds |
number | Time limit for retrying, measured from the first attempt. 0 means unlimited. |
retry.min_backoff_seconds |
number | Delay before the first retry. |
retry.max_backoff_seconds |
number | Upper bound on any retry delay. |
retry.max_doublings |
integer | How many times the backoff doubles before it grows linearly. |
target.base_url |
string | Base URL that relative task paths are resolved against. Omitted when not set. |
target.method |
string | HTTP method that overrides every task’s method at dispatch. Omitted when not set. |
target.headers |
object | Headers set on every dispatch; they win over task headers with the same name. Omitted when empty. |
target.has_signing_secret |
boolean | Whether deliveries are signed. The secret itself is never returned. |
dead_letter_queue |
string | Queue that receives a copy of each permanently failed task. Omitted when not set. |
purged_at |
string (RFC 3339) | Time of the last purge. Omitted if the queue was never purged. |
created_at |
string (RFC 3339) | When the queue was created. |
updated_at |
string (RFC 3339) | When its configuration or state last changed. |
For how these settings behave, see how queues work, rate limiting with queues, retry backoff and max attempts and dead-letter queues.
Queue configuration fields (rate limits, retry, target)
Section titled “Queue configuration fields (rate limits, retry, target)”The create, upsert and patch endpoints accept the same configuration fields. Ranges are enforced on the final configuration; an out-of-range value returns 400 invalid_argument naming the field.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
rate_limits.max_dispatches_per_second |
number | no | 500 |
Must be greater than 0 and at most 10000. |
rate_limits.max_burst_size |
integer | no | 0 (auto) |
0–10000. 0 derives the burst from the rate: ceil(rate) clamped to 1–500. |
rate_limits.max_concurrent_dispatches |
integer | no | 1000 |
1–10000. |
retry.max_attempts |
integer | no | 100 |
-1 (unlimited) or at least 1. Includes the first attempt. |
retry.max_retry_duration_seconds |
number | no | 0 (unlimited) |
At least 0. Measured from the first attempt. |
retry.min_backoff_seconds |
number | no | 0.1 |
At least 0. |
retry.max_backoff_seconds |
number | no | 3600 |
Must be at least min_backoff_seconds. |
retry.max_doublings |
integer | no | 16 |
0–31. |
target.base_url |
string | no | none | Absolute http or https URL. Lets tasks use a relative path instead of a full url. |
target.method |
string | no | none | One of GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS (case-insensitive; stored uppercase). Overrides each task’s method; with GET, HEAD, DELETE or OPTIONS the task body is not sent. |
target.headers |
object (string → string) | no | none | Headers added to every dispatch, overriding task headers of the same name. Names and values must be valid HTTP; Host, Content-Length, Transfer-Encoding, Connection, Keep-Alive, Upgrade, TE and Trailer are reserved. Total size of names and values at most 16 KiB. |
target.signing_secret |
string | no | none | Secret used to sign deliveries with Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature). A whsec_-prefixed secret is base64-decoded; any other string is used as raw bytes. Write-only: responses show has_signing_secret instead. "" removes it. |
dead_letter_queue |
string | no | none | Name of another queue that receives a copy of each task that fails permanently. Must follow the queue name rules and cannot be the queue itself. It does not have to exist when you set it, but it must exist when a task fails, or the copy is dropped. "" removes it. |
Create a queue
Section titled “Create a queue”POST /v1/queues
Creates a new queue and fails if the name is already taken. Use this when creating a queue should be a one-time, deliberate step (for example in a provisioning script that must notice name collisions). If you want “create it if missing, otherwise make it match this config”, use create or update a queue (upsert) instead. A new queue always starts in the running state.
Who can call it: writer or admin API key; dashboard member or admin.
Request body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string | yes | — | The queue name; see Queue name rules. |
rate_limits |
object | no | defaults below | Rate limits; see Queue configuration fields. |
rate_limits.max_dispatches_per_second |
number | no | 500 |
(0, 10000]. |
rate_limits.max_burst_size |
integer | no | 0 (auto) |
[0, 10000]. |
rate_limits.max_concurrent_dispatches |
integer | no | 1000 |
[1, 10000]. |
retry |
object | no | defaults below | Retry policy. |
retry.max_attempts |
integer | no | 100 |
-1 or ≥ 1. |
retry.max_retry_duration_seconds |
number | no | 0 |
≥ 0; 0 = unlimited. |
retry.min_backoff_seconds |
number | no | 0.1 |
≥ 0. |
retry.max_backoff_seconds |
number | no | 3600 |
≥ min_backoff_seconds. |
retry.max_doublings |
integer | no | 16 |
[0, 31]. |
target |
object | no | none | Delivery target settings. |
target.base_url |
string | no | none | Absolute http(s) URL for relative task paths. |
target.method |
string | no | none | Method override. |
target.headers |
object | no | none | Header overrides. |
target.signing_secret |
string | no | none | Signing secret (write-only). |
dead_letter_queue |
string | no | none | Dead-letter queue name. |
The request body may be at most 256 KiB.
Example
const queue = await pq.createQueue("emails", { rateLimits: { maxDispatchesPerSecond: 50, maxConcurrentDispatches: 20 }, retry: { maxAttempts: 10, minBackoffSeconds: 1, maxBackoffSeconds: 300 }, target: { baseUrl: "https://app.example.com", headers: { "X-Source": "pushq" }, signingSecret: process.env.PUSHQ_SIGNING_SECRET, }, deadLetterQueue: "emails-dead",});queue = pq.create_queue( "emails", rate_limits=RateLimits(max_dispatches_per_second=50, max_concurrent_dispatches=20), retry=Retry(max_attempts=10, min_backoff_seconds=1, max_backoff_seconds=300), target=Target( base_url="https://app.example.com", headers={"X-Source": "pushq"}, signing_secret=os.environ["PUSHQ_SIGNING_SECRET"], ), dead_letter_queue="emails-dead",)queue, err := pq.CreateQueue(ctx, "emails", pushq.QueueConfig{ RateLimits: &pushq.RateLimits{ MaxDispatchesPerSecond: pushq.Float64(50), MaxConcurrentDispatches: pushq.Int(20), }, Retry: &pushq.Retry{ MaxAttempts: pushq.Int(10), MinBackoffSeconds: pushq.Float64(1), MaxBackoffSeconds: pushq.Float64(300), }, Target: &pushq.Target{ BaseURL: "https://app.example.com", Headers: map[string]string{"X-Source": "pushq"}, SigningSecret: os.Getenv("PUSHQ_SIGNING_SECRET"), }, DeadLetterQueue: "emails-dead",})Queue queue = pq.createQueue("emails", QueueConfig.builder() .rateLimits(RateLimits.builder().maxDispatchesPerSecond(50).maxConcurrentDispatches(20).build()) .retry(RetryConfig.builder().maxAttempts(10).minBackoffSeconds(1).maxBackoffSeconds(300).build()) .target(Target.builder() .baseUrl("https://app.example.com") .header("X-Source", "pushq") .signingSecret(System.getenv("PUSHQ_SIGNING_SECRET")) .build()) .deadLetterQueue("emails-dead") .build());var queue = await pq.CreateQueueAsync("emails", new QueueConfig{ RateLimits = new RateLimits { MaxDispatchesPerSecond = 50, MaxConcurrentDispatches = 20 }, Retry = new RetryConfig { MaxAttempts = 10, MinBackoffSeconds = 1, MaxBackoffSeconds = 300 }, Target = new Target { BaseUrl = "https://app.example.com", Headers = new Dictionary<string, string> { ["X-Source"] = "pushq" }, SigningSecret = Environment.GetEnvironmentVariable("PUSHQ_SIGNING_SECRET"), }, DeadLetterQueue = "emails-dead",});curl -X POST https://api.pushqueue.dev/v1/queues \ -H "Authorization: Bearer $PUSHQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "emails", "rate_limits": { "max_dispatches_per_second": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "min_backoff_seconds": 1, "max_backoff_seconds": 300 }, "target": { "base_url": "https://app.example.com", "headers": { "X-Source": "pushq" }, "signing_secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw" }, "dead_letter_queue": "emails-dead" }'In Python, create_queue exists only on the synchronous Pushq client, not on AsyncPushq. To handle a taken name, catch the SDK’s error and check for the already_exists code (see error codes).
Response
201 Created with the queue object:
{ "name": "emails", "state": "running", "rate_limits": { "max_dispatches_per_second": 50, "max_burst_size": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "max_retry_duration_seconds": 0, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 16 }, "target": { "base_url": "https://app.example.com", "headers": { "X-Source": "pushq" }, "has_signing_secret": true }, "dead_letter_queue": "emails-dead", "created_at": "2026-11-28T10:15:00.12Z", "updated_at": "2026-11-28T10:15:00.12Z"}Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_argument |
Invalid JSON, invalid name, or a configuration value out of range. |
| 401 | unauthenticated |
No valid API key or session. |
| 403 | permission_denied |
The key or role can’t write (for example a viewer). |
| 409 | already_exists |
A queue with this name exists. |
| 413 | payload_too_large |
Body over 256 KiB. |
See API error codes for the error format.
Create or update a queue (upsert)
Section titled “Create or update a queue (upsert)”PUT /v1/queues/{queue}
Makes the queue’s configuration exactly match the body, creating the queue if it doesn’t exist. It is idempotent, so you can call it on every deploy or even before every enqueue. PUT never changes the queue’s state, so it can’t accidentally resume a paused queue.
Use this when your code owns the queue’s configuration and you want “declare it and move on” semantics. Every SDK’s upsert method (upsertQueue, upsert_queue, UpsertQueue, UpsertQueueAsync) calls this endpoint.
The response carries an X-Pushq-Result header: created, updated or unchanged.
Who can call it: writer or admin API key; dashboard member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
Request body
Same fields as Create a queue without name (the name comes from the path). Every field is optional; an empty body {} sets every setting to its default.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
rate_limits.max_dispatches_per_second |
number | no | 500 |
(0, 10000]. |
rate_limits.max_burst_size |
integer | no | 0 (auto) |
[0, 10000]. |
rate_limits.max_concurrent_dispatches |
integer | no | 1000 |
[1, 10000]. |
retry.max_attempts |
integer | no | 100 |
-1 or ≥ 1. |
retry.max_retry_duration_seconds |
number | no | 0 |
≥ 0; 0 = unlimited. |
retry.min_backoff_seconds |
number | no | 0.1 |
≥ 0. |
retry.max_backoff_seconds |
number | no | 3600 |
≥ min_backoff_seconds. |
retry.max_doublings |
integer | no | 16 |
[0, 31]. |
target.base_url |
string | no | none | Absolute http(s) URL. |
target.method |
string | no | none | Method override. |
target.headers |
object | no | none | Header overrides; replaces any existing set. |
target.signing_secret |
string | no | keep existing | Omit to keep the stored secret; "" to remove it; any other value replaces it. |
dead_letter_queue |
string | no | none | Dead-letter queue name. |
Example
const queue = await pq.upsertQueue("user/instagram", { rateLimits: { maxDispatchesPerSecond: 5, maxConcurrentDispatches: 2 }, retry: { maxAttempts: 5 }, target: { baseUrl: "https://worker.example.com" },});queue = pq.upsert_queue( "user/instagram", rate_limits=RateLimits(max_dispatches_per_second=5, max_concurrent_dispatches=2), retry=Retry(max_attempts=5), target=Target(base_url="https://worker.example.com"),)queue, err := pq.UpsertQueue(ctx, "user/instagram", pushq.QueueConfig{ RateLimits: &pushq.RateLimits{ MaxDispatchesPerSecond: pushq.Float64(5), MaxConcurrentDispatches: pushq.Int(2), }, Retry: &pushq.Retry{MaxAttempts: pushq.Int(5)}, Target: &pushq.Target{BaseURL: "https://worker.example.com"},})Queue queue = pq.upsertQueue("user/instagram", QueueConfig.builder() .rateLimits(RateLimits.builder().maxDispatchesPerSecond(5).maxConcurrentDispatches(2).build()) .retry(RetryConfig.builder().maxAttempts(5).build()) .target(Target.builder().baseUrl("https://worker.example.com").build()) .build());var queue = await pq.UpsertQueueAsync("user/instagram", new QueueConfig{ RateLimits = new RateLimits { MaxDispatchesPerSecond = 5, MaxConcurrentDispatches = 2 }, Retry = new RetryConfig { MaxAttempts = 5 }, Target = new Target { BaseUrl = "https://worker.example.com" },});curl -X PUT https://api.pushqueue.dev/v1/queues/user%2Finstagram \ -H "Authorization: Bearer $PUSHQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "rate_limits": { "max_dispatches_per_second": 5, "max_concurrent_dispatches": 2 }, "retry": { "max_attempts": 5 }, "target": { "base_url": "https://worker.example.com" } }'The SDKs don’t expose the X-Pushq-Result header; use curl -i or your own HTTP client if you need it. In Go, an empty Target.SigningSecret keeps the stored secret; set Target.ClearSigningSecret: true to remove it.
Response
201 Created when the queue was created, 200 OK when it existed (whether or not anything changed). The body is the queue object:
{ "name": "user/instagram", "state": "running", "rate_limits": { "max_dispatches_per_second": 5, "max_burst_size": 5, "max_concurrent_dispatches": 2 }, "retry": { "max_attempts": 5, "max_retry_duration_seconds": 0, "min_backoff_seconds": 0.1, "max_backoff_seconds": 3600, "max_doublings": 16 }, "target": { "base_url": "https://worker.example.com", "has_signing_secret": false }, "created_at": "2026-11-28T10:15:00.12Z", "updated_at": "2026-11-28T10:15:00.12Z"}| Header | Description |
|---|---|
X-Pushq-Result |
created, updated or unchanged. |
Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_argument |
Invalid JSON, invalid queue name, or a value out of range. |
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The key or role can’t write. |
| 413 | payload_too_large |
Body over 256 KiB. |
Get a queue
Section titled “Get a queue”GET /v1/queues/{queue}
Returns one queue’s current configuration and state. Use it to check how a queue is configured or whether it is paused. Writer keys can read any queue they know by name, even though they can’t list queues.
Who can call it: writer or admin API key; dashboard viewer, member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
Example
const queue = await pq.getQueue("emails");queue = pq.get_queue("emails")queue, err := pq.GetQueue(ctx, "emails")Queue queue = pq.getQueue("emails");var queue = await pq.GetQueueAsync("emails");curl https://api.pushqueue.dev/v1/queues/emails \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
200 OK with the queue object:
{ "name": "emails", "state": "paused", "rate_limits": { "max_dispatches_per_second": 50, "max_burst_size": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "max_retry_duration_seconds": 0, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 16 }, "target": { "base_url": "https://app.example.com", "headers": { "X-Source": "pushq" }, "has_signing_secret": true }, "dead_letter_queue": "emails-dead", "created_at": "2026-11-20T14:02:11.512Z", "updated_at": "2026-11-28T09:40:03.004Z"}Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The caller has no read permission (for example a SaaS user with no team selected). |
| 404 | not_found |
No queue with this name. |
List queues
Section titled “List queues”GET /v1/queues
Lists queues in name order, one page at a time. Use name_prefix to list one folder (user/). Use this for dashboards, audits or cleanup scripts. Writer keys can’t list queues; use an admin key.
Who can call it: admin API key; dashboard viewer, member or admin.
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name_prefix |
string | no | none | Only queues whose name starts with this. user/ lists the user folder. |
page_size |
integer | no | 100 |
Queues per page. Values above 1000 are capped at 1000; 0 or less means 100. |
page_token |
string | no | none | next_page_token from the previous response. |
Example
const page = await pq.listQueues({ namePrefix: "user/", pageSize: 50 });// page.items, page.nextPageTokenpage = pq.list_queues(name_prefix="user/", page_size=50)# page.items, page.next_page_tokenqueues, next, err := pq.ListQueues(ctx, pushq.ListQueuesParams{NamePrefix: "user/", PageSize: 50})QueuePage page = pq.listQueues(ListQueuesParams.builder().namePrefix("user/").pageSize(50).build());// page.getQueues(), page.getNextPageToken()var page = await pq.ListQueuesAsync(new ListQueuesOptions { NamePrefix = "user/", PageSize = 50 });// page.Items, page.NextPageTokencurl "https://api.pushqueue.dev/v1/queues?name_prefix=user/&page_size=50" \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
200 OK:
{ "queues": [ { "name": "user/instagram", "state": "running", "rate_limits": { "max_dispatches_per_second": 5, "max_burst_size": 5, "max_concurrent_dispatches": 2 }, "retry": { "max_attempts": 5, "max_retry_duration_seconds": 0, "min_backoff_seconds": 0.1, "max_backoff_seconds": 3600, "max_doublings": 16 }, "target": { "base_url": "https://worker.example.com", "has_signing_secret": false }, "created_at": "2026-11-28T10:15:00.12Z", "updated_at": "2026-11-28T10:15:00.12Z" } ], "next_page_token": "dXNlci9pbnN0YWdyYW0"}The SDKs return a page object instead of the raw JSON: items and nextPageToken in TypeScript, items and next_page_token in Python, getQueues() and getNextPageToken() in Java, Items and NextPageToken in .NET; Go returns the slice and the next token as separate values. In Python, list_queues exists only on the synchronous Pushq client.
| Field | Type | Description |
|---|---|---|
queues |
array of queue objects | This page of queues, ordered by name. Empty array when nothing matches. |
next_page_token |
string | Pass as page_token to get the next page. Omitted on the last page. |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_argument |
page_size is not an integer. |
| 400 | failed_precondition |
page_token is malformed. |
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
Writer API key, or a caller without list permission. |
Update queue settings (patch)
Section titled “Update queue settings (patch)”PATCH /v1/queues/{queue}
Changes only the fields you send and leaves everything else as it is. Use it for targeted changes such as lowering the rate during an incident, or setting state to disabled (which pause/resume can’t do). The merged result is validated before it is saved, so a patch can’t leave the queue with an invalid configuration.
Who can call it: writer or admin API key; dashboard member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
Request body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
state |
string | no | unchanged | running, paused or disabled. A disabled queue rejects new tasks and force-runs. |
rate_limits.max_dispatches_per_second |
number | no | unchanged | (0, 10000]. |
rate_limits.max_burst_size |
integer | no | unchanged | [0, 10000]; 0 = auto. |
rate_limits.max_concurrent_dispatches |
integer | no | unchanged | [1, 10000]. |
retry.max_attempts |
integer | no | unchanged | -1 or ≥ 1. |
retry.max_retry_duration_seconds |
number | no | unchanged | ≥ 0; 0 = unlimited. |
retry.min_backoff_seconds |
number | no | unchanged | ≥ 0. |
retry.max_backoff_seconds |
number | no | unchanged | ≥ min_backoff_seconds (checked against the merged config). |
retry.max_doublings |
integer | no | unchanged | [0, 31]. |
target.base_url |
string | no | unchanged | Absolute http(s) URL; "" removes it. |
target.method |
string | no | unchanged | Method override; "" removes it. |
target.headers |
object | no | unchanged | Replaces the whole header-override map; {} removes all overrides. |
target.signing_secret |
string | no | unchanged | New secret; "" removes it. |
dead_letter_queue |
string | no | unchanged | Dead-letter queue name; "" removes it. |
Example
const queue = await pq.patchQueue("emails", { rateLimits: { maxDispatchesPerSecond: 10 }, retry: { maxAttempts: 20 },});queue = pq.patch_queue( "emails", rate_limits=RateLimits(max_dispatches_per_second=10), retry=Retry(max_attempts=20),)// The last argument is the new state ("" leaves it unchanged).queue, err := pq.PatchQueue(ctx, "emails", pushq.QueueConfig{ RateLimits: &pushq.RateLimits{MaxDispatchesPerSecond: pushq.Float64(10)}, Retry: &pushq.Retry{MaxAttempts: pushq.Int(20)},}, "")Queue queue = pq.patchQueue("emails", QueuePatch.builder() .rateLimits(RateLimits.builder().maxDispatchesPerSecond(10).build()) .retry(RetryConfig.builder().maxAttempts(20).build()) .build());var queue = await pq.PatchQueueAsync("emails", new QueuePatch{ RateLimits = new RateLimits { MaxDispatchesPerSecond = 10 }, Retry = new RetryConfig { MaxAttempts = 20 },});curl -X PATCH https://api.pushqueue.dev/v1/queues/emails \ -H "Authorization: Bearer $PUSHQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "rate_limits": { "max_dispatches_per_second": 10 }, "retry": { "max_attempts": 20 } }'In Python, patch_queue exists only on the synchronous Pushq client. In Go, the fourth argument of PatchQueue sets state ("running", "paused", "disabled", or "" to leave it unchanged).
Response
200 OK with the updated queue object:
{ "name": "emails", "state": "running", "rate_limits": { "max_dispatches_per_second": 10, "max_burst_size": 10, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 20, "max_retry_duration_seconds": 0, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 16 }, "target": { "base_url": "https://app.example.com", "headers": { "X-Source": "pushq" }, "has_signing_secret": true }, "dead_letter_queue": "emails-dead", "created_at": "2026-11-20T14:02:11.512Z", "updated_at": "2026-11-28T10:20:41.88Z"}Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_argument |
Invalid JSON, unknown state, or the merged configuration is out of range. |
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The key or role can’t write. |
| 404 | not_found |
No queue with this name. |
| 413 | payload_too_large |
Body over 256 KiB. |
Delete a queue
Section titled “Delete a queue”DELETE /v1/queues/{queue}
Deletes the queue and every task in it, immediately and permanently. Use it to remove a queue you no longer need; if you only want to drop its backlog and keep the configuration, purge it instead.
Who can call it: admin API key; dashboard member or admin. Writer keys can’t delete queues.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
Example
await pq.deleteQueue("user/instagram");pq.delete_queue("user/instagram")err := pq.DeleteQueue(ctx, "user/instagram")pq.deleteQueue("user/instagram");await pq.DeleteQueueAsync("user/instagram");curl -X DELETE https://api.pushqueue.dev/v1/queues/user%2Finstagram \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
204 No Content with an empty body.
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
Writer key or viewer role. |
| 404 | not_found |
No queue with this name. |
Pause a queue
Section titled “Pause a queue”POST /v1/queues/{queue}:pause
Stops dispatching. The queue keeps accepting new tasks, but nothing is delivered until you resume it. Use it when the receiving service is down or being deployed and you want work to pile up instead of failing and burning retries. Pausing an already-paused queue is a no-op. You can still force-run individual tasks while paused.
Who can call it: writer or admin API key; dashboard member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
No request body.
Example
const queue = await pq.pauseQueue("emails");queue = pq.pause_queue("emails")queue, err := pq.PauseQueue(ctx, "emails")Queue queue = pq.pauseQueue("emails");var queue = await pq.PauseQueueAsync("emails");curl -X POST https://api.pushqueue.dev/v1/queues/emails:pause \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
200 OK with the queue object, now with "state": "paused":
{ "name": "emails", "state": "paused", "rate_limits": { "max_dispatches_per_second": 50, "max_burst_size": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "max_retry_duration_seconds": 0, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 16 }, "target": { "base_url": "https://app.example.com", "has_signing_secret": true }, "created_at": "2026-11-20T14:02:11.512Z", "updated_at": "2026-11-28T10:22:00Z"}Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 400 | failed_precondition |
The queue is disabled; a disabled queue can’t be paused. |
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The key or role can’t write. |
| 404 | not_found |
No queue with this name. |
Resume a queue
Section titled “Resume a queue”POST /v1/queues/{queue}:resume
Sets the queue back to running so due tasks start dispatching again. This also re-enables a disabled queue. Resuming a running queue is a no-op.
Who can call it: writer or admin API key; dashboard member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
No request body.
Example
const queue = await pq.resumeQueue("emails");queue = pq.resume_queue("emails")queue, err := pq.ResumeQueue(ctx, "emails")Queue queue = pq.resumeQueue("emails");var queue = await pq.ResumeQueueAsync("emails");curl -X POST https://api.pushqueue.dev/v1/queues/emails:resume \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
200 OK with the queue object, now with "state": "running":
{ "name": "emails", "state": "running", "rate_limits": { "max_dispatches_per_second": 50, "max_burst_size": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "max_retry_duration_seconds": 0, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 16 }, "target": { "base_url": "https://app.example.com", "has_signing_secret": true }, "created_at": "2026-11-20T14:02:11.512Z", "updated_at": "2026-11-28T10:30:12.448Z"}Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The key or role can’t write. |
| 404 | not_found |
No queue with this name. |
Purge a queue
Section titled “Purge a queue”POST /v1/queues/{queue}:purge
Deletes every task created up to now, in any state, and keeps the queue and its configuration. Purged tasks disappear from the API at once and are removed from storage in the background; results of attempts that were in flight are discarded, and the purged task IDs can be reused right away. Tasks created after the purge are not affected. Use it to throw away a backlog you no longer want delivered, for example after a bad deploy enqueued garbage.
Who can call it: writer or admin API key; dashboard member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
No request body.
Example
const queue = await pq.purgeQueue("emails");queue = pq.purge_queue("emails")queue, err := pq.PurgeQueue(ctx, "emails")Queue queue = pq.purgeQueue("emails");var queue = await pq.PurgeQueueAsync("emails");curl -X POST https://api.pushqueue.dev/v1/queues/emails:purge \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
202 Accepted with the queue object; purged_at is the purge watermark:
{ "name": "emails", "state": "running", "rate_limits": { "max_dispatches_per_second": 50, "max_burst_size": 50, "max_concurrent_dispatches": 20 }, "retry": { "max_attempts": 10, "max_retry_duration_seconds": 0, "min_backoff_seconds": 1, "max_backoff_seconds": 300, "max_doublings": 16 }, "target": { "base_url": "https://app.example.com", "has_signing_secret": true }, "purged_at": "2026-11-28T10:31:00Z", "created_at": "2026-11-20T14:02:11.512Z", "updated_at": "2026-11-28T10:31:00Z"}Response fields are described in The queue object.
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The key or role can’t write. |
| 404 | not_found |
No queue with this name. |
Get queue stats
Section titled “Get queue stats”GET /v1/queues/{queue}/stats
Returns live counts for the queue: how many tasks are due, running, scheduled for later, finished, and how many attempts ran and failed in the last minute and hour. Use it for monitoring and alerting (for example, alert when oldest_due_age_seconds grows, which means the queue is falling behind). Filter with id_prefix to see stats for one group of tasks if you give related tasks a common ID prefix.
Counts cover tasks still stored on the server; finished tasks are removed after their retention period (on self-hosted servers, 24 hours for succeeded and 7 days for failed by default), and purged tasks are excluded.
Who can call it: writer or admin API key; dashboard viewer, member or admin.
Path parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
queue |
string | yes | — | Queue name, URL-encoded as one segment (user%2Finstagram). |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id_prefix |
string | no | none | Only count tasks whose ID starts with this. |
Example
const stats = await pq.queueStats("emails", { idPrefix: "welcome-" });stats = pq.queue_stats("emails", id_prefix="welcome-")stats, err := pq.QueueStats(ctx, "emails", "welcome-")QueueStats stats = pq.queueStats("emails", "welcome-");var stats = await pq.GetQueueStatsAsync("emails", idPrefix: "welcome-");curl "https://api.pushqueue.dev/v1/queues/emails/stats?id_prefix=welcome-" \ -H "Authorization: Bearer $PUSHQ_API_KEY"Response
200 OK:
{ "state": "running", "pending": 42, "running": 7, "succeeded": 15320, "failed": 12, "scheduled_future": 310, "oldest_due_at": "2026-11-28T10:29:58.12Z", "oldest_due_age_seconds": 2.88, "dispatched_last_1m": 410, "errors_last_1m": 3, "dispatched_last_1h": 21877, "errors_last_1h": 96, "last_purge": "2026-11-27T09:00:00Z"}| Field | Type | Description |
|---|---|---|
state |
string | The queue’s state: running, paused or disabled. |
pending |
integer | Pending tasks that are due now or overdue. |
running |
integer | Tasks currently being delivered. |
succeeded |
integer | Succeeded tasks still retained. |
failed |
integer | Permanently failed tasks still retained. |
scheduled_future |
integer | Pending tasks scheduled for a later time. |
oldest_due_at |
string (RFC 3339) | Schedule time of the oldest due task. Omitted when nothing is due. |
oldest_due_age_seconds |
number | How long the oldest due task has been waiting. Omitted when nothing is due. |
dispatched_last_1m |
integer | Delivery attempts started in the last minute. |
errors_last_1m |
integer | Attempts in the last minute that did not get a 2xx response. |
dispatched_last_1h |
integer | Delivery attempts started in the last hour. |
errors_last_1h |
integer | Attempts in the last hour that did not get a 2xx response. |
last_purge |
string (RFC 3339) | Time of the last purge. Omitted if never purged. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthenticated |
No valid credentials. |
| 403 | permission_denied |
The caller has no read permission. |
| 404 | not_found |
No queue with this name. |
Read more
Section titled “Read more”- How queues work: states, folders and what each setting does.
- Rate limiting with queues: choose
max_dispatches_per_secondandmax_concurrent_dispatches. - Per-tenant queues: one queue per customer with folder names.
- Tasks API reference: enqueue, inspect, run and delete tasks.
- API error codes: the problem+json format and every
code.