REST API reference

The base URL is https://api.pebblequeue.dev/v1 for the us region and https://eu.api.pebblequeue.dev/v1 for the eu region. Every request needs an API key in the Authorization: Bearer header and sends and receives JSON.

Push a job

POST /queues/{queue}/jobs creates a job. The body has payload (any JSON value) and optional delay_seconds, run_at, max_attempts, backoff and idempotency_key. The answer is 201 Created with the job, including its id.

curl -X POST https://api.pebblequeue.dev/v1/queues/emails/jobs \
  -H "Authorization: Bearer $PEBBLE_KEY" \
  -d '{"payload": {"to": "ana@example.com"}}'

Push jobs in a batch

POST /queues/{queue}/jobs:batch takes a jobs list with up to 100 jobs and counts as one request for rate limiting. Each job in the answer has its own status, so one bad job does not fail the batch.

Get a job

GET /jobs/{id} returns the job with its state, attempts and the last_error of the most recent failed attempt.

Cancel a job

DELETE /jobs/{id} cancels a job that is still queued. A job that is already running cannot be cancelled: the answer is 409 Conflict.

Pagination

List endpoints return at most 100 items per page. Pass the next_cursor from one answer as the cursor parameter of the next request. When next_cursor is null you have reached the last page.