API reference
Caity's Code mode
/ v1/ me/ code/ devicesYour 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).
- Auth
- A person's token or an API key, as Authorization: Bearer.
Errors
403Code mode is for people, signed in.
curl 'https://api.cactive.com.au/v1/me/code/devices' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 200
{
devices: {
deviceId: string
orgId: string
name: string
platform: null | string
folders: string[]
online: boolean
ready: boolean
}[]
}/ v1/ me/ code/ sessionsYour Code mode sessions, newest first (50).
- Auth
- A person's token or an API key, as Authorization: Bearer.
Errors
403Code mode is for people, signed in.
curl 'https://api.cactive.com.au/v1/me/code/sessions' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 200
{
sessions: {
pending: string[]
error?: string
userId: string
status: "canceled" | "failed" | "stopped" | "starting" | "running"
createdAt: number
updatedAt?: number
orgId: string
sessionId: string
model?: string
title?: string
provider: string
deviceId: string
target?: "cloud" | "machine"
queued?: number
branch?: string
buildId?: string
git?: boolean
jobId: string
plan?: boolean
folder: string
mode: string
effort?: string
working?: boolean
conversationId?: string
lastSeq?: number
turns?: number
worktree?: string
endedAt?: number
repo?: {
orgId: string
repoId: string
name: string
branch: string
workBranch: string
}
pullRequest?: {
number: number
url: string
}
}[]
}/ v1/ me/ code/ sessionsStarts 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Request body
deviceIdstringrequiredMatches
^[A-Za-z0-9_-]{1,80}$.folderstringrequired1–1,024 characters.
provider"claude-code" | "codex" | "bedrock" | "fake"requiredmodelstringUp to 100 characters. Matches
^[A-Za-z0-9._:/@\[\]-]+$.mode"ask" | "reads" | "app" | "auto"effort"low" | "medium" | "high" | "max"planbooleantitlestringUp to 200 characters.
conversationIdstringMatches
^[A-Za-z0-9_-]{1,80}$.isolation"none" | "branch" | "worktree"branchstring
Errors
400That folder isn't allowed on that machine. Runcactive-agent code allow <folder>there first.400Unknown provider.400The test provider isn't available here.400A new branch or worktree needs a branch name git takes.403Code mode isn't available to the phone assistant.403Caity is off for you in that machine's space.403Code mode is for people, signed in.404Device not found409Code mode isn't approved on that machine. Add it to the device in Cloud → Agents.409Code mode needs full network access on that machine (its provider talks to its own service).
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"
}'Response 201
{
session: {
pending: string[]
error?: string
userId: string
status: "canceled" | "failed" | "stopped" | "starting" | "running"
createdAt: number
updatedAt?: number
orgId: string
sessionId: string
model?: string
title?: string
provider: string
deviceId: string
target?: "cloud" | "machine"
queued?: number
branch?: string
buildId?: string
git?: boolean
jobId: string
plan?: boolean
folder: string
mode: string
effort?: string
working?: boolean
conversationId?: string
lastSeq?: number
turns?: number
worktree?: string
endedAt?: number
repo?: {
orgId: string
repoId: string
name: string
branch: string
workBranch: string
}
pullRequest?: {
number: number
url: string
}
}
}/ v1/ me/ code/ cloud-sessionsA session in the cloud, on one of the person's organisation's repositories (docs/specs/caity/coding.md → Caity in the cloud).
- Auth
- A person's token or an API key, as Authorization: Bearer.
Request body
orgIdstringrequiredMatches
^[A-Za-z0-9_-]{1,80}$.repoIdstringrequired1–100 characters.
branchstringrequired1–255 characters.
textstringUp to 32,000 characters. Trimmed.
modelstringUp to 100 characters. Matches
^[A-Za-z0-9._:/@-]+$.mode"ask" | "reads" | "app" | "auto"titlestringUp to 200 characters.
Errors
403Code mode is for people, signed in.
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"
}'Response 201
{
session: {
pending: string[]
error?: string
userId: string
status: "canceled" | "failed" | "stopped" | "starting" | "running"
createdAt: number
updatedAt?: number
orgId: string
sessionId: string
model?: string
title?: string
provider: string
deviceId: string
target?: "cloud" | "machine"
queued?: number
branch?: string
buildId?: string
git?: boolean
jobId: string
plan?: boolean
folder: string
mode: string
effort?: string
working?: boolean
conversationId?: string
lastSeq?: number
turns?: number
worktree?: string
endedAt?: number
repo?: {
orgId: string
repoId: string
name: string
branch: string
workBranch: string
}
pullRequest?: {
number: number
url: string
}
}
}/ v1/ me/ code/ sessions/ :sessionIdA session: its machine, folder, provider, mode, status, turns and the approvals waiting for you.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
403Code mode is for people, signed in.404Session not found
curl 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 200
{
session: {
pending: string[]
error?: string
userId: string
status: "canceled" | "failed" | "stopped" | "starting" | "running"
createdAt: number
updatedAt?: number
orgId: string
sessionId: string
model?: string
title?: string
provider: string
deviceId: string
target?: "cloud" | "machine"
queued?: number
branch?: string
buildId?: string
git?: boolean
jobId: string
plan?: boolean
folder: string
mode: string
effort?: string
working?: boolean
conversationId?: string
lastSeq?: number
turns?: number
worktree?: string
endedAt?: number
repo?: {
orgId: string
repoId: string
name: string
branch: string
workBranch: string
}
pullRequest?: {
number: number
url: string
}
}
}/ v1/ me/ code/ sessions/ :sessionId/ eventsThe session's events after after (their seq), in order, up to 500 (more when there are more): messages, steps, command output, approvals, checkpoints.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Query parameters
afterinteger≥ 0. Coerced from a string.
Errors
403Code mode is for people, signed in.404Session not found
curl 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/events' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 200
{
session: {
pending: string[]
error?: string
userId: string
status: "canceled" | "failed" | "stopped" | "starting" | "running"
createdAt: number
updatedAt?: number
orgId: string
sessionId: string
model?: string
title?: string
provider: string
deviceId: string
target?: "cloud" | "machine"
queued?: number
branch?: string
buildId?: string
git?: boolean
jobId: string
plan?: boolean
folder: string
mode: string
effort?: string
working?: boolean
conversationId?: string
lastSeq?: number
turns?: number
worktree?: string
endedAt?: number
repo?: {
orgId: string
repoId: string
name: string
branch: string
workBranch: string
}
pullRequest?: {
number: number
url: string
}
}
events: {
type: "session.started"
provider: "claude-code" | "codex" | "bedrock" | "fake"
model: null | string
folder: string
git: boolean
mode: "ask" | "reads" | "app" | "auto"
branch?: string
worktree?: string
seq: number
at: number
} | {
type: "turn.started"
turn: number
text: string
commandId: string
seq: number
at: number
} | {
type: "message.delta"
turn: number
text: string
seq: number
at: number
} | {
type: "message"
turn: number
text: string
seq: number
at: number
} | {
type: "thinking.delta"
turn: number
text: string
seq: number
at: number
} | {
type: "thinking"
turn: number
text: string
seq: number
at: number
} | {
type: "tool.started"
turn: number
toolId: string
kind: "read" | "edit" | "command" | "other"
title: string
detail?: string
name?: string
input?: {
tool: "read"
path: string
offset?: number
limit?: number
} | {
tool: "edit"
path: string
edits: {
old: string
new: string
}[]
replaceAll?: boolean
} | {
tool: "write"
path: string
content: string
} | {
tool: "patch"
paths: string[]
patch: string
} | {
tool: "search"
pattern: string
path?: string
glob?: string
} | {
tool: "glob"
pattern: string
path?: string
} | {
tool: "list"
path: string
} | {
tool: "command"
command: string
description?: string
background?: boolean
} | {
tool: "todo"
items: {
text: string
status: "pending" | "in_progress" | "completed"
}[]
} | {
tool: "fetch"
url: string
} | {
tool: "websearch"
query: string
} | {
tool: "task"
description: string
prompt?: string
} | {
tool: "plan"
plan: string
} | {
tool: "other"
summary?: string
}
parentId?: string
seq: number
at: number
} | {
type: "tool.output"
turn: number
toolId: string
text: string
seq: number
at: number
} | {
type: "tool.finished"
turn: number
toolId: string
ok: boolean
exitCode?: number
summary?: string
seq: number
at: number
} | {
type: "todos"
turn: number
items: {
text: string
status: "pending" | "in_progress" | "completed"
}[]
seq: number
at: number
} | {
type: "usage"
turn: number
inputTokens: number
outputTokens: number
cacheReadTokens?: number
cacheWriteTokens?: number
contextTokens?: number
contextWindow?: number
costUsd?: number
seq: number
at: number
} | {
type: "turn.queued"
commandId: string
text: string
seq: number
at: number
} | {
type: "turn.unqueued"
commandId: string
reason: "canceled" | "started"
seq: number
at: number
} | {
type: "turn.steered"
turn: number
commandId: string
text: string
seq: number
at: number
} | {
type: "session.configured"
settings: {
mode?: "ask" | "reads" | "app" | "auto"
plan?: boolean
model?: null | string
effort?: null | "low" | "medium" | "high" | "max"
}
seq: number
at: number
} | {
type: "allowlist.added"
command: string
seq: number
at: number
} | {
type: "approval.requested"
turn: number
requestId: string
kind: "read" | "edit" | "command" | "other"
title: string
command?: string
paths?: string[]
diff?: string
outside?: boolean
input?: {
tool: "read"
path: string
offset?: number
limit?: number
} | {
tool: "edit"
path: string
edits: {
old: string
new: string
}[]
replaceAll?: boolean
} | {
tool: "write"
path: string
content: string
} | {
tool: "patch"
paths: string[]
patch: string
} | {
tool: "search"
pattern: string
path?: string
glob?: string
} | {
tool: "glob"
pattern: string
path?: string
} | {
tool: "list"
path: string
} | {
tool: "command"
command: string
description?: string
background?: boolean
} | {
tool: "todo"
items: {
text: string
status: "pending" | "in_progress" | "completed"
}[]
} | {
tool: "fetch"
url: string
} | {
tool: "websearch"
query: string
} | {
tool: "task"
description: string
prompt?: string
} | {
tool: "plan"
plan: string
} | {
tool: "other"
summary?: string
}
suggest?: string
seq: number
at: number
} | {
type: "approval.resolved"
turn: number
requestId: string
decision: "allow" | "deny"
by: "policy" | "person" | "stop"
always?: boolean
feedback?: string
seq: number
at: number
} | {
type: "turn.finished"
turn: number
status: "done" | "failed" | "interrupted"
error?: string
seq: number
at: number
} | {
type: "checkpoint.created"
turn: number
ref: string
seq: number
at: number
} | {
type: "checkpoint.diff"
commandId: string
fromTurn: number
toTurn: number
diff: string
truncated: boolean
seq: number
at: number
} | {
type: "checkpoint.restored"
commandId: string
turn: number
seq: number
at: number
} | {
type: "command.rejected"
commandId: string
reason: string
seq: number
at: number
} | {
type: "error"
message: string
retry?: {
attempt: number
max?: number
delayMs?: number
}
seq: number
at: number
} | {
type: "session.ended"
reason: "canceled" | "failed" | "stopped"
error?: string
seq: number
at: number
} | {
type: "file.written"
commandId: string
path: string
bytes: number
seq: number
at: number
} | {
type: "changes.reverted"
commandId: string
path: string
hunk: boolean
seq: number
at: number
} | {
type: "terminal.opened"
commandId: string
terminalId: string
seq: number
at: number
} | {
type: "terminal.closed"
terminalId: string
exitCode?: number
seq: number
at: number
} | {
type: "terminal.command"
terminalId: string
line: string
hidden?: boolean
seq: number
at: number
} | {
type: "git.branched"
commandId: string
branch: string
seq: number
at: number
} | {
type: "git.committed"
commandId: string
sha: string
branch: null | string
summary: string
seq: number
at: number
} | {
type: "git.pushed"
commandId: string
branch: string
remote: string
seq: number
at: number
}[]
more: boolean
}/ v1/ me/ code/ sessions/ :sessionId/ messagesStarts 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
textstringrequired1–32,000 characters. Trimmed.
imagesobject[]Up to 4 items.
images[].mime"image/png" | "image/jpeg" | "image/webp" | "image/gif"requiredimages[].datastringrequired
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ steerSends your message into the turn running (Codex takes it mid-turn; Claude Code's turn stops and the message runs next).
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
textstringrequired1–32,000 characters. Trimmed.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ queue/ :queued/ cancelDrops a message waiting in the queue before it starts.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).queuedThe id of the command that sent a message now waiting in a Code mode session's queue, as its
turn.queuedevent gives it.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/queue/{queued}/cancel' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ settingsChanges 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
mode"ask" | "reads" | "app" | "auto"planbooleanmodelstringor nullUp to 100 characters. Matches
^[A-Za-z0-9._:/@\[\]-]+$.effort"low" | "medium" | "high" | "max"or null
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ interruptStops the running turn; approvals waiting in it are declined.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/interrupt' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ approvals/ :requestIdAllows 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).requestIdA Code mode step waiting for your approval (
apr_…), as the session'sapproval.requestedevent and itspendinglist give it.
Request body
decision"allow" | "deny"requiredalwaysbooleanfeedbackstringUp to 4,000 characters.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ checkpoints/ diffAsks the machine for the patch between two turns' checkpoints; it arrives as a checkpoint.diff event with this command's id.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
fromTurnintegerrequired0–99999. Coerced from a string.
toTurnintegerrequired0–99999. Coerced from a string.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ checkpoints/ :turn/ restorePuts 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).turnA Code mode turn's number (from 1; 0 is the folder as the session found it).
Errors
400Not a turn.400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/checkpoints/{turn}/restore' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ stopEnds the session: the turn interrupted, waiting approvals declined, the provider closed on the machine.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/stop' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ files/ listAsks the machine for the folder's files (git's view: ignored files left out); the answer is the stream reply-<commandId>, JSON { files, truncated }.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/files/list' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ files/ readAsks 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
pathstringrequired1–1,000 characters.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ files/ writeSaves 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
pathstringrequired1–1,000 characters.
contentstringrequiredUp to 300,000 characters.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ changes/ diffAsks 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>.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
fromTurnintegerrequired0–99999. Coerced from a string.
toTurninteger0–99999. Coerced from a string.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ changes/ revertPuts path back as checkpoint fromTurn had it, or undoes one hunk of its change in the folder. Not while a turn runs.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
pathstringrequired1–1,000 characters.
fromTurnintegerrequired0–99999. Coerced from a string.
hunkstringUp to 300,000 characters.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ terminalsOpens 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>.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
colsintegerrequiredrowsintegerrequired
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ terminals/ :terminalId/ inputTypes 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).terminalIdA Code mode session's terminal (
trm_…), as itsterminal.openedevent gives it.
Request body
datastringrequired1–4,096 characters.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ terminals/ :terminalId/ resizeChanges a terminal's size (cols, rows).
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).terminalIdA Code mode session's terminal (
trm_…), as itsterminal.openedevent gives it.
Request body
colsintegerrequiredrowsintegerrequired
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ terminals/ :terminalId/ closeCloses a terminal; a terminal.closed event follows.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).terminalIdA Code mode session's terminal (
trm_…), as itsterminal.openedevent gives it.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/terminals/{terminalId}/close' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ git/ statusAsks 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>.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/status' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ git/ diffAsks 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 }.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/diff' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ git/ branchMakes 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
namestringrequired
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ git/ commitCommits 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
messagestringrequired1–10,000 characters. Trimmed.
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
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"
}'Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ git/ pushPushes 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Errors
400That isn't a Code mode command.403Code mode isn't available to the phone assistant.403Caity is off for you in this session's space.403Your permissions for Caity in this space go up to "…".403Code mode is for people, signed in.404Session not found404Job not found409This session has ended.409That approval isn't waiting any more.409This job already ….
curl -X POST 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/git/push' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 202
{
commandId: null
seq: null
} | {
commandId: string
seq: number
}/ v1/ me/ code/ sessions/ :sessionId/ git/ messageA 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 }.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).
Request body
diffstringrequired1–240,000 characters.
recentstring[]Up to 20 items. Each up to 500 characters.
Errors
400There's nothing to commit.403Code mode isn't available to the phone assistant.403Caity is off for you in that space.403Code mode is for people, signed in.404Session not found502No message came back. Try again.
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"
}'Response 200
{
message: string
}/ v1/ me/ code/ sessions/ :sessionId/ streams/ :streamA 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.
- Auth
- A person's token or an API key, as Authorization: Bearer.
Path parameters
sessionIdA sign-in's id (
cls_…for an app on a phone or the command line,ses_…for a browser), as the devices list gives it; under/v1/me/codea Code mode session (cds_…).streamA Code mode stream:
reply-<commandId>for a request's answer,term-<terminalId>for a terminal's output.
Query parameters
afterinteger≥ 0. Coerced from a string.
Errors
400That isn't a stream.403Code mode is for people, signed in.404Session not found
curl 'https://api.cactive.com.au/v1/me/code/sessions/{sessionId}/streams/{stream}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"Response 200
{
chunks: {
seq: number
data: string
done?: boolean
}[]
more: boolean
}