Skip to content
Panel

API Reference Endpoints

Shells

Keep a wardrobe of versioned shells for a tunnel and choose the one the tunnel wears.

A shell is the versioned set of instructions a tunnel works with: its soul (persona and voice), head (instructions, model, effort, skills), eyes (channel accounts, tools, paths, URLs), living (runtime, machine, working directory, OS, timezone, locale, schedule) and ledger (references to secrets, never their values), plus per-runtime extensions in ext. Each tunnel keeps up to 20 shells in its wardrobe and wears exactly one at a time; when an agent calls the MCP tool line_attach, the run instructions it receives are built from the persona, voice and head of the worn shell. Reads accept the account root key or a key of the tunnel; every write needs the account root key with the keys:rw scope.

In every path, :id is a tunnel id. A tunnel key or test key may also use me for its own tunnel.

#The shell manifest

GET /v1/lines/:id/shell, GET /v1/lines/:id/shells/:shell_id and every write return a shell in the open mot.shell/v1 format.

NameTypeDescription
formatstringAlways mot.shell/v1.
shell_iduuidId of the shell.
lineobjectline_id, handle and address of the tunnel that owns the shell.
labelstringName of the shell, unique within the wardrobe (up to 80 characters).
notestring or nullFree note (up to 200 characters).
versionintegerStarts at 1 and goes up by one with every change of parts.
originstringborn (first shell of a new tunnel), owner (created through this API) or migrated.
origin_snapshotobject or nullSet only for a migrated shell.
wornbooleantrue when the tunnel wears this shell now.
parts_sha256stringHex SHA-256 fingerprint of the parts. Compare for equality only.
soulobjectpersona and voice, each with mode, version and resolved, plus behaviour.
headobjectinstructions, model, effort (low, medium, high, max), skills.
eyesobjectchannels (channel account ids wired to this tunnel), tools, paths, urls.
livingobjectruntime, runs_on, workdir, os (windows, linux, macos, android, ios, any), timezone, locale, schedule.
ledgerarrayEntries {name, ref, provider, purpose, resolved}. resolved holds kind, held_by (hub or runtime), provider and status; never a secret value.
extobjectRuntime name to object, up to 8000 bytes.
created_at, updated_atstringISO 8601 timestamps.

Persona mode is follow (the current signed persona of the tunnel) or pinned (a given version from the tunnel's history). Voice mode is follow (the newest voice of the tunnel), pinned or none. A pinned part names its version; follow and none carry version: null.

A ledger ref must be a reference: byok:<uuid>, account:<uuid>, env:NAME, vault:<path>, keychain:<name>, file:<path> or op://<item>. byok: and account: references must point to an active credential or channel account of the same account.

#List shells

GET /v1/lines/:id/shells

Returns the wardrobe of a tunnel: every shell without the content of its parts, and which shell the tunnel wears. Use it to pick a shell to read, edit or wear.

Authentication: root key (any tunnel of the account), tunnel key or test key (its own tunnel only).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/shells \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "handle": "support@",
  "max": 20,
  "worn": {
    "shell_id": "8a1c4e2f-5b3d-4c6e-9f7a-2b1c3d4e5f60",
    "epoch": 3,
    "worn_at": "2026-10-14T09:12:40Z"
  },
  "shells": [
    {
      "shell_id": "8a1c4e2f-5b3d-4c6e-9f7a-2b1c3d4e5f60",
      "label": "Shell 1",
      "note": null,
      "version": 4,
      "origin": "born",
      "worn": true,
      "parts_sha256": "9c1d0e5f7a3b2c4d6e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d",
      "persona": { "mode": "follow", "version": 2 },
      "voice": { "mode": "follow", "version": 1 },
      "filled": ["head", "living", "ledger"],
      "ledger_refs": 1,
      "created_at": "2026-10-01T08:00:00Z",
      "updated_at": "2026-10-14T09:10:02Z"
    }
  ],
  "measured_at": "2026-10-16T10:00:00Z"
}

filled lists the parts that hold content, in the order head, eyes, living, ledger, ext. ledger_refs is the number of ledger entries. persona.version and voice.version are the versions the shell gives right now (voice.version is null for none).

Error 404

JSON
{"error":{"status":404,"reason":"line_not_found","message":"No such line in this account."}}

#Create a shell

POST /v1/lines/:id/shells

Adds a new shell to the wardrobe of a tunnel. label is required; a part you leave out gets its default (empty) value. The tunnel keeps wearing its current shell until you wear the new one.

Authentication: root key with the keys:rw scope. Tunnel keys and test keys get 403 key_kind_not_allowed.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
labelbodystringyes1 to 80 characters, unique within the wardrobe.
formatbodystringnoIf sent, must be mot.shell/v1.
notebodystring or nullnoUp to 200 characters.
soulbodyobject or nullno{persona: {mode, version}, voice: {mode, version}, behaviour}. behaviour up to 8000 characters. A pinned version must exist in this tunnel's history.
headbodyobject or nullnoinstructions (up to 16 000 characters), model (up to 80), effort, skills (up to 50).
eyesbodyobject or nullnochannels (up to 50, each wired to this tunnel), tools (up to 100), paths (up to 50), urls (up to 50, http or https).
livingbodyobject or nullnoruntime, runs_on, workdir, os, timezone, locale, schedule.
ledgerbodyarray or nullnoUp to 50 entries {name, ref, provider, purpose}, one per name.
extbodyobject or nullnoRuntime name to object, up to 8000 bytes.

The whole body is scanned for secrets before anything else: a value shaped like a key or token, or a field named like a secret (password, token, api_key and similar) whose value is not a ledger reference, is refused with 400 shell_secret_value and the path of the field. The value never comes back. All parts together take at most 60 000 bytes (400 shell_too_large). Unknown fields are refused with 400 bad_shell_field.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/shells \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{
    "label": "Night shift",
    "head": { "instructions": "Answer support mail. Escalate refunds to the owner.", "model": "claude-sonnet-4-5", "effort": "medium", "skills": [] },
    "living": { "runtime": "claude-code", "timezone": "Europe/London", "locale": "en-GB" },
    "ledger": [ { "name": "MODEL_KEY", "ref": "env:ANTHROPIC_API_KEY", "provider": "anthropic", "purpose": "model calls" } ]
  }'

Response 200

The response is the shell manifest of the new shell with two extra fields: replay (false) and created (true).

JSON
{
  "replay": false,
  "created": true,
  "format": "mot.shell/v1",
  "shell_id": "c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
  "line": { "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d", "handle": "support@", "address": "support@mot.email" },
  "label": "Night shift",
  "note": null,
  "version": 1,
  "origin": "owner",
  "origin_snapshot": null,
  "worn": false,
  "parts_sha256": "4e7a1c9b2d3f5a6b8c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b",
  "soul": {
    "persona": {
      "mode": "follow",
      "version": null,
      "resolved": {
        "version": 2,
        "signed": true,
        "alg": "ed25519",
        "manifest_sha256": "b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2",
        "signature": "o4Jx0p8mJb3yYc1T2kR1u0f6bq9cF5i3m3W0yGx2b7h1s4nV0p9a2t6Lq3eZ8wK4cD1fH5jN7rU2vX9yA0bC1dE==",
        "public_key": "Q2x4dGZ1bm5vdGFyZWFsa2V5anVzdGFwbGFjZWhvbGQ=",
        "manifest": "You are the support line. Be brief and exact."
      }
    },
    "voice": {
      "mode": "follow",
      "version": null,
      "resolved": {
        "version": 1,
        "engine": "browser",
        "voice_ref": "mot:neutral",
        "pitch_semitones": 0.0,
        "rate": 1.00,
        "note": "mixer voice neutral",
        "created_at": "2026-10-02T10:00:00Z"
      }
    },
    "behaviour": null
  },
  "head": { "instructions": "Answer support mail. Escalate refunds to the owner.", "model": "claude-sonnet-4-5", "effort": "medium", "skills": [] },
  "eyes": { "channels": [], "tools": [], "paths": [], "urls": [] },
  "living": { "runtime": "claude-code", "runs_on": null, "workdir": null, "os": null, "timezone": "Europe/London", "locale": "en-GB", "schedule": null },
  "ledger": [
    {
      "name": "MODEL_KEY",
      "ref": "env:ANTHROPIC_API_KEY",
      "provider": "anthropic",
      "purpose": "model calls",
      "resolved": { "kind": "env", "held_by": "runtime", "provider": null, "status": "local" }
    }
  ],
  "ext": {},
  "created_at": "2026-10-16T10:00:00Z",
  "updated_at": "2026-10-16T10:00:00Z",
  "measured_at": "2026-10-16T10:00:00Z"
}

Error 400

JSON
{"error":{"status":400,"reason":"shell_secret_value","message":"A shell never carries secret values. Put a reference in the ledger instead (byok:<id>, account:<id>, env:NAME, vault:path, keychain:name, file:path or op://…). See path.","path":"$.ledger[0].ref"}}

Other refusals: 409 wardrobe_full (20 shells, with max), 409 shell_label_taken, 400 label_required, 400 ledger_ref_not_reference, 409 ledger_ref_unknown, 409 eyes_channel_not_wired, 404 soul_version_not_found, 404 voice_version_not_found, 409 line_archived. Shape errors of a part carry the path of the field.

#Retrieve a shell

GET /v1/lines/:id/shells/:shell_id

Returns the full mot.shell/v1 manifest of one shell from the tunnel's wardrobe, worn or not.

Authentication: root key (any tunnel of the account), tunnel key or test key (its own tunnel only).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.
shell_idpathuuidyesA shell from this tunnel's wardrobe.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/shells/c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

The shell manifest, as in Create a shell above, without replay and created.

JSON
{
  "format": "mot.shell/v1",
  "shell_id": "c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
  "line": { "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d", "handle": "support@", "address": "support@mot.email" },
  "label": "Night shift",
  "note": null,
  "version": 1,
  "origin": "owner",
  "origin_snapshot": null,
  "worn": false,
  "parts_sha256": "4e7a1c9b2d3f5a6b8c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b",
  "soul": { "persona": { "mode": "follow", "version": null, "resolved": { "version": 2, "signed": true, "alg": "ed25519", "manifest_sha256": "b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2", "signature": "o4Jx0p8mJb3yYc1T2kR1u0f6bq9cF5i3m3W0yGx2b7h1s4nV0p9a2t6Lq3eZ8wK4cD1fH5jN7rU2vX9yA0bC1dE==", "public_key": "Q2x4dGZ1bm5vdGFyZWFsa2V5anVzdGFwbGFjZWhvbGQ=", "manifest": "You are the support line. Be brief and exact." } },
            "voice": { "mode": "none", "version": null, "resolved": null },
            "behaviour": null },
  "head": { "instructions": "Answer support mail. Escalate refunds to the owner.", "model": "claude-sonnet-4-5", "effort": "medium", "skills": [] },
  "eyes": { "channels": [], "tools": [], "paths": [], "urls": [] },
  "living": { "runtime": "claude-code", "runs_on": null, "workdir": null, "os": null, "timezone": "Europe/London", "locale": "en-GB", "schedule": null },
  "ledger": [],
  "ext": {},
  "created_at": "2026-10-16T10:00:00Z",
  "updated_at": "2026-10-16T10:00:00Z",
  "measured_at": "2026-10-16T10:05:00Z"
}

Error 404

JSON
{"error":{"status":404,"reason":"shell_not_found","message":"There is no such shell in the wardrobe of this line."}}

A shell of another tunnel answers 404 shell_not_found as well.

#Update a shell

PATCH /v1/lines/:id/shells/:shell_id

Writes new parts to a shell and raises its version by one. A part you send replaces that whole part; a part you leave out stays as it is; a part sent as null goes back to its default. Sending the same content as the current version leaves the shell as it is and returns replay: true.

Authentication: root key with the keys:rw scope.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
shell_idpathuuidyesA shell from this tunnel's wardrobe.
expected_versionbodyintegernoWrite only if the shell is still at this version, otherwise 409 shell_version_conflict.
label, note, format, soul, head, eyes, living, ledger, extbodynoSame rules as in Create a shell above.

Request

bash
curl -sS -X PATCH https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/shells/c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"expected_version": 1, "head": {"instructions": "Answer support mail in English and Spanish.", "effort": "high"}}'

Response 200

The shell manifest with replay and created (false), showing the new version.

JSON
{
  "replay": false,
  "created": false,
  "format": "mot.shell/v1",
  "shell_id": "c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
  "line": { "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d", "handle": "support@", "address": "support@mot.email" },
  "label": "Night shift",
  "note": null,
  "version": 2,
  "origin": "owner",
  "origin_snapshot": null,
  "worn": false,
  "parts_sha256": "7d2e9f1a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e",
  "soul": { "persona": { "mode": "follow", "version": null, "resolved": { "version": 2, "signed": true, "alg": "ed25519", "manifest_sha256": "b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2", "signature": "o4Jx0p8mJb3yYc1T2kR1u0f6bq9cF5i3m3W0yGx2b7h1s4nV0p9a2t6Lq3eZ8wK4cD1fH5jN7rU2vX9yA0bC1dE==", "public_key": "Q2x4dGZ1bm5vdGFyZWFsa2V5anVzdGFwbGFjZWhvbGQ=", "manifest": "You are the support line. Be brief and exact." } },
            "voice": { "mode": "none", "version": null, "resolved": null },
            "behaviour": null },
  "head": { "instructions": "Answer support mail in English and Spanish.", "model": null, "effort": "high", "skills": [] },
  "eyes": { "channels": [], "tools": [], "paths": [], "urls": [] },
  "living": { "runtime": "claude-code", "runs_on": null, "workdir": null, "os": null, "timezone": "Europe/London", "locale": "en-GB", "schedule": null },
  "ledger": [],
  "ext": {},
  "created_at": "2026-10-16T10:00:00Z",
  "updated_at": "2026-10-16T10:20:00Z",
  "measured_at": "2026-10-16T10:20:00Z"
}

head.model is null above because the new head replaced the whole part and did not name a model.

Error 409

JSON
{"error":{"status":409,"reason":"shell_version_conflict","message":"The shell changed since you read it. Read it again (current_version) and retry.","current_version":3}}

#Retrieve the worn shell

GET /v1/lines/:id/shell

Returns the mot.shell/v1 manifest of the shell the tunnel wears now. A runtime uses it to load what the tunnel should be for this run.

Authentication: root key (any tunnel of the account), tunnel key or test key (its own tunnel only).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/me/shell \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

The shell manifest of the worn shell ("worn": true), with measured_at. Same shape as Retrieve a shell above.

JSON
{
  "format": "mot.shell/v1",
  "shell_id": "8a1c4e2f-5b3d-4c6e-9f7a-2b1c3d4e5f60",
  "line": { "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d", "handle": "support@", "address": "support@mot.email" },
  "label": "Shell 1",
  "note": null,
  "version": 4,
  "origin": "born",
  "origin_snapshot": null,
  "worn": true,
  "parts_sha256": "9c1d0e5f7a3b2c4d6e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d",
  "soul": { "persona": { "mode": "follow", "version": null, "resolved": { "version": 2, "signed": true, "alg": "ed25519", "manifest_sha256": "b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2", "signature": "o4Jx0p8mJb3yYc1T2kR1u0f6bq9cF5i3m3W0yGx2b7h1s4nV0p9a2t6Lq3eZ8wK4cD1fH5jN7rU2vX9yA0bC1dE==", "public_key": "Q2x4dGZ1bm5vdGFyZWFsa2V5anVzdGFwbGFjZWhvbGQ=", "manifest": "You are the support line. Be brief and exact." } },
            "voice": { "mode": "follow", "version": null, "resolved": { "version": 1, "engine": "browser", "voice_ref": "mot:neutral", "pitch_semitones": 0.0, "rate": 1.00, "note": "mixer voice neutral", "created_at": "2026-10-02T10:00:00Z" } },
            "behaviour": "Short answers. No small talk." },
  "head": { "instructions": "Answer support mail. Escalate refunds to the owner.", "model": "claude-sonnet-4-5", "effort": "medium", "skills": [] },
  "eyes": { "channels": [], "tools": [], "paths": [], "urls": [] },
  "living": { "runtime": "claude-code", "runs_on": null, "workdir": null, "os": "linux", "timezone": "Europe/London", "locale": "en-GB", "schedule": null },
  "ledger": [],
  "ext": {},
  "created_at": "2026-10-01T08:00:00Z",
  "updated_at": "2026-10-14T09:10:02Z",
  "measured_at": "2026-10-16T10:00:00Z"
}

Error 403

JSON
{"error":{"status":403,"reason":"key_kind_not_allowed","message":"This kind of key cannot do this. Use a tunnel key or the account root key."}}

#Wear a shell

PUT /v1/lines/:id/shell

Makes the tunnel wear another shell from its wardrobe in one call. The tunnel keeps its address, memory, log and cable lease; only the worn shell changes, the wear epoch goes up by one and a line.shell_worn event is recorded. Wearing the shell the tunnel already wears returns replay: true and leaves the tunnel as it is.

Authentication: root key with the keys:rw scope.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
shell_idbodyuuidyesA shell from this tunnel's wardrobe.
reasonbodystringnoUp to 200 characters, kept with the change.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/shell \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"shell_id": "c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f", "reason": "night shift starts"}'

Response 200

NameTypeDescription
replaybooleantrue when the tunnel already wore this shell.
line_iduuidThe tunnel.
shell_iduuidThe shell the tunnel wears now.
epochintegerWear counter of the tunnel.
from_shell_iduuid or nullThe shell worn before; null on a replay.
shellobjectThe shell manifest of the worn shell.
JSON
{
  "replay": false,
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "shell_id": "c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
  "epoch": 4,
  "from_shell_id": "8a1c4e2f-5b3d-4c6e-9f7a-2b1c3d4e5f60",
  "shell": {
    "format": "mot.shell/v1",
    "shell_id": "c4d5e6f7-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
    "line": { "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d", "handle": "support@", "address": "support@mot.email" },
    "label": "Night shift",
    "note": null,
    "version": 2,
    "origin": "owner",
    "origin_snapshot": null,
    "worn": true,
    "parts_sha256": "7d2e9f1a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e",
    "soul": { "persona": { "mode": "follow", "version": null, "resolved": { "version": 2, "signed": true, "alg": "ed25519", "manifest_sha256": "b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2", "signature": "o4Jx0p8mJb3yYc1T2kR1u0f6bq9cF5i3m3W0yGx2b7h1s4nV0p9a2t6Lq3eZ8wK4cD1fH5jN7rU2vX9yA0bC1dE==", "public_key": "Q2x4dGZ1bm5vdGFyZWFsa2V5anVzdGFwbGFjZWhvbGQ=", "manifest": "You are the support line. Be brief and exact." } },
              "voice": { "mode": "none", "version": null, "resolved": null },
              "behaviour": null },
    "head": { "instructions": "Answer support mail in English and Spanish.", "model": null, "effort": "high", "skills": [] },
    "eyes": { "channels": [], "tools": [], "paths": [], "urls": [] },
    "living": { "runtime": "claude-code", "runs_on": null, "workdir": null, "os": null, "timezone": "Europe/London", "locale": "en-GB", "schedule": null },
    "ledger": [],
    "ext": {},
    "created_at": "2026-10-16T10:00:00Z",
    "updated_at": "2026-10-16T10:20:00Z"
  },
  "measured_at": "2026-10-16T10:30:00Z"
}

Error 404

JSON
{"error":{"status":404,"reason":"shell_not_found","message":"There is no such shell in the wardrobe of this line."}}

A missing shell_id is refused with 400 bad_shell_id; an archived tunnel with 409 line_archived.