Skip to main content
Skip to content

The developer API

Seven endpoints, five that read and two that change things, each behind a named scope, with keys you issue and rotate yourself.

The public API is small on purpose. It is not a second interface onto the whole product; it lets something you build read a workspace, and make the two decisions a person most often wants to automate: resolving an approval and setting an agent's control mode. Every endpoint is under /api/v1, and every request carries a bearer token.

Base URL

https://api.hawiagents.com/v1

The endpoints

MethodPathScope required
GET/api/v1/authNone beyond a valid key. Reports what the key can do.
GET/api/v1/workspaces/{workspaceId}workspace:read
GET/api/v1/workspaces/{workspaceId}/filesfiles:read
GET/api/v1/workspaces/{workspaceId}/control-centercontrol-center:read
GET/api/v1/workspaces/{workspaceId}/analyticsanalytics:read
POST/api/v1/workspaces/{workspaceId}/approvals/{requestId}approvals:write
POST/api/v1/workspaces/{workspaceId}/agents/{agentId}/control-modeagents:write

The two changes

Each takes a small JSON body and is safe to repeat: sending the state something is already in returns 200 with replayed: true and changes nothing.

Resolve an approval
POST /api/v1/workspaces/{workspaceId}/approvals/{requestId}
{ "resolution": "approved" }        // or "rejected"

200 { "id": "…", "status": "approved", "replayed": false }
409 { "error": "Approval already resolved." }   // it was resolved the other way first
Set an agent's control mode
POST /api/v1/workspaces/{workspaceId}/agents/{agentId}/control-mode
{ "controlMode": "guarded_control" }   // "full_control" | "guarded_control" | "human_in_the_loop"

200 { "ok": true, "replayed": false }
409 { "error": "…", "code": "reality_gate", "reason": "…" }   // loosening supervision was refused

A key with either scope still answers 403 insufficient_scope when the person who created it no longer owns the workspace, so a key made by an admin cannot use them at all. Both are logged against the key and the person it acts as.

Scopes

ScopeGrantsUsed by
workspace:readRead the workspace this key belongs to.GET /api/v1/workspaces/{workspaceId}
files:readList file metadata for that workspace.GET /api/v1/workspaces/{workspaceId}/files
control-center:readRead the workspace's agents, pending approvals and service health.GET /api/v1/workspaces/{workspaceId}/control-center
analytics:readRead usage and run figures for the workspace.GET /api/v1/workspaces/{workspaceId}/analytics
approvals:writeChanges things. Approve or reject a pending agent action, payments included.POST /api/v1/workspaces/{workspaceId}/approvals/{requestId}
agents:writeChanges things. Set how much an agent may do without asking.POST /api/v1/workspaces/{workspaceId}/agents/{agentId}/control-mode

One key, one workspace

A key is issued against a single workspace and is bound to it. Passing any other workspace identifier returns 404, whether or not that workspace exists. There is no key that spans workspaces; if you need to read two, issue two keys.