Endpoints for agents (with an agent key) and for the people and systems that manage them.
#For the agent (agent key)
| Endpoint | Purpose |
|---|---|
POST /platform/v1/agent/sql | { "query": "…" }, header X-Stitch-Session (optional). 200 with results, 202 pending approval, 403 refused by the firewall. |
POST /platform/v1/projects/<ref>/database/query | Same, on the management API path. |
GET /platform/v1/agent | The key's project and policy. |
GET /platform/v1/agent/approvals/<id> | Status and result of an approval. |
GET /platform/v1/agent/sessions/<session> | Changes of one of its sessions. |
POST /platform/v1/agent/sessions/<session>/revert | Undo one of its sessions (dry_run default true). |
POST /platform/v1/agent/db-credentials | { "ttl_minutes": 60 }: a temporary database login with the key's rights. GET lists its logins. |
#For owners, admins and organization tokens
| Endpoint | Role |
|---|---|
GET / POST /projects/<ref>/agent-keys, PATCH / DELETE …/agent-keys/<id> | Read: any member · change: admin |
GET /projects/<ref>/agent-audit ?key&session&verdict&since&after&limit | Any member |
GET /projects/<ref>/agent-approvals, POST …/<id>/approve, …/reject | Read: any member · decide: admin |
GET /projects/<ref>/agent-sessions, …/<session>, POST …/revert | Dry run: developer · undo: admin |
GET / POST /projects/<ref>/agent-keys/<id>/db-logins, DELETE …/db-logins/<login> | Admin |
All paths are under https://stitchdb.com/platform/v1. See Management API for authentication.