API reference
Every endpoint of the Agent API, its authentication and its errors.
Base address: https://agent.api.sypnia.com/v1. Authentication: Authorization: Bearer <token>, a Sypnia token. Scopes: agent:tasks; agent:approve only with a person’s own session.
Tasks
Start a task
POST
/v1/tasks Cloud { repository, request, case?, budget: { credits } }. Returns the task and its estimate.Get a task
GET
/v1/tasks/{id} Cloud State, steps, questions, approvals, branch, pull request, cost.
Follow a task
GET
/v1/tasks/{id}/events Cloud Server-sent events:
step, question, approval, budget, done, stopped.Cancel
POST
/v1/tasks/{id}/cancel Cloud Stops the task; the branch is kept.
Questions and approvals
Answer a question
POST
/v1/questions/{id}/answer Cloud { choice } or { text }.Pending approvals
GET
/v1/approvals Cloud Yours, and your team’s if you approve for it.
Decide
POST
/v1/approvals/{id} Cloud { decision: "approve" | "deny", note? }. Requires a person’s session.You
Your level and preferences
GET
/v1/profile Cloud What the agent remembers
GET
/v1/memory Cloud ?scope=person|project&project=…; DELETE /v1/memory/{id} forgets one note.Errors
| Status | Code | When |
|---|---|---|
| 402 | insufficient_credits | the budget is larger than your credits, after the 7 days of grace (When credits run out) |
| 403 | needs_person | an approval sent with a token that is not a person’s session |
| 409 | task_finished | the task already ended |
| 422 | invalid_request | a missing repository, request or budget |
| 429 | rate_limited | too many requests |