[ Blocks REST API ]
Running
Start a coding agent from anything that can send a request.
One call starts a cloud session with Claude Code, Codex, Gemini, OpenCode, Cursor, Kimi or your own agent. Wire Blocks into CI, background jobs and internal tools, and watch every session in the control plane.
curl -X POST https://api.blocks.team/rest/v1/sessions \ -H "Authorization: ApiKey $BLOCKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "agent_name": "claude", "message": "Upgrade acme/web to React 19 and open a pull request." }'201Created412 ms
{ "id": "a196cec6-49cb-4c48-8e4c-2707fb5d6709", "title": "Upgrade acme/web to React 19", "thread_id": "71562cd0-1f63-41b2-8382-10f2fdb1ac8b", "pull_requests": [], "session_html_url": "https://blocks.team/app/…/sessions/a196cec6…", "_links": { "messages": { "href": "…/sessions/a196cec6…/messages" }, "final_message": { "href": "…/threads/71562cd0…/messages?type=final_message" } }}
Upgrade acme/web to React 19
Claude Code · started from the API · just now

[ Use cases ]
Put an agent wherever work already happens.
If it can send an HTTP request, it can hand work to Blocks and get a pull request or an answer back.
[ The API ]
Hand off the work. Get the result back.
Start a session, steer it and collect what it made, from your own code. They're the same sessions your team sees in the app.
curl -X POST https://api.blocks.team/rest/v1/sessions \ -H "Authorization: ApiKey $BLOCKS_API_KEY" \ -d '{"agent_name": "claude", "message": "Upgrade acme/web to React 19."}'201 Created
{ "id": "a196cec6-49cb-4c48-8e4c-2707fb5d6709", "title": "Upgrade acme/web to React 19", "thread_id": "71562cd0-1f63-41b2-8382-10f2fdb1ac8b", "pull_requests": [], "session_html_url": "https://blocks.team/app/…/sessions/a196cec6…", "_links": { "messages": { "href": "…/sessions/a196cec6…/messages" }, "final_message": { "href": "…/threads/71562cd0…/messages?type=final_message" } }}