Dispatch
1.x
Docs/Dispatch/Admin API
Open

Reading1 min
Updated31 Jul 2026
Sourcev1/subsystems/admin-api.mdx

The api package provides a Forge-style RESTful HTTP API for managing all Dispatch entities. Routes are prefixed at /v1 by default.

Setup01

import "github.com/xraph/dispatch/api"

mux := http.NewServeMux()
api.RegisterRoutes(mux, eng)

log.Fatal(http.ListenAndServe(":8080", mux))

When using the Forge extension, routes are registered automatically under the configured BasePath (default: /api/dispatch).

Routes02

Jobs

MethodPathDescription
GET/v1/jobsList jobs
GET/v1/jobs/:jobIdGet job by ID
POST/v1/jobs/:jobId/cancelCancel a pending job
GET/v1/jobs/countsJob counts by state

Workflows

MethodPathDescription
GET/v1/workflowsList workflow definitions
GET/v1/workflows/runsList workflow runs
GET/v1/workflows/runs/:runIdGet a workflow run

Crons

MethodPathDescription
GET/v1/cronsList cron entries
GET/v1/crons/:cronIdGet cron entry
POST/v1/crons/:cronId/enableEnable a cron entry
POST/v1/crons/:cronId/disableDisable a cron entry
DELETE/v1/crons/:cronIdDelete a cron entry

DLQ

MethodPathDescription
GET/v1/dlqList DLQ entries
GET/v1/dlq/:entryIdGet a DLQ entry
POST/v1/dlq/:entryId/replayReplay a single entry
POST/v1/dlq/purgePurge all DLQ entries
GET/v1/dlq/countDLQ entry count

Stats

MethodPathDescription
GET/v1/statsSystem-wide statistics

Error responses03

All errors return JSON:

{"error": "job not found"}