Skip to content

API Reference

The Platos platform exposes a FastAPI-powered REST + WebSocket API. This page lists every endpoint by resource group. For detailed request/response schemas, use the live OpenAPI spec.

Live OpenAPI

Start the API (docker compose up platos-api or uv run uvicorn platos.main:app --reload --app-dir apps/api) and open:

URLDescription
GET /openapi.jsonRaw OpenAPI 3.1 JSON spec.
GET /docsSwagger UI with try-it-out support.
GET /redocReDoc three-column view.

Auth model

Every org-scoped endpoint requires a JWT on the Authorization: Bearer ... header. The JWT carries org_id and user_id claims; the API filters every query by org_id server-side. Cross-tenant leaks are a critical bug.

The SDK’s WebSocket transport uses a long-lived PLATOS_SECRET (an SDK agent JWT) rather than a user JWT. The two token types are scoped separately so a leaked SDK secret can’t impersonate an end user and vice versa.

Endpoints by resource

Health

MethodPathDescription
GET/healthLiveness check.

Auth (/api/v1/auth)

MethodPathDescription
POST/api/v1/auth/registerCreate a new user + org.
POST/api/v1/auth/loginAuthenticate and receive access + refresh tokens.
POST/api/v1/auth/logoutRevoke the current session.
GET/api/v1/auth/meReturn the current user’s session status.
POST/api/v1/auth/refreshExchange a refresh token for new access + refresh tokens.

Organization (/api/v1/org)

MethodPathDescription
GET/api/v1/orgGet the current organization.
PATCH/api/v1/orgUpdate organization settings.
GET/api/v1/org/membersList org members.
POST/api/v1/org/membersInvite a new member.
PATCH/api/v1/org/members/{member_id}/roleChange a member’s role.
DELETE/api/v1/org/members/{member_id}Remove a member.
GET/api/v1/org/api-keysList API keys.
POST/api/v1/org/api-keysCreate an API key.
DELETE/api/v1/org/api-keys/{key_id}Revoke an API key.
GET/api/v1/org/sdk-connectionsList SDK connections.
POST/api/v1/org/sdk-connectionsCreate an SDK connection (generates PLATOS_SECRET).
DELETE/api/v1/org/sdk-connections/{connection_id}Revoke an SDK connection.

Agents (/api/v1/agents)

MethodPathDescription
GET/api/v1/agentsList agents in the org.
POST/api/v1/agentsCreate an agent.
GET/api/v1/agents/{agent_id}Get agent details.
PATCH/api/v1/agents/{agent_id}Update an agent.
DELETE/api/v1/agents/{agent_id}Delete an agent.
GET/api/v1/agents/{agent_id}/rate-limitsGet agent rate limits.
GET/api/v1/agents/{agent_id}/promptGet the agent’s prompt config.
POST/api/v1/agents/{agent_id}/prompt/blocksAdd a prompt block.
PATCH/api/v1/agents/{agent_id}/prompt/blocks/{block_id}Update a prompt block.
DELETE/api/v1/agents/{agent_id}/prompt/blocks/{block_id}Delete a prompt block.
PUT/api/v1/agents/{agent_id}/prompt/blocks/reorderReorder prompt blocks.
GET/api/v1/agents/{agent_id}/prompt/previewPreview the assembled prompt.
GET/api/v1/agents/{agent_id}/prompt/versionsList prompt versions.
POST/api/v1/agents/{agent_id}/prompt/rollback/{version_number}Roll back to a previous prompt version.
GET/api/v1/agents/{agent_id}/toolsList tools assigned to an agent.
GET/api/v1/agents/{agent_id}/tool-configGet agent tool config (smart selection, allowlist).
PATCH/api/v1/agents/{agent_id}/tool-configUpdate agent tool config.
POST/api/v1/agents/{agent_id}/tools/previewPreview tool selection for a given query.

Agent invoke (/api/v1/agents)

MethodPathDescription
GET/api/v1/agents/{agent_id}/schemasGet agent input/output schemas.
PATCH/api/v1/agents/{agent_id}/schemasUpdate agent schemas (admin).
POST/api/v1/agents/{agent_id}/invokeInvoke an agent with typed input.

Chat (/api/v1/agents)

MethodPathDescription
POST/api/v1/agents/{agent_id}/chatSend a chat message (streaming SSE response).

Conversations

MethodPathDescription
GET/api/v1/agents/{agent_id}/conversationsList conversations for an agent.
GET/api/v1/conversations/{conversation_id}Get a conversation with messages.
DELETE/api/v1/conversations/{conversation_id}Delete a conversation.

Memory (/api/v1/agents)

MethodPathDescription
GET/api/v1/agents/{agent_id}/memory-configGet memory config.
PATCH/api/v1/agents/{agent_id}/memory-configUpdate memory config.
GET/api/v1/agents/{agent_id}/memory/statsGet memory stats.
GET/api/v1/agents/{agent_id}/memory/{user_id}Get memory view for a user.
GET/api/v1/agents/{agent_id}/memory/{user_id}/factsList extracted facts.
GET/api/v1/agents/{agent_id}/memory/{user_id}/graphGet knowledge graph.
DELETE/api/v1/agents/{agent_id}/memory/{user_id}Clear memory for a user.

Providers (/api/v1/providers)

MethodPathDescription
GET/api/v1/providersList configured providers (BYOK).
POST/api/v1/providersRegister a provider.
DELETE/api/v1/providers/{provider_id}Remove a provider.
POST/api/v1/providers/{provider_id}/testTest a provider connection.
GET/api/v1/providers/catalogList supported model catalog.

Tiers (/api/v1/tiers)

MethodPathDescription
GET/api/v1/tiersList model tiers.
POST/api/v1/tiersCreate a tier.
PATCH/api/v1/tiers/{tier_id}Update a tier.
DELETE/api/v1/tiers/{tier_id}Delete a tier.

Tool groups (/api/v1/tools/groups)

MethodPathDescription
GET/api/v1/tools/groupsList tool groups.
POST/api/v1/tools/groupsCreate a tool group.
GET/api/v1/tools/groups/{group_id}Get a tool group.
PATCH/api/v1/tools/groups/{group_id}Update a tool group.
DELETE/api/v1/tools/groups/{group_id}Delete a tool group.

Tool health (/api/v1/tools)

MethodPathDescription
GET/api/v1/tools/healthGet health status for all tools.
GET/api/v1/tools/{tool_id}/health/historyGet health history for a tool.

MCP gateway (/mcp)

MethodPathDescription
POST/mcp/{org_slug}/{endpoint_id}MCP Streamable HTTP endpoint.
GET/mcp/{org_slug}/{endpoint_id}/.well-known/oauth-authorization-serverOAuth discovery.
POST/mcp/{org_slug}/{endpoint_id}/oauth/registerDynamic client registration.
GET/mcp/{org_slug}/{endpoint_id}/oauth/authorizeOAuth authorize.
POST/mcp/{org_slug}/{endpoint_id}/oauth/tokenOAuth token exchange.

MCP endpoints admin (/api/v1/mcp-endpoints)

MethodPathDescription
GET/api/v1/mcp-endpointsList MCP endpoints.
GET/api/v1/mcp-endpoints/{endpoint_id}Get endpoint config.
POST/api/v1/mcp-endpointsCreate an MCP endpoint.
PATCH/api/v1/mcp-endpoints/{endpoint_id}Update endpoint config.
DELETE/api/v1/mcp-endpoints/{endpoint_id}Delete an MCP endpoint.
GET/api/v1/mcp-endpoints/{endpoint_id}/toolsList tools exposed by an endpoint.

Workflows (/api/v1/workflows)

MethodPathDescription
GET/api/v1/workflowsList workflows.
POST/api/v1/workflowsCreate a workflow (DAG definition).
GET/api/v1/workflows/{workflow_id}Get a workflow.
PATCH/api/v1/workflows/{workflow_id}Update a workflow.
DELETE/api/v1/workflows/{workflow_id}Delete a workflow.
POST/api/v1/workflows/{workflow_id}/executeExecute a workflow run.
POST/api/v1/workflows/{workflow_id}/human-inputSubmit human-in-the-loop input.
GET/api/v1/workflows/{workflow_id}/runsList runs for a workflow.
GET/api/v1/task-runs/{run_id}Get a task run.

Long-running tasks

MethodPathDescription
GET/api/v1/task-templatesList task templates.
POST/api/v1/task-templatesCreate a task template.
GET/api/v1/task-templates/{template_id}Get a template.
PATCH/api/v1/task-templates/{template_id}Update a template.
DELETE/api/v1/task-templates/{template_id}Delete a template.
GET/api/v1/long-running-tasks/runsList task runs.
POST/api/v1/long-running-tasks/runsCreate a task run.
GET/api/v1/long-running-tasks/runs/{run_id}Get run details + progress.
GET/api/v1/long-running-tasks/runs/{run_id}/progressGet run progress checkpoints.
POST/api/v1/long-running-tasks/runs/{run_id}/cancelCancel a running task.

Monitoring (/api/v1/monitoring)

MethodPathDescription
GET/api/v1/monitoring/tool-callsPaginated tool call logs.
GET/api/v1/monitoring/tool-calls/statsAggregate tool call statistics.

Safety (/api/v1/monitoring/safety)

MethodPathDescription
GET/api/v1/monitoring/safetyPaginated safety alerts.
GET/api/v1/monitoring/safety/statsSafety summary statistics.
GET/api/v1/monitoring/safety/configGet safety config.
PUT/api/v1/monitoring/safety/configUpdate safety config.

Quality (/api/v1/quality)

MethodPathDescription
GET/api/v1/quality/checksPaginated quality checks.
GET/api/v1/quality/checks/statsQuality statistics.
POST/api/v1/quality/checks/runTrigger a quality check run.

Evals (/api/v1/evals)

MethodPathDescription
GET/api/v1/evals/datasetsList eval datasets.
POST/api/v1/evals/datasetsCreate a dataset.
GET/api/v1/evals/datasets/{dataset_id}Get a dataset.
PATCH/api/v1/evals/datasets/{dataset_id}Update a dataset.
DELETE/api/v1/evals/datasets/{dataset_id}Delete a dataset.
GET/api/v1/evals/datasets/{dataset_id}/casesList test cases.
POST/api/v1/evals/datasets/{dataset_id}/casesCreate a test case.
PATCH/api/v1/evals/cases/{case_id}Update a test case.
DELETE/api/v1/evals/cases/{case_id}Delete a test case.
POST/api/v1/evals/runsCreate an eval run.
GET/api/v1/evals/runsList eval runs.
GET/api/v1/evals/runs/compareCompare two eval runs.
GET/api/v1/evals/runs/{run_id}Get an eval run.
GET/api/v1/evals/runs/{run_id}/resultsGet per-case results for an eval run.
GET/api/v1/evals/ab-testsList A/B tests.
POST/api/v1/evals/ab-testsCreate an A/B test.
GET/api/v1/evals/ab-tests/{test_id}Get an A/B test.
GET/api/v1/evals/ab-tests/{test_id}/statsGet A/B test statistics.
POST/api/v1/evals/ab-tests/{test_id}/promotePromote the winning variant.

WebSocket (/ws/sdk)

The SDK-facing WebSocket endpoint. SDKs connect here via platools.connect() to register tools and receive tool-call dispatches. See Python Client and TypeScript Client for the wire protocol.

Generating a client

The spec is served at /openapi.json, so you can generate a client in any language:

Terminal window
curl http://localhost:8000/openapi.json > platos-openapi.json
openapi-generator-cli generate \
-i platos-openapi.json \
-g typescript-fetch \
-o ./generated

The REST API is for dashboard, orchestration, and monitoring flows. The platools SDK package is a separate tool-registration surface.

Changes

The OpenAPI spec is generated from the FastAPI code on every request, so /openapi.json always reflects the running server. If you see drift between this page and the live spec, the live spec wins.

Next steps