Skip to content

Quick Start

This guide walks you through creating an account, getting an API key, and submitting your first task.

Sign up at asyncqueue.io/signup with your email. You will receive a magic link to verify your account. No password required.

After signing in, go to the API Keys page in your dashboard. Click Create Key and copy the key. You will only see the full key once.

Create a task that calls a public endpoint. Replace your-api-key with the key from step 2:

Terminal window
curl -X POST https://api.asyncqueue.io/v1/tasks \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"targetUrl": "https://httpbin.org/post",
"method": "POST",
"body": "{\"hello\": \"world\"}"
}'

You will receive a response with your task ID and status:

{
"task": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"targetUrl": "https://httpbin.org/post",
"method": "POST",
"maxRetries": 3,
"retryCount": 0,
"retryBackoff": "exponential",
"createdAt": "2024-01-15T10:30:00.000Z"
}
}

Poll the task status using the task ID:

Terminal window
curl https://api.asyncqueue.io/v1/tasks/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer your-api-key"

Once processed, the response includes the callback result:

{
"task": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": {
"statusCode": 200,
"body": "{\"success\": true}",
"duration": 432
},
"createdAt": "2024-01-15T10:30:00.000Z",
"completedAt": "2024-01-15T10:30:01.432Z"
}
}

Execute a task in the future using the delayUntil parameter:

Terminal window
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/send-reminder",
"delayUntil": "2024-01-16T09:00:00.000Z"
}'

The task will have status delayed until the scheduled time, then move to pending for execution.

Use a provider template to submit a task to an AI API and let AsyncQueue poll for results automatically:

Terminal window
curl -X POST https://api.asyncqueue.io/v1/tasks \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"targetUrl": "https://api.replicate.com/v1/models/stability-ai/stable-diffusion-3/predictions",
"method": "POST",
"headers": {
"Authorization": "Bearer your-replicate-token"
},
"body": "{\"input\": {\"prompt\": \"An astronaut riding a horse\"}}",
"provider": "replicate",
"onCompleteUrl": "https://your-app.com/api/image-ready"
}'

The task will start in pending status, transition to polling while AsyncQueue checks Replicate’s API for results, and complete when the image is generated. The result is delivered to your onCompleteUrl webhook.