Reference

API reference

One REST API plus a live event stream — everything DirectStudio does, your scripts can do.


Basics

Base URL: https://api.directos.dev/api. Requests and responses are JSON; workflow definitions are validated before they are saved, so a malformed definition is rejected with a clear error instead of failing at run time.

Authenticate with authorization: Bearer <token> — either a session token from POST /auth/login or a personal API key from POST /auth/api-keys (see the Quickstart). Each route needs a minimum role: viewer < editor < admin. A missing or expired token gets 401, too low a role gets 403.

Auth

EndpointRoleDescription
POST /auth/loginpublicEmail + password → a 30-day session token.
POST /auth/logoutany roleRevoke the session behind the current token.
GET /auth/meany roleThe signed-in user and role.
POST /auth/api-keysany roleMint a personal API key — the token is returned once.
GET /auth/api-keysany roleList your API keys (no secrets).
DELETE /auth/api-keys/:idany roleRevoke one of your API keys.
GET /auth/usersadminList accounts.
POST /auth/usersadminCreate an account with a role.
PATCH /auth/users/:id/roleadminChange an account's role.
DELETE /auth/users/:idadminDelete an account.
GET /auditadminAudit trail of user, API-key and credential actions.

Workflows

EndpointRoleDescription
GET /workflowsany roleList workflow summaries.
POST /workflowseditorCreate a workflow (name + definition).
GET /workflows/:idany roleOne workflow with its definition.
PUT /workflows/:ideditorUpdate name, description, definition or the active flag — every definition change is saved as a new version.
DELETE /workflows/:ideditorDelete a workflow.
POST /workflows/:id/runeditorStart an execution; body { "input": … }. Returns { executionId } immediately.
GET /workflows/:id/versionsany roleVersion history.
GET /workflows/:id/versions/:versionany roleOne past version.
POST /workflows/:id/versions/:version/restoreeditorRoll back to a version.

Executions

EndpointRoleDescription
GET /executionsany roleRecent executions; filter with ?workflowId=.
GET /executions/:idany roleStatus, timing, per-node results and output.
POST /executions/:id/canceleditorAbort a running execution.
GET /executions/:id/pending-approvalsany roleApproval nodes currently waiting for a decision.
POST /executions/:id/nodes/:nodeId/resumeeditorApprove or reject a paused approval node — { "approved": true, "note"? }.

Webhooks & nodes

EndpointRoleDescription
POST /hooks/:pathpublicStarts every active workflow whose webhook trigger listens on the path.
GET /node-typesany roleThe node catalog — palette entries and parameter forms.
POST /node-types/testeditorDry-run a single node against a sample input.

Agents

EndpointRoleDescription
GET /agentsany roleList agents.
POST /agentseditorCreate an agent — model, instructions, tools.
GET /agents/:idany roleOne agent.
PUT /agents/:ideditorUpdate an agent.
DELETE /agents/:ideditorDelete an agent.
POST /agents/:id/runeditorRun the agent loop to completion and return the result.
GET /agents/toolsany roleNode types an agent may use as tools.
GET /agents/runsany roleRun history; filter with ?agentId=.
GET /agents/runs/:idany roleOne run, including delegated sub-runs.
GET /agents/:id/inboxany roleAn agent's message mailbox.
POST /agents/:id/messageseditorLeave a message for an agent.

Memory & knowledge bases

EndpointRoleDescription
POST /memory/:namespace/remembereditorEmbed and store a memory item.
GET /memory/:namespace/recallany roleSemantic search — ?q=&limit=
POST /memory/:namespace/summarizeeditorCompact a long namespace now.
POST /rag/:namespace/ingesteditorParse, chunk, embed and store a document.
GET /rag/:namespace/queryany roleHybrid search with cited chunks — ?q=&limit=
GET /rag/:namespace/documentsany roleDocuments in a knowledge base.

Usage & operations

EndpointRoleDescription
GET /stats/usageany roleCost, tokens and calls by model, provider and day.
GET /gateway/callsany roleRecent LLM gateway calls.
GET /gateway/cost-by-projectany roleGateway spend per client project.
GET /benchmarks/runsany rolePast model benchmark runs.
POST /benchmarks/runeditorBenchmark models on latency, cost and success.
GET /credentialsadminStored credentials — names and types, never secrets.
POST /credentialsadminStore a credential, encrypted at rest.
DELETE /credentials/:idadminDelete a credential.
GET /healthpublicLiveness probe.

Run a workflow from a script

bash
# start a run with input
curl -X POST https://api.directos.dev/api/workflows/<workflow-id>/run \
  -H "authorization: Bearer $DIRECTOS_KEY" \
  -H 'content-type: application/json' \
  -d '{"input": {"customerId": 42}}'
# → {"executionId": "<execution-id>"}

# poll the result
curl https://api.directos.dev/api/executions/<execution-id> \
  -H "authorization: Bearer $DIRECTOS_KEY"

A workflow’s id is in its editor URL (/workflows/<id>). Execution status is one of queued, running, success, failed or canceled.

Live events

The API also exposes a socket.io namespace, /events. Each execution streams into the room execution:{id}: execution.started, node.started / finished / failed / skipped / log and execution.finished. This is what DirectStudio’s live node statuses consume — the final snapshot is also persisted, so polling GET /executions/:id works without a socket.