Queues
Queues are logical groupings for your tasks. Each queue can have its own concurrency, retry, and timeout settings.
Create a queue
Section titled “Create a queue”POST /v1/queuesRequest body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique queue name (alphanumeric and hyphens) |
concurrency | integer | No | Max concurrent task executions (default: 5) |
max_retries | integer | No | Retry attempts on failure (default: 3) |
retry_backoff | string | No | Backoff strategy: fixed, exponential (default: exponential) |
timeout | integer | No | Webhook timeout in seconds (default: 30) |
Example
Section titled “Example”curl -X POST https://api.asyncqueue.io/v1/queues \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "email-notifications", "concurrency": 10, "max_retries": 5, "retry_backoff": "exponential", "timeout": 60 }'List queues
Section titled “List queues”GET /v1/queuesReturns all queues for the authenticated team.
Get queue details
Section titled “Get queue details”GET /v1/queues/:queue_nameReturns queue configuration and current statistics:
{ "name": "email-notifications", "concurrency": 10, "max_retries": 5, "retry_backoff": "exponential", "timeout": 60, "stats": { "pending": 42, "active": 3, "completed": 15890, "failed": 12 }}Update a queue
Section titled “Update a queue”PATCH /v1/queues/:queue_nameUpdate queue settings. Changes apply to new tasks only - tasks already in the queue retain the settings that were active when they were created.
Pause and resume
Section titled “Pause and resume”POST /v1/queues/:queue_name/pausePOST /v1/queues/:queue_name/resumePausing a queue stops new task executions. Tasks already being executed will complete normally. New tasks can still be added to a paused queue.
Delete a queue
Section titled “Delete a queue”DELETE /v1/queues/:queue_nameDeletes a queue and all its pending tasks. Active tasks will complete normally. This action is irreversible.