Skip to content

API reference ​

Every sopops endpoint, grouped by what you're trying to do. Paths start with /v1, and {ws} is a workspace id (each team has one).

The examples use two variables:

VariableWhatHostedSelf-hosted
SOPOPS_URLThe workspace's API URL, as Settings → Access → Tokens prints it and the SDKs read it. Calls under /v1/workspaces/{ws} start here.https://sopops.dev/api/v1/workspaces/<id>http://127.0.0.1:8484/v1/workspaces/<id>
SOPOPS_APIThe server's API root, for calls outside a workspace (/v1/auth, /v1/org, /v1/orgs, /v1/workspaces, /v1/validate, /v1/render, /v1/lint, /v1/migrate, /v1/onboarding, /v1/github).https://sopops.dev/apihttp://127.0.0.1:8484

So GET /v1/workspaces/{ws}/agents/{agent} is:

sh
curl -s -H "Authorization: Bearer $SOPOPS_TOKEN" \
  "$SOPOPS_URL/agents/copper-wok-harbor"
WhereWhat
/openapi.jsonThe OpenAPI spec: every field.
/docsTry each endpoint in a browser.
operationIdEach operation's route name (list_workspaces, get_agent, config_put_procedure), so generated clients read well. The web UI's typed client (web/src/client) is generated this way.
Everything elsePaths outside /v1, /docs and /openapi.json serve the web UI.

Pagination ​

For a collection GET such as /v1/workspaces/{ws}/review, request ?limit=50&offset=0. If the response includes X-Next-Offset, pass that value as the next request's offset and keep the same filters and limit. The final page omits the header. Rows can move between pages when the collection changes. Omitting pagination parameters keeps each endpoint's previous default.

Sessions also support cursor pagination. Pass the response body's next_cursor as the next request's cursor. For numbered pages, use offset and limit. The web app shows ten rows per page. Where a count is available, include_total=true requests the filtered total in X-Total-Count.

Pages ​

PageWhat it covers
Agents and configEditing agents, shared instructions, procedures and groups; the files behind them; stateless sop checks
ReleasesPublishing and rolling back, serving instructions when a call starts, and pushing them to ElevenLabs or Vapi
SessionsSending calls and chats to sopops, streaming, backfill, the session format, and importing a file
Checks and reviewHow sessions are checked, grouped mistakes, verdicts, suggested fixes, and reworded rules
InsightsPass rates, trends, release comparisons, A/B tests, and model spend
Teams and accessSign-in, teams and members, tokens, and a team's AI keys and models
ImportImporting agents' existing instructions, including the endpoints a coding agent calls
GitHubConnecting a repository, syncing, and the GitHub App

Authentication ​

CallerSends
Agents, webhooks, coding agentsA workspace token as Authorization: Bearer <token> (Tokens)
Everyone else, once sign-in is onA signed-in session: password, GitHub, Google or email (Sign-in)

With sign-in off, only tokens guard anything, so keep sopops on a private network. Sign-in and access lists which endpoints need what.

Errors ​

StatusBody
404, 409{"detail": "..."}
404, no such endpoint{"error": "no_such_endpoint", "detail", "nearest": [{"methods", "path", "url"}], "docs", "openapi"}
405, wrong method{"error": "method_not_allowed", "detail", "allowed_methods", "docs", "openapi"}, and an Allow header
422, request doesn't match the schema{"error": "invalid_request", "message", "detail": [{"loc", "msg", ...}], "openapi"}. message names each field to change
422 from sop{"valid": false, "issues": [...]}
429{"detail": "..."}, and a Retry-After header in seconds
500{"error": "internal_error", "detail": "..."}. Nothing in the request needs to change; session ingest is safe to resend
json
{
  "valid": false,
  "issues": [
    {
      "code": "unknown_block",
      "message": "blocks lists 'nope', which is not an instruction, SOP or group",
      "path": "agents/bayleaf-bistro.yaml",
      "severity": "error",
      "kind": "agent",
      "id": "bayleaf-bistro",
      "field": "blocks",
      "index": null,
      "text": "Lists 'nope', which isn't a shared instruction, procedure or group."
    }
  ]
}
FieldType
code, message, path, severitystringsop's own. severity is error or warning.
kindstringagent, instruction, procedure, group or settings.
idstringWhich one.
fieldstringAs the /config endpoints name it, e.g. blocks, steps.
indexintWhich entry of a list field.
textstringThe problem in plain words.

sopops is open source under Apache-2.0.