Skip to content

Simple REST API

AsyncQueue provides a clean REST API. One POST request creates a task. One GET request checks the result.

MethodPathDescription
POST/v1/tasksCreate a new task
GET/v1/tasksList tasks with filtering and pagination
GET/v1/tasks/:idGet a single task by ID
POST/v1/tasks/:id/cancelCancel a pending or delayed task
  • JSON everywhere - All request and response bodies use JSON
  • Bearer authentication - API key in the Authorization header
  • Consistent errors - Every error returns {"error": "message"} with an appropriate HTTP status code
  • Pagination - List endpoints return pagination metadata with total, limit, offset, and hasMore
const API_KEY = 'your-api-key';
const BASE_URL = 'https://api.asyncqueue.io';
async function createTask(taskData) {
const response = await fetch(`${BASE_URL}/v1/tasks`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(taskData)
});
return response.json();
}
const { task } = await createTask({
targetUrl: 'https://api.example.com/process',
body: JSON.stringify({ orderId: 12345 }),
maxRetries: 5
});
import requests
API_KEY = 'your-api-key'
BASE_URL = 'https://api.asyncqueue.io'
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
def create_task(task_data):
response = requests.post(
f'{BASE_URL}/v1/tasks',
headers=headers,
json=task_data
)
return response.json()
result = create_task({
'targetUrl': 'https://api.example.com/process',
'body': '{"orderId": 12345}',
'maxRetries': 5
})
Terminal window
# Create a task
curl -X POST https://api.asyncqueue.io/v1/tasks \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"targetUrl": "https://api.example.com/webhook"}'
# Check status
curl https://api.asyncqueue.io/v1/tasks/TASK_ID \
-H "Authorization: Bearer your-api-key"
# List pending tasks
curl "https://api.asyncqueue.io/v1/tasks?status=pending&limit=10" \
-H "Authorization: Bearer your-api-key"
# Cancel a task
curl -X POST https://api.asyncqueue.io/v1/tasks/TASK_ID/cancel \
-H "Authorization: Bearer your-api-key"