Self-host setup
# 1) Clone
git clone https://github.com/jayhickey/DispatchQ.git
cd DispatchQ/packages/server
# 2) Configure environment
cp .env.example .env
# edit .env and set DATABASE_URL
# 3) Install deps
npm install
# 4) Generate + run migrations
npx drizzle-kit generate
npm run migrate
# 5) Seed a test account
npm run seed
# 6) Start API + dispatch + cron loops
npm run dev
The API listens on http://localhost:3000 by default.
1) Create your first job
curl -X POST http://localhost:3000/v1/jobs \
-H "Authorization: Bearer eq_test_key_123456" \
-H "Content-Type: application/json" \
-d '{
"url": "https://httpbin.org/post",
"payload": { "task": "hello" },
"max_attempts": 3
}'
2) Check job result
curl http://localhost:3000/v1/jobs/<job_id> \
-H "Authorization: Bearer eq_test_key_123456"
Look for:
status/state: completed on success
response_code, response_body, duration_ms
last_error and retry metadata if delivery failed
3) Create a delayed job
curl -X POST http://localhost:3000/v1/jobs \
-H "Authorization: Bearer eq_test_key_123456" \
-H "Content-Type: application/json" \
-d '{
"url": "https://httpbin.org/post",
"delay": "5m",
"payload": { "task": "run-later" }
}'
Supported delay units: s, m, h, d (examples: 30s, 5m, 1h, 1d).
4) Create a schedule
curl -X POST http://localhost:3000/v1/schedules \
-H "Authorization: Bearer eq_test_key_123456" \
-H "Content-Type: application/json" \
-d '{
"cron_expr": "*/5 * * * *",
"timezone": "UTC",
"url": "https://httpbin.org/post",
"payload": { "source": "schedule" }
}'
Schedules create new jobs automatically. Those jobs include schedule_id so you can trace which schedule created them.
CLI quickstart
You can run DispatchQ from the command line with npx:
DISPATCHQ_API_KEY=dq_live_... npx dispatchq jobs create \
--url https://httpbin.org/post \
--payload '{"task":"hello-from-cli"}'
Check status:
DISPATCHQ_API_KEY=dq_live_... npx dispatchq jobs get <job_id>