clankie

API

Settings and accounts

Read and change the owner's settings, worker models and account holds, extension switches, persona, voice, appearance and connected accounts.

On this page

This page covers the owner's settings documents and Clankie's connected accounts. Every route takes an Operator token or a Device session with Take Control, except reading extension state, which any device session can do. Responses carry cache-control: no-store.

Most settings documents are guarded by a revision. A read returns revision, a 64-character lowercase hex string that changes whenever the stored value changes. A write sends it back as expectedRevision; if the stored value no longer matches, or the caller's authority or the settings changed before the write landed, the write is refused with 409 and nothing is saved. Read the document again and retry.

Unless a route says otherwise, an authentication failure answers 401 with {"error": "authentication_required"}, and a device session without Take Control answers 403 with {"error": "forbidden"}.

Owner settings

Host behavior, quiet hours, maximum trust mode and runtime health alarms.

Read host settings

GET /v1/operator/host-settings

Returns whether this Mac stays awake and whether updates install automatically, with the effective values and the host's power state when known.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
schemaVersion number Always 1.
revision string Revision of the stored host settings.
host.keepAwake boolean Effective keep-awake choice. Unset means on for a self-hosted Mac.
host.autoUpdate boolean Whether official releases install automatically.
keepAwakeSupported boolean true only on a self-hosted Mac.
autoUpdateManaged boolean true when managed hosting keeps automatic updates on.
autoUpdateEffective boolean Whether updates install automatically, after the managed rule.
power object Optional. Host power report (below).
keepAwakeService object Optional. state (healthy, unhealthy, unreachable), optional detail string, optional pid number.

power fields:

Field Type Description
power.state string always_on, sleep_allowed or unknown.
power.source string ac, battery or unknown.
power.sleepAfterMinutes number or null Idle minutes before the Mac sleeps on the current source; 0 means never.
power.heldAwakeBy string[] Processes holding a sleep assertion on the current source.
power.keepAwakeRequested boolean The owner's keep-awake choice.
power.lastSleep object Optional. sleptAt, wokeAt (ISO timestamps) and seconds.
power.advice string Optional. What to do, when the state warrants it.

Errors

Status error When
401 authentication_required No valid operator token or device session.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/host-settings \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Change host settings

POST /v1/operator/host-settings

Changes keep-awake, automatic updates, or both. Returns the new snapshot.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
schemaVersion number yes 1.
expectedRevision string yes revision from the last read.
changes.keepAwake boolean no Keep this Mac awake while plugged in.
changes.autoUpdate boolean no Install updates automatically.

changes must set at least one field. The body is limited to 2 KB.

Response 200: the host settings snapshot, as in "Read host settings".

Errors

Status error When
409 host_settings_conflict expectedRevision does not match, or the settings or the caller's authority changed before the write.
400 malformed The body does not match the schema, or changes is empty.
400 keep_awake_unsupported keepAwake: true on a host that does not support it.
400 auto_update_managed autoUpdate: false on a managed host.
503 keep_awake_apply_failed Saved, but applying keep-awake failed. The body also has saved: true and settings (the new snapshot).
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/host-settings \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schemaVersion":1,"expectedRevision":"'"$REVISION"'","changes":{"keepAwake":true}}'

Read quiet hours

GET /v1/operator/quiet-hours

Returns the owner's quiet hours and, if a quiet period is in effect now, when it ends.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
schemaVersion number Always 1.
quietHours object or null null when quiet hours are off.
quietHours.start string Start time, HH:mm.
quietHours.end string End time, HH:mm.
quietHours.timeZone string IANA time zone.
quietUntil string Optional. ISO timestamp when the current quiet period ends.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
503 settings_unavailable Settings could not be read.
sh
curl -sS http://127.0.0.1:4310/v1/operator/quiet-hours \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Set quiet hours

POST /v1/operator/quiet-hours

Sets or clears quiet hours. This write takes no revision: the last write wins. Returns the new snapshot.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
quietHours object or null yes null turns quiet hours off.
quietHours.start string yes HH:mm (24-hour).
quietHours.end string yes HH:mm; must differ from start.
quietHours.timeZone string yes IANA time zone, up to 100 characters.

No other fields are accepted. The body is limited to 1 KB.

Response 200: the quiet hours snapshot, as in "Read quiet hours".

Errors

Status error When
400 invalid_quiet_hours The body does not match the schema.
403 forbidden The device session lacks Take Control, or lost it before the change was saved.
401 authentication_required No valid credential.
503 settings_unavailable Settings cannot be written.
sh
curl -sS http://127.0.0.1:4310/v1/operator/quiet-hours \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"quietHours":{"start":"22:00","end":"07:00","timeZone":"America/New_York"}}'

Read maximum trust mode

GET /v1/operator/maximum-trust-mode

Returns whether maximum trust mode is on. When on, supported coding agents that Clankie starts next skip their own permission prompts. Agents already running keep the mode they started with.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
schemaVersion number Always 1.
enabled boolean Whether maximum trust mode is on.
seatsScope string local: the seat list covers this machine only.
seatsOnOtherMode object[] Optional. Live seats on this machine still running the other mode, up to 256. Absent when seats could not be observed.
seatsOnOtherMode[].seatId string Seat id.
seatsOnOtherMode[].title string Seat title.
seatsOnOtherMode[].harness string Harness name.
seatsOnOtherMode[].maximumTrust boolean The mode the seat launched with.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/maximum-trust-mode \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Set maximum trust mode

POST /v1/operator/maximum-trust-mode

Turns maximum trust mode on or off. This write takes no revision. Returns the new snapshot.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
schemaVersion number yes 1.
enabled boolean yes The new mode.

Response 200: the snapshot, as in "Read maximum trust mode".

Errors

Status error When
409 maximum_trust_mode_conflict The caller's authority changed, or the settings could not be written.
400 malformed The body does not match the schema.
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/maximum-trust-mode \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schemaVersion":1,"enabled":false}'

Read runtime health

GET /v1/operator/runtime-health

Returns the runtime health alarm settings and the service's latest observation of its own CPU use and health latency.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
schemaVersion number Always 1.
revision string Revision of settings.
settings.enabled boolean Whether the detector runs. Default true.
settings.cpuPercent number CPU threshold, 1 to 1000 (100 is one core). Default 50.
settings.healthLatencyMs number Health latency threshold, 1 to 60000. Default 1000.
settings.sustainedMs number How long a breach must last before an alarm, 100 to 86400000. Default 300000.
settings.sampleIntervalMs number Sampling interval, 100 to 60000. Default 15000.
settings.cooldownMs number Quiet time after an alarm, 1000 to 86400000. Default 1800000.
observation.state string starting, disabled, healthy, sustaining, alarm or cooldown.
observation.durationMs number How long the current state has lasted.
observation.reasons string[] cpu, health, or both.
observation.delivery string Delivery of the latest notice: none, accepted or unavailable.
observation.observedAt string Optional. ISO timestamp of the latest sample.
observation.cpuPercent number Optional. Latest CPU reading.
observation.healthLatencyMs number Optional. Latest health latency.
observation.healthAvailable boolean Optional. Whether the health check answered.
observation.recorded boolean Optional. Whether the latest notice is recorded in the owner's default conversation.
observation.lastAlarmAt string Optional. ISO timestamp.
observation.lastRecoveryAt string Optional. ISO timestamp.
observation.lastIncidentDurationMs number Optional.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/runtime-health \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Change runtime health settings

POST /v1/operator/runtime-health

Changes one or more runtime health settings. Fields left out keep their values. Returns the new snapshot.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
schemaVersion number yes 1.
expectedRevision string yes revision from the last read.
changes object yes At least one of enabled, cpuPercent, healthLatencyMs, sustainedMs, sampleIntervalMs, cooldownMs, with the ranges in "Read runtime health".

Response 200: the runtime health snapshot.

Errors

Status error When
409 runtime_health_conflict expectedRevision does not match, or the settings or the caller's authority changed before the write.
400 malformed The body does not match the schema, or changes is empty.
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/runtime-health \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schemaVersion":1,"expectedRevision":"'"$REVISION"'","changes":{"cpuPercent":80}}'

Worker models and accounts

Which models Clankie may choose for a hire, and the owner's holds and usage budgets on individual worker accounts.

Read worker models

GET /v1/workers/models

Returns the allow-list of models Clankie chooses each hire's model from, and an optional pin every hire uses.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
revision string Revision of the models and pin.
models string[] Allowed models, up to 32. Empty means Clankie picks from the newest model of each family.
pinModel string Optional. A model every hire uses. Absent means no pin.

Errors

Status error When
401 authentication_required No valid credential.
403 none The device session lacks Take Control. The body is a refusal: {"outcome":"refused","reason":"owner_required","detail":"..."}.
503 settings_unavailable Settings could not be read.
sh
curl -sS http://127.0.0.1:4310/v1/workers/models \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Change worker models

POST /v1/workers/models

Replaces the allow-list, sets or clears the pin, or both. Every model name is checked against the model registry before anything is saved.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
expectedRevision string yes revision from the last read.
models string[] no The whole allow-list, up to 32 unique names of 1 to 200 characters. [] clears it.
pinModel string or null no A model to pin, or null to clear the pin.

At least one of models and pinModel is required.

Response 200

Field Type Description
outcome string saved.
settings object The new snapshot: revision, models, optional pinModel.

A refusal has outcome: "refused", a reason, a detail sentence and, for unknown_model, a models list of the unknown names.

Errors

Status reason or error When
409 reason: revision_conflict expectedRevision does not match.
400 reason: unknown_model The registry does not know one or more names; models lists them.
403 reason: owner_required The device session lacks Take Control, or lost it before the change was saved.
400 error: malformed The body does not match the schema.
401 error: authentication_required No valid credential.
503 error: settings_unavailable Settings cannot be written.
sh
curl -sS http://127.0.0.1:4310/v1/workers/models \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":"'"$REVISION"'","pinModel":null}'

List worker account holds

GET /v1/worker-accounts/holds

Returns the worker accounts the owner has set aside from Clankie's automatic choice.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
revision string Revision of the holds list.
holds object[] Up to 64 holds.
holds[].machine string local or a machine connection id.
holds[].harness string claude, codex or pi.
holds[].label string Account label on that machine.
holds[].reason string Optional. Why the account is held.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/worker-accounts/holds \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Hold or release a worker account

POST /v1/worker-accounts/holds

Holds one account (held: true) or releases it (held: false). Holding an account that is already held replaces its reason. Returns the new holds list.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
expectedRevision string yes revision from the last read.
machine string no local (default) or a machine connection id: lowercase letters, digits and hyphens, starting with a letter.
harness string yes claude, codex or pi.
label string yes Account label: lowercase letter first, then letters, digits, _ or -, up to 64 characters.
held boolean yes true to hold, false to release.
reason string no 1 to 200 characters. Only with held: true.

Response 200: revision and holds, as in "List worker account holds".

Errors

Status error When
409 worker_account_holds_conflict expectedRevision does not match, or the settings or the caller's authority changed before the write.
400 invalid_worker_account_hold The body does not match the schema, or a release carries a reason.
400 too_many_worker_account_holds 64 other accounts are already held.
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/worker-accounts/holds \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":"'"$REVISION"'","harness":"codex","label":"default","held":true,"reason":"Saving quota"}'

List worker account budgets

GET /v1/worker-accounts/budgets

Returns per-account usage budgets: the plan usage percentage at which Clankie stops choosing an account.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
revision string Revision of the budgets list.
budgets object[] Up to 64 budgets.
budgets[].machine string local or a machine connection id.
budgets[].harness string claude or codex.
budgets[].label string Account label.
budgets[].stopAtPercent number Integer from 1 to 100.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/worker-accounts/budgets \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Set or clear a worker account budget

POST /v1/worker-accounts/budgets

Sets one account's budget, replacing any earlier budget for it, or clears it with stopAtPercent: null. Returns the new budgets list.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
expectedRevision string yes revision from the last read.
machine string no local (default) or a machine connection id.
harness string yes claude or codex.
label string yes Account label, same format as for holds.
stopAtPercent number or null yes Integer from 1 to 100, or null to clear.

Response 200: revision and budgets, as in "List worker account budgets".

Errors

Status error When
409 worker_account_budgets_conflict expectedRevision does not match, or the settings or the caller's authority changed before the write.
400 invalid_worker_account_budget The body does not match the schema.
400 too_many_worker_account_budgets 64 other accounts already have budgets.
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/worker-accounts/budgets \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":"'"$REVISION"'","harness":"claude","label":"default","stopAtPercent":90}'

Extension switches

Each running extension's state and the owner's on/off switch for it. A switch takes effect at the next service start.

Read extension state

GET /v1/extensions

Reads each running extension's health and returns it with the owner's switches.

Auth: Operator token or any device session.

Response 200

Field Type Description
schemaVersion number Always 1.
extensions object[] Up to 64 extensions.
extensions[].id string Extension id.
extensions[].state string off, starting, running, degraded or stopped.
extensions[].reason string Optional. A fixed reason code.
switches object Map of extension id to on or off. A missing entry means on.

Errors

Status error When
401 authentication_required No valid credential.
503 unavailable Extension state or settings could not be read.
sh
curl -sS http://127.0.0.1:4310/v1/extensions \
  -H "Authorization: Bearer $CLANKIE_DEVICE_TOKEN"

Switch an extension on or off

POST /v1/extensions

Saves the owner's switch for one running extension. This write takes no revision.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
schemaVersion number yes 1.
id string yes Extension id: lowercase letter first, then letters, digits or -, up to 64 characters.
switch string yes on or off.

Response 200: the extension state, as in "Read extension state", with one more field:

Field Type Description
restartRequired boolean true when the change waits for the next service start.

Errors

Status error When
404 unknown_extension No running extension has that id.
409 extension_switch_conflict The caller's authority changed, or the settings could not be written.
400 malformed The body does not match the schema.
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/extensions \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schemaVersion":1,"id":"discord","switch":"off"}'

Persona, voice and appearance

Who Clankie is, how he sounds and how he looks. These routes are served by the Discord extension.

Read persona

GET /v1/operator/persona

With an operator token, returns the full persona and the status of the persona image folder. With a device session, returns only how readily he joins in (chattiness and replyPolicy), and the revision covers only those two fields.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
revision string Revision of the persona fields returned.
persona.chattiness string quiet, balanced or chatty.
persona.replyPolicy string addressed or all.
persona.displayName string Operator only. 1 to 64 characters.
persona.aliases string[] Operator only. Other names he answers to, up to 16.
persona.characterNotes string Operator only. Owner-written character, up to 4000 characters.
persona.imagesDir string Operator only, optional. Mood board folder on the service host.
persona.liveMessageWindow number Operator only. Messages that may pass after his last reply before he stops reading a channel live, 0 to 100.
images object Operator only. Image folder status (below).

images fields: directory (optional), hash, count, vibeCount, appearanceCount, encodedBytes, files (each with name, status of loaded, skipped or error, and optional role, kind, size, frame and reason fields), optional error, description and descriptionError, and limits (the folder's numeric limits).

Errors

Status error When
401 operator_authentication_required No valid credential, no Take Control, or authority changed during the request.
503 settings_unavailable Settings could not be read.
sh
curl -sS http://127.0.0.1:4310/v1/operator/persona \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Change persona

POST /v1/operator/persona

Changes one or more persona fields. Fields left out keep their values. With a device session only chattiness and replyPolicy can be changed. Returns the new persona snapshot plus restart, a sentence saying to restart Clankie to apply persona images.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
expectedRevision string yes revision from the last read with the same credential.
persona object yes At least one field to change.
persona.chattiness string no quiet, balanced or chatty.
persona.replyPolicy string no addressed or all.
persona.displayName string no Operator only. 1 to 64 characters.
persona.aliases string[] no Operator only. Up to 16 names of 1 to 64 characters.
persona.characterNotes string no Operator only. Up to 4000 characters.
persona.imagesDir string no Operator only. Folder path, up to 4096 characters.
persona.liveMessageWindow number no Operator only. Integer from 0 to 100.

The body is limited to 24 KB.

Errors

Status error When
409 persona_settings_conflict expectedRevision does not match, or the settings changed before the write.
400 malformed The body does not match the schema for the caller.
401 operator_authentication_required No valid credential, no Take Control, or authority changed during the request.
503 settings_unavailable Settings cannot be written.
sh
curl -sS http://127.0.0.1:4310/v1/operator/persona \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":"'"$REVISION"'","persona":{"chattiness":"quiet"}}'

Read voice

GET /v1/operator/voice

Returns the saved voice settings and the settings in effect after environment overrides.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
revision string Revision of voice.
voice object Saved voice settings (fields below).
effectiveVoice object The same fields after environment overrides.
overriddenByEnvironment string[] Names of the environment variables that override saved values.

Voice fields:

Field Type Description
realtimeProvider string openai, xai or anthropic. Default openai.
ttsProvider string openai or elevenlabs. Default openai.
openAiRealtimeModel string Optional.
openAiTranscribeModel string Optional.
openAiVoice string Optional. OpenAI voice name.
xAiRealtimeModel string Optional.
anthropicModel string Optional.
xAiVoice string Optional. xAI voice id.
xAiReasoningEffort string high or none. Default high.
elevenLabsVoiceId string Optional. Required when ttsProvider is elevenlabs.
elevenLabsModelId string Optional.

Errors

Status error When
401 operator_authentication_required No valid credential, no Take Control, or authority changed during the request.
503 operator_authentication_unavailable Operator authentication is not available on this host and the caller is not authorized.
503 settings_unavailable Settings could not be read.
sh
curl -sS http://127.0.0.1:4310/v1/operator/voice \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Replace voice

POST /v1/operator/voice

Replaces the whole voice settings object. Fields left out take their defaults. The new settings are checked together with the host's environment before saving. Returns the voice snapshot plus restart, a sentence saying to restart the active Discord body to apply them.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
expectedRevision string yes revision from the last read.
voice object yes Voice fields, as in "Read voice".

Combination rules: ttsProvider: "elevenlabs" needs elevenLabsVoiceId; realtimeProvider: "xai" cannot use elevenlabs; realtimeProvider: "anthropic" needs ttsProvider: "elevenlabs". Model ids allow word characters, dots and hyphens; voice ids allow word characters and hyphens; each up to 128 characters. The body is limited to 16 KB.

Errors

Status error When
409 voice_settings_conflict expectedRevision does not match, or the settings changed before the write.
400 malformed The body does not match the schema, or a value looks like a secret.
400 text The settings are invalid once environment overrides apply; error describes the problem.
401 operator_authentication_required No valid credential, no Take Control, or authority changed during the request.
503 settings_unavailable Settings cannot be written.
sh
curl -sS http://127.0.0.1:4310/v1/operator/voice \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":"'"$REVISION"'","voice":{"realtimeProvider":"openai","ttsProvider":"openai","openAiVoice":"marin"}}'

Read appearance

GET /v1/operator/appearance

Returns how Clankie looks on every surface: the lead's skin, the desktop pet's skin and the app's navigation order.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
schemaVersion number Always 1.
revision string Revision of appearance.
appearance.leadSkin string Skin id. Default clankie.lead.hoodie.
appearance.petSkin string or null Optional. Pet skin pack id; absent or null means the original pet.
appearance.navigation string[] Optional. Primary app destinations in order: world, messages, work, terminal, settings.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/appearance \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Change appearance

POST /v1/operator/appearance

Changes one or more appearance fields. Fields left out keep their values. Returns the new snapshot.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
schemaVersion number yes 1.
expectedRevision string yes revision from the last read.
changes.leadSkin string no Skin id: lowercase letter or digit first, then letters, digits, . or -, up to 128 characters.
changes.petSkin string or null no Pet skin id in the same format, or null for the original pet.
changes.navigation string[] no 1 to 5 unique destinations from world, messages, work, terminal, settings.

changes must set at least one field.

Response 200: the appearance snapshot.

Errors

Status error When
409 appearance_conflict expectedRevision does not match, or the settings or the caller's authority changed before the write.
400 malformed The body does not match the schema, or changes is empty.
503 settings_unavailable Settings cannot be written on this host.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/operator/appearance \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schemaVersion":1,"expectedRevision":"'"$REVISION"'","changes":{"navigation":["messages","work","terminal"]}}'

Connected accounts

Clankie's own GitHub, Linear and Google connections, and the Codex homes on this Mac. Provider tokens go from the provider straight into the service's credential store and are never returned: a connection shows who, which scopes and since when, never a token.

Every response body has an ok field. Authentication failures answer {"ok": false, "error": "authentication_required"} (401) or {"ok": false, "error": "forbidden"} (403). On the POST routes, a refusal from the flow answers 400 with {"ok": false, "error": "<code>"}, and a failure the service could not complete answers 503 with error: "unavailable". A body over 16 KB (32 KB for Google complete) answers 413 with error: "malformed".

A connection object has these fields:

Field Type Description
provider string github, linear, google-gmail, google-calendar or google-drive.
status string connected, not_connected, unconfigured (no OAuth app is set up), awaiting_consent, expired, reconnect_required, unavailable or disconnected.
scopes string[] Granted scopes.
name string Optional. Display name.
group string Optional. Display group.
description string Optional. What the connection is for.
access string Optional. What Clankie can do with it.
readOnly boolean Optional.
account string Optional. The connected account's name or email.
actor string Optional. user or app.
workspace string Optional.
connectedAt string Optional. ISO timestamp.
lastCheckedAt string Optional. ISO timestamp.
reason string Optional. invalid_grant, scope_required, provider_unavailable, revocation_pending or sign_in_rejected.
revocationPending boolean Optional.
selectedFileIds string[] Optional. Google Drive files the owner picked, up to 100.
manageUrl string Optional. Where to review or revoke the grant at the provider.
installUrl string Optional. Where to install the GitHub App on more repositories.

List connections

GET /v1/accounts

Returns every connection Clankie knows about: GitHub, Linear and the three Google providers.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
connections object[] Up to 16 connection objects.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
503 unavailable Connections could not be read.
sh
curl -sS http://127.0.0.1:4310/v1/accounts \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

List Codex accounts

GET /v1/accounts/codex

Returns the Codex homes registered on this Mac, starting with the implicit default home, with sign-in and usage status.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
ok boolean true.
accounts object[] One per Codex home.
accounts[].label string Account label. default is the implicit home.
accounts[].home string Path of the Codex home on this Mac.
accounts[].authPresent boolean Whether the home has a sign-in.
accounts[].rateLimits object or null Latest usage: five_hour and seven_day (0 to 1 or null), resets.five_hour and resets.seven_day (Unix seconds or null), limited (boolean).
accounts[].observedAt string or null ISO timestamp of the usage reading.
accounts[].headroom number or null Remaining share of the tighter window, 0 to 1; null when unknown.
accounts[].hookTrust string ready, review_required or unknown.
accounts[].signInRefused boolean Optional. true when Codex refused the stored sign-in.

Errors

Status error When
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/codex \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN"

Add or remove a Codex account

POST /v1/accounts/codex

Registers another Codex home under a label, or removes a registered one. The default home cannot be added or removed.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
op string yes add or remove.
label string yes For add: lowercase letter first, then letters, digits, _ or -, up to 64 characters. For remove: the label to remove.
home string for add Path of an existing directory on this Mac. ~/ is expanded.

Response 200

Field Type Description
ok boolean true.

Errors

Status error When
400 invalid_account The home is not a directory, is the default home, or its label or home is already registered; or the label is default on remove.
400 malformed The body does not match the schema.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
503 unavailable Settings cannot be written.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/codex \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"op":"add","label":"work","home":"~/.codex-work"}'

Start a GitHub connection

POST /v1/accounts/github/start

Starts a GitHub device sign-in. Show the owner userCode and verificationUri, then call "Poll a GitHub connection" every interval seconds. Takes no body fields.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
ok boolean true.
flowId string Id of this sign-in, for polling.
userCode string The code the owner types at verificationUri.
verificationUri string GitHub's device sign-in page.
expiresAt string ISO timestamp when the flow expires.
interval number Seconds between polls, 1 to 600.

Errors

Status error When
400 unconfigured No GitHub OAuth app is set up.
400 provider_rejected GitHub refused the request.
400 unavailable GitHub could not be reached.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS -X POST http://127.0.0.1:4310/v1/accounts/github/start \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Poll a GitHub connection

POST /v1/accounts/github/poll

Checks whether the owner finished the GitHub sign-in. Answers pending until then, and the connection once it is done.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
flowId string yes flowId from the start call.

Response 200

Field Type Description
ok boolean true.
status string pending or connected.
interval number With pending: seconds to wait before the next poll.
connection object With connected: the GitHub connection object.

Errors

Status error When
400 unknown_flow No flow has that id.
400 expired The flow expired.
400 denied The owner declined at GitHub.
400 provider_rejected GitHub refused the sign-in.
400 unavailable GitHub could not be reached.
400 malformed flowId is missing or malformed.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/github/poll \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"flowId":"'"$FLOW_ID"'"}'

Start a Linear connection

POST /v1/accounts/linear/start

Starts a Linear OAuth sign-in. Open authorizeUrl for the owner; Linear redirects to redirectUri with a state and code, which go to "Complete a Linear connection". Takes no body fields.

Auth: Operator token or Device session with Take Control.

Response 200

Field Type Description
ok boolean true.
flowId string Id of this sign-in; also the OAuth state.
authorizeUrl string Linear's consent page for this flow.
redirectUri string Where Linear sends the owner back.
expiresAt string ISO timestamp when the flow expires.

Errors

Status error When
400 unconfigured No Linear OAuth app is set up, or its redirect is not a plain https URL.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS -X POST http://127.0.0.1:4310/v1/accounts/linear/start \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Complete a Linear connection

POST /v1/accounts/linear/complete

Exchanges the code Linear returned on the redirect and saves the connection. Each flow can be completed once.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
state string yes The state Linear echoed on the redirect.
code string yes The authorization code, 1 to 2048 printable characters.

Response 200

Field Type Description
ok boolean true.
connection object The Linear connection object.

Errors

Status error When
400 unknown_flow No flow has that state, or the Linear app changed since it started.
400 expired The flow expired.
400 provider_rejected Linear refused the code.
400 malformed The body does not match the schema.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/linear/complete \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"state":"'"$STATE"'","code":"'"$CODE"'"}'

Connect Linear as an app

POST /v1/accounts/linear/app

Connects Linear with an OAuth app's own client credentials, so Clankie acts as the app instead of as a user. The client secret is stored and never returned.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
clientId string yes The Linear app's client id, up to 256 characters.
clientSecret string yes The Linear app's client secret, up to 4096 characters.

Response 200

Field Type Description
ok boolean true.
connection object The Linear connection object, with actor: "app".

Errors

Status error When
400 provider_rejected Linear refused the credentials.
400 malformed The body does not match the schema.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/linear/app \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"clientId":"'"$LINEAR_CLIENT_ID"'","clientSecret":"'"$LINEAR_CLIENT_SECRET"'"}'

Start a Google connection

POST /v1/accounts/google/start

Starts a Google OAuth sign-in for one Google provider. Open authorizeUrl for the owner; the redirect's state and code go to "Complete a Google connection". Starting a new flow for a provider replaces any earlier flow for it.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
provider string yes google-gmail, google-calendar or google-drive.

Response 200

Field Type Description
ok boolean true.
flowId string Id of this sign-in; also the OAuth state.
authorizeUrl string Google's consent page for this flow.
redirectUri string Where Google sends the owner back.
expiresAt string ISO timestamp when the flow expires.

Errors

Status error When
400 unconfigured No Google OAuth app is set up.
400 unavailable A previous Google revocation is still pending, or the credential store could not be read.
400 malformed provider is missing or unknown.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/google/start \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"google-calendar"}'

Complete a Google connection

POST /v1/accounts/google/complete

Exchanges the code Google returned and saves the connection. Each flow can be completed once.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
provider string yes The provider the flow was started for.
state string yes The state Google echoed on the redirect.
code string yes The authorization code, 1 to 2048 printable characters.
pickedFileIds string[] for google-drive 1 to 100 unique file ids from the Google Picker. Required for google-drive and not allowed for the other providers.

Response 200

Field Type Description
ok boolean true.
connection object The Google connection object.

Errors

Status error When
400 unknown_flow No flow has that state for this provider, or the Google app changed since it started.
400 expired The flow expired.
400 unconfigured The Google app's client secret is not set up.
400 provider_rejected Google refused the code.
400 unavailable Google could not be reached.
400 malformed The body does not match the schema.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/google/complete \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"google-calendar","state":"'"$STATE"'","code":"'"$CODE"'"}'

Check a Google connection

POST /v1/accounts/google/check

Refreshes one Google connection's access with Google now and returns its current state.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
provider string yes google-gmail, google-calendar or google-drive.

Response 200

Field Type Description
ok boolean true.
connection object The Google connection object.

Errors

Status error When
400 denied The provider is disconnected.
400 unconfigured No Google OAuth app is set up.
400 provider_rejected Google refused the refresh.
400 unavailable Google could not be reached.
400 malformed provider is missing or unknown.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/google/check \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"google-gmail"}'

Disconnect an account

POST /v1/accounts/disconnect

Deletes the stored credential for a provider and asks the provider to revoke it. The local credential is deleted even when the provider cannot be asked. Disconnecting any Google provider disconnects all three Google connections.

Auth: Operator token or Device session with Take Control.

Request body (JSON)

Field Type Required Description
provider string yes github, linear, google-gmail, google-calendar or google-drive.

Response 200

Field Type Description
ok boolean true.
revoked boolean false when the provider could not revoke the grant.
manageUrl string Optional. With revoked: false, where the owner can revoke the grant at the provider.

Errors

Status error When
400 malformed provider is missing or unknown.
401 authentication_required No valid credential.
403 forbidden The device session lacks Take Control.
503 unavailable The disconnect could not be completed.
sh
curl -sS http://127.0.0.1:4310/v1/accounts/disconnect \
  -H "Authorization: Bearer $CLANKIE_OPERATOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"github"}'