SDK reference

Caity's Code mode

Each route's function in the SDK, its call beside the same request in cURL.
meCodeDevices

GET/v1/me/code/devices

Your machines approved for Code mode, with the folders each allows (cactive-agent code allow), whether it's online and whether its agent is ready (full network access, a recent agent with room for a session).

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/code/devices' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meCodeSessions

GET/v1/me/code/sessions

Your Code mode sessions, newest first (50).

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/code/sessions' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessions

POST/v1/me/code/sessions

Starts a Code mode session on one of your own machines, in a folder it allows, with your own Claude Code or Codex login there. mode is at most your mode for the assistant in that machine's space; effort (low to max) and plan (plan mode) are optional; isolation (branch or worktree) with a branch starts it on a new branch or in a worktree of its own inside the folder; 409 when the machine isn't approved for Code mode or lacks full network access. bedrock is Caity herself: the tools run on the machine, each model step through the platform.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "deviceId": "<deviceId>",
    "folder": "example",
    "provider": "claude-code"
  }'
postMeCodeCloudSessions

POST/v1/me/code/cloud-sessions

A session in the cloud, on one of the person's organisation's repositories.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/cloud-sessions' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "orgId": "<orgId>",
    "repoId": "<repoId>",
    "branch": "example"
  }'
meCodeSessionsBySessionId

GET/v1/me/code/sessions/:sessionId

A session: its machine, folder, provider, mode, status, turns and the approvals waiting for you.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meCodeSessionsEvents

GET/v1/me/code/sessions/:sessionId/events

The session's events after after (their seq), in order, up to 500 (more when there are more): messages, steps, command output, approvals, checkpoints.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/events' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsMessages

POST/v1/me/code/sessions/:sessionId/messages

Starts a turn with your message, or queues it behind the turn running (a turn.queued event). Up to 4 images (PNG, JPEG, WebP or GIF as base64, 300 KB together). 409 when the session has ended.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/messages' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "example"
  }'
postMeCodeSessionsSteer

POST/v1/me/code/sessions/:sessionId/steer

Sends your message into the turn running (Codex takes it mid-turn; Claude Code's turn stops and the message runs next).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/steer' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "example"
  }'
postMeCodeSessionsQueueCancel

POST/v1/me/code/sessions/:sessionId/queue/:queued/cancel

Drops a message waiting in the queue before it starts.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/queue/{queued}/cancel' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsSettings

POST/v1/me/code/sessions/:sessionId/settings

Changes the session's mode (at most your mode for the assistant in its space), plan (plan mode), model and effort, from the agent's next step. Only you, from your own sign-in.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "mode": "ask",
    "plan": true,
    "model": "example"
  }'
postMeCodeSessionsInterrupt

POST/v1/me/code/sessions/:sessionId/interrupt

Stops the running turn; approvals waiting in it are declined.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/interrupt' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsApprovalsByRequestId

POST/v1/me/code/sessions/:sessionId/approvals/:requestId

Allows or declines a step waiting for you (a command, an edit, anything outside the folder). always with an allow adds the command to the machine's list for the folder; feedback with a decline tells the agent what to do instead. Only you, from your own sign-in: not keys or the phone assistant.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/approvals/{requestId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "decision": "allow"
  }'
postMeCodeSessionsCheckpointsDiff

POST/v1/me/code/sessions/:sessionId/checkpoints/diff

Asks the machine for the patch between two turns' checkpoints; it arrives as a checkpoint.diff event with this command's id.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/checkpoints/diff' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "fromTurn": 1,
    "toTurn": 1
  }'
postMeCodeSessionsCheckpointsRestore

POST/v1/me/code/sessions/:sessionId/checkpoints/:turn/restore

Puts the folder back as that turn's checkpoint left it (files added since are removed; ignored files stay). Only you, and not while a turn runs.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/checkpoints/{turn}/restore' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsStop

POST/v1/me/code/sessions/:sessionId/stop

Ends the session: the turn interrupted, waiting approvals declined, the provider closed on the machine.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/stop' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsFilesList

POST/v1/me/code/sessions/:sessionId/files/list

Asks the machine for the folder's files (git's view: ignored files left out); the answer is the stream reply-<commandId>, JSON { files, truncated }.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/files/list' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsFilesRead

POST/v1/me/code/sessions/:sessionId/files/read

Asks the machine for one file's text (path, inside the folder); the answer is the stream reply-<commandId>. Binary files, files over 2 MB and files likely to hold secrets come back without their text.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/files/read' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "path": "example"
  }'
postMeCodeSessionsFilesWrite

POST/v1/me/code/sessions/:sessionId/files/write

Saves your edit to a file on your machine (path, content up to 300 KB); never a file likely to hold secrets. Only you, from your own sign-in.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/files/write' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "path": "example",
    "content": "example"
  }'
postMeCodeSessionsChangesDiff

POST/v1/me/code/sessions/:sessionId/changes/diff

Asks for the changes from checkpoint fromTurn to toTurn, or to the folder as it is now without toTurn; the patch is the stream reply-<commandId>.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/changes/diff' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "fromTurn": 1
  }'
postMeCodeSessionsChangesRevert

POST/v1/me/code/sessions/:sessionId/changes/revert

Puts path back as checkpoint fromTurn had it, or undoes one hunk of its change in the folder. Not while a turn runs.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/changes/revert' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "path": "example",
    "fromTurn": 1
  }'
postMeCodeSessionsTerminals

POST/v1/me/code/sessions/:sessionId/terminals

Opens a terminal on your machine, in the session's folder, as you (cols, rows; at most 3 at once); a terminal.opened event says its id, and its output is the stream term-<terminalId>.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/terminals' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "cols": 1,
    "rows": 1
  }'
postMeCodeSessionsTerminalsInput

POST/v1/me/code/sessions/:sessionId/terminals/:terminalId/input

Types into a terminal (data, up to 4,096 characters). Each line is recorded in the session and the audit log; one typed at a password prompt as hidden. Only you, from your own sign-in.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/terminals/{terminalId}/input' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "data": "example"
  }'
postMeCodeSessionsTerminalsResize

POST/v1/me/code/sessions/:sessionId/terminals/:terminalId/resize

Changes a terminal's size (cols, rows).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/terminals/{terminalId}/resize' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "cols": 1,
    "rows": 1
  }'
postMeCodeSessionsTerminalsClose

POST/v1/me/code/sessions/:sessionId/terminals/:terminalId/close

Closes a terminal; a terminal.closed event follows.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/terminals/{terminalId}/close' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsGitStatus

POST/v1/me/code/sessions/:sessionId/git/status

Asks the machine for the folder's git status: its branch, upstream, ahead and behind, remote (no credentials), changes and recent commit summaries; the answer is the stream reply-<commandId>.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/status' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsGitDiff

POST/v1/me/code/sessions/:sessionId/git/diff

Asks the machine for the folder's changes against its last commit, new files too, with known kinds of keys taken out; the answer is the stream reply-<commandId>, JSON { diff, truncated }.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/diff' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsGitBranch

POST/v1/me/code/sessions/:sessionId/git/branch

Makes a new branch (name) where the folder is and switches to it; a git.branched event follows. Not while a turn runs. Only you, from your own sign-in.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/branch' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example"
  }'
postMeCodeSessionsGitCommit

POST/v1/me/code/sessions/:sessionId/git/commit

Commits every change in the folder with message, as you (your git identity and hooks on the machine); a git.committed event says its sha. Not while a turn runs. Only you, from your own sign-in.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/commit' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "message": "example"
  }'
postMeCodeSessionsGitPush

POST/v1/me/code/sessions/:sessionId/git/push

Pushes the folder's branch to its upstream, or to origin as its upstream, with your credentials on the machine; a git.pushed event follows. Only you, from your own sign-in.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/push' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeCodeSessionsGitMessage

POST/v1/me/code/sessions/:sessionId/git/message

A commit message drafted by the assistant's fast model from diff (as git/diff answered it; the first 60 KB, keys taken out) and recent commit summaries for their style; on your allowance in the session's space. Answers { message }.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/message' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "diff": "example"
  }'
meCodeSessionsStreamsByStream

GET/v1/me/code/sessions/:sessionId/streams/:stream

A stream's pieces after after (a command's reply or a terminal's output), in order, kept an hour; a reply read to its end is gone.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/streams/{stream}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"