[ Blocks REST API ]

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

Running
GitHub ActionsGitLab CICircleCIJenkinsBuildkiteTrigger.devTemporalAirflown8nZapierMakeRetool
[ 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.

# .github/workflows/ci.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
fix-with-blocks:
needs: test
if: failure()
runs-on: ubuntu-latest
steps:
- name: Hand the failure to an agent
run: |
curl -X POST https://api.blocks.team/rest/v1/sessions \
-H "Authorization: ApiKey ${{ secrets.BLOCKS_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "codex",
"message": "CI failed on ${{ github.repository }} (${{ github.head_ref }}), run ${{ github.run_id }}. Find the cause, fix it and push to the same branch."
}'

Fix the build when CI fails.

Add one step to the CI you already have. When tests fail, an agent gets the run, finds the cause and pushes a fix to the same branch.

[ 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.

POST/sessions
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" }
}
}

Hand your first task to the API.

Create a key, send one request and watch the session in the control plane.

Blocks REST API – Start coding agents from CI, workflows and your own tools