ReferenceHTTP API

API

Authenticate external automation and operate routines through the versioned Hono API.

The service API is versioned under /v1. Browser sessions use Better Auth. External automation uses a bearer API key.

Authentication

curl https://api.workonrepeat.com/v1/routines \
  -H "Authorization: Bearer $WORK_ON_REPEAT_API_KEY"

An API key is bound to exactly one project. A session can select its active project with the X-Project-Id header, which takes precedence over the wor_project cookie; the API verifies membership either way.

Create a key

Create a key from Dashboard → API keys. Its plaintext form is shown once:

wor_<prefix>_<secret>

The database stores only a SHA-256 hash. Closing the one-time dialog removes the plaintext key from the UI state.

Scopes

ScopeGrants
models:readGET /v1/models
routines:readRead routines and their runs.
routines:writeCreate, update, archive, activate, pause.
runs:readList runs and read run detail.
runs:writeStart a manual run.
connections:readRead connections and tool policies.
connections:writeCreate connections, discover tools, set policies.

New keys default to models:read, routines:read, runs:read, and runs:write. Browser sessions retain project-owner access and are not scope-limited.

Envelopes

Success
{ "data": {}, "requestId": "01J..." }
Error
{
  "error": { "code": "routine_not_found", "message": "" },
  "requestId": "01J..."
}

Endpoints

Models

MethodPathScopeNotes
GET/v1/modelsmodels:readThe live LLMGateway directory.

Organizations and projects

Session-only. An API key receives 403 session_required.

MethodPathNotes
GET/v1/organizationsOrganizations you belong to.
POST/v1/organizationsCreates the organization and its default project.
GET/v1/projectsOptional ?organizationId= filter.
POST/v1/projectsRequires owner or admin in that organization.

Routines

MethodPathScopeNotes
GET/v1/routinesroutines:readAll routines in the project.
POST/v1/routinesroutines:write201. Returns webhookSecret once when a URL is set.
GET/v1/routines/:routineIdroutines:read
PATCH/v1/routines/:routineIdroutines:writeMaterial changes return the routine to draft.
DELETE/v1/routines/:routineIdroutines:writeArchives; history is retained.
POST/v1/routines/:routineId/runruns:write202. Enqueues a manual run.
POST/v1/routines/:routineId/activateroutines:write409 successful_run_required without a proof run.
POST/v1/routines/:routineId/pauseroutines:write
GET/v1/routines/:routineId/runsruns:readRuns for one routine.

Creating or updating a routine validates the schedule against the cron parser and the model against the live directory. Tool policies must reference a saved connection — inline tools return 400 tool_policy_requires_connection.

Runs

MethodPathScopeNotes
GET/v1/runsruns:readAll runs in the project.
GET/v1/runs/:runIdruns:readFull detail: steps, usage, webhook deliveries.

Connections and tool policies

MethodPathScopeNotes
GET/v1/connectionsconnections:readEncrypted material is never returned.
POST/v1/connectionsconnections:write201. Self-managed MCP server.
DELETE/v1/connections/:connectionIdconnections:writeDeletes stored credentials and the connection.
GET/v1/connections/providersManaged providers and whether each is configured.
POST/v1/connections/oauth/:provider/startBegins an OAuth authorization.
POST/v1/connections/api-key/:providerVerifies and stores an API-key provider.
GET/v1/connections/:connectionId/accountsconnections:readLive provider accounts, e.g. Zernio.
POST/v1/routines/:routineId/connections/:connectionId/discoverconnections:writeCreates disabled tool policies.
GET/v1/routines/:routineId/toolsconnections:readTool policies for one routine.
PATCH/v1/routines/:routineId/tools/:policyIdconnections:writeRequires confirmAutomaticExecution: true to automate.

API keys

Session-only.

MethodPathNotes
GET/v1/api-keysNever returns hashes.
POST/v1/api-keys201. Returns key exactly once.
DELETE/v1/api-keys/:apiKeyIdRevokes.

Outside /v1

MethodPathNotes
GET/healthLiveness. Unauthenticated.
GET/oauth/callback/:providerThe provider redirects the browser here, so it carries a session cookie.
POST/internal/scheduler/tickX-Scheduler-Secret. For hosts driving the schedule externally. Returns 202.

Limits

Authenticated /v1 traffic is limited per credential in a fixed 60-second window. Responses include X-RateLimit-Limit and X-RateLimit-Remaining; a 429 also includes Retry-After. Request bodies are capped at 1 MB. Run execution is claimed from the durable Postgres queue and processed with bounded worker concurrency.

See Limits and quotas for every bound in one place, and Error codes for the complete list of failures.

On this page

Edit this page on GitHub