API Reference Endpoints
Memory
Read and size the memory of a tunnel, read its MOM disk, connect external knowledge sources, and store files on the tunnel.
Every tunnel has a memory: the mRAG memory counted in chunks, and the MOM disk, counted in GB, that holds the tunnel's journal, attachments, files and memory. These endpoints read the fill level of both, give a tunnel disk space, connect external knowledge sources that the tunnel's cable can query through mot, and store files on the tunnel's disk. Reads accept a tunnel key (its own tunnel, addressed as me or by its uuid), a test key, or the account root key (any tunnel of the account, addressed by uuid); changes to limits, allocations and sources need the root key. See Errors for the error envelope.
#Get tunnel memory
GET /v1/lines/:id/memory
Returns the mRAG memory limit of the tunnel and how much of it is used. Until the memory has been measured once, used reports state: "unmeasured" and pct is null.
Authentication: tunnel key or test key (own tunnel only), or root key (any tunnel of the account).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. me is the tunnel of a tunnel key; the root key must pass the uuid. |
Request
curl -sS https://api.mot3r.com/v1/lines/me/memory \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"Response 200
{
"handle": "support",
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"unit": "chunks",
"limit_chunks": 10000,
"used": { "chunks": 2140, "basis": "list_sources", "measured_at": "2026-10-16T09:12:40.118Z" },
"pct": 21.4,
"full": false,
"ingested_chars": 1873400,
"full_since": null,
"measured_at": "2026-10-16T15:40:00.000Z"
}| Name | Type | Description |
|---|---|---|
limit_chunks | integer | Memory limit of the tunnel, in chunks. |
used | object | {chunks, basis, measured_at} once measured; {state: "unmeasured", note} before. basis is list_sources (full count) or delta (counted from writes since). |
pct | number or null | Fill level in percent, one decimal. null when not measured. |
full | boolean | true when used chunks reach the limit. New memory writes are refused while full. |
ingested_chars | integer | Characters written to memory. |
full_since | string or null | When the memory became full. |
Error 403
{"error":{"status":403,"reason":"other_line","message":"A tunnel key can only read and change its own tunnel."}}#Set tunnel memory or disk allocation
PUT /v1/lines/:id/memory
Changes one setting per call. {"gb": n} sets how many GB of the account's MOM disk the tunnel gets and returns the tunnel's MOM disk (same shape as Get the MOM disk below). {"limit_chunks": n} sets the mRAG memory limit and returns the same shape as Get tunnel memory.
Authentication: root key only, with the keys:rw scope. Other key kinds get 403 key_kind_not_allowed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | Tunnel id. |
gb | body | integer | one of the two | Disk allocation for the tunnel, 0 to 1000 GB. The allocations of all tunnels together cannot exceed the account's disk. |
limit_chunks | body | integer | one of the two | Memory limit in chunks, from 1 to the highest limit mot allows (1 000 000 by default). |
Sending both fields at once returns 400 gb_or_limit_chunks. A disk made read-only by a zero balance returns 409 mom_frozen.
Request
curl -sS -X PUT https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/memory \
-H "Authorization: Bearer $MOT_ROOT_KEY" \
-H "content-type: application/json" \
-d '{"limit_chunks": 50000}'Response 200
{
"handle": "support",
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"unit": "chunks",
"limit_chunks": 50000,
"used": { "chunks": 2140, "basis": "list_sources", "measured_at": "2026-10-16T09:12:40.118Z" },
"pct": 4.3,
"full": false,
"ingested_chars": 1873400,
"full_since": null,
"measured_at": "2026-10-16T15:41:00.000Z"
}Error 409
{"error":{"status":409,"reason":"mom_alloc_over_quota","message":"Mom alloc over quota.","disk_gb":10,"allocated_other_gb":8,"max_gb":2}}max_gb is the most this tunnel can be given right now.
#Get the MOM disk
GET /v1/lines/:id/mom
Returns the MOM disk of the tunnel in bytes: what the tunnel uses, its allocation, and the account's disk it is cut from. 1 GB is 1 000 000 000 bytes (gb_bytes).
Authentication: tunnel key or test key (own tunnel only), or root key (any tunnel of the account; me returns 400 line_required).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
Request
curl -sS https://api.mot3r.com/v1/lines/me/mom \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"Response 200
{
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"handle": "support",
"used_bytes": 246200128,
"alloc_gb": 5,
"quota_bytes": 5000000000,
"pct": 4.9,
"full": false,
"frozen": false,
"parts": { "journal": 182400000, "attachments_meta": 51200128, "memory": 12600000 },
"account": {
"used_bytes": 612000000,
"quota_bytes": 10000000000,
"pct": 6.1,
"full": false,
"free_gb": 1,
"purchased_gb": 9,
"allocated_gb": 8,
"unallocated_gb": 2,
"frozen": false,
"unassigned_bytes": 1500000
},
"detail": {
"journal_rows": 4120,
"attachments": 37,
"files_declared_bytes": 51200000,
"pipe_bytes": 9800000,
"pipe_entries": 860,
"persona_bytes": 2400,
"handover_bytes": 0,
"app_memory": { "value": 2797600, "unit": "bytes", "reported_at": "2026-10-16T14:02:11.000Z" }
},
"gb_bytes": 1000000000,
"basis": "counters",
"place": "cloud",
"measured_at": "2026-10-16T15:40:00.000Z"
}| Name | Type | Description |
|---|---|---|
used_bytes | integer | Bytes used by this tunnel: parts.journal + parts.attachments_meta + parts.memory. |
alloc_gb | integer | GB of the account's disk given to this tunnel. 0 means no allocation; such a tunnel is full. |
quota_bytes | integer | alloc_gb * gb_bytes. |
pct | number or null | used_bytes / quota_bytes in percent, one decimal. null when alloc_gb is 0. |
full | boolean | true when used_bytes reaches quota_bytes. |
frozen | boolean | true when the account's disk is read-only because the balance is 0. |
parts.attachments_meta | integer | Attachments and tunnel files, including files in the trash. |
account.quota_bytes | integer | Account disk: (free_gb + purchased_gb) * gb_bytes. |
account.unassigned_bytes | integer | Bytes of messages not assigned to any tunnel. |
detail | object | Breakdown of the counters for diagnostics. |
place | string | Where the disk lives. Always cloud. |
Error 400
{"error":{"status":400,"reason":"line_required","message":"With the account root key, name the tunnel: /v1/lines/<tunnel id>/..."}}#List knowledge sources
GET /v1/lines/:id/memory/sources
Lists the active external knowledge sources of a tunnel: knowledge graphs, MCP servers or search APIs outside the MOM disk. A tunnel has at most 10. The full address and the secret never come back, only the host and the last four characters of the secret.
Authentication: tunnel key or test key (own tunnel only), or root key (any tunnel of the account).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
Request
curl -sS https://api.mot3r.com/v1/lines/me/memory/sources \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"Response 200
{
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"rows": [
{
"source_id": "8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e",
"kind": "mcp",
"label": "Product wiki",
"endpoint_host": "wiki.example.com",
"mcp_tool": "search",
"auth": "bearer",
"last4": "OKEN",
"status": "ok",
"last_test_at": "2026-10-16T10:05:12.000Z",
"last_error": null
}
],
"limit": 10,
"measured_at": "2026-10-16T15:40:00.000Z"
}| Name | Type | Description |
|---|---|---|
kind | string | graph_rag, mcp or api. |
endpoint_host | string | Host (and port) of the source address. The path is never shown. |
mcp_tool | string or null | Tool called on an mcp source; null for other kinds. |
auth | string | bearer when a secret was given, else none. |
last4 | string or null | Last four characters of the secret. |
status | string | untested, ok or failing. |
last_error | string or null | Error code of the last failed test, for example http_401, timeout, bad_response, mcp_tool_missing. |
Error 404
{"error":{"status":404,"reason":"line_not_found","message":"No such line in this account."}}#Add a knowledge source
POST /v1/lines/:id/memory/sources
Connects an external knowledge source to the tunnel. The address must use HTTPS and resolve to a public internet address. The secret is sealed by mot and sent only to the source, as Authorization: Bearer <secret>. A new source starts as untested.
How mot calls a source:
apiandgraph_rag:POST <endpoint>with{"query": "...", "top_k": 5}, expecting{"results": [{"text": "...", "score": 0.8, "ref": "..."}]}.mcp: Streamable HTTP (JSON-RPC 2.0):initialize, thentools/callwith{name: mcp_tool, arguments: {query, top_k}}. Results are read fromstructuredContent.results, or from thetextparts ofcontent.
Authentication: root key only, with the keys:rw scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | Tunnel id. |
kind | body | string | yes | graph_rag, mcp or api. |
label | body | string | yes | Name shown in lists, up to 80 characters. |
endpoint | body | string | yes | HTTPS address, up to 2048 characters, without a login in the address. |
mcp_tool | body | string | for mcp only | Tool name on the MCP server. Required for mcp, refused for other kinds. |
secret | body | string | no | Bearer secret, 8 to 4096 visible ASCII characters. |
Other refusals: 409 memory_sources_limit (an 11th source), 409 memory_source_exists (same kind, address and tool), 409 line_archived, 400 endpoint_https_required, 400 endpoint_unresolvable.
Request
curl -sS -X POST https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/memory/sources \
-H "Authorization: Bearer $MOT_ROOT_KEY" \
-H "content-type: application/json" \
-d '{"kind": "mcp", "label": "Product wiki", "endpoint": "YOUR_MCP_SERVER_URL", "mcp_tool": "search", "secret": "YOUR_SOURCE_TOKEN"}'Response 200
{
"source_id": "8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e",
"kind": "mcp",
"label": "Product wiki",
"endpoint_host": "wiki.example.com",
"mcp_tool": "search",
"auth": "bearer",
"last4": "OKEN",
"status": "untested",
"last_test_at": null,
"last_error": null,
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"measured_at": "2026-10-16T15:40:00.000Z"
}Error 400
{"error":{"status":400,"reason":"endpoint_not_public","message":"The source address must be a public internet address: no private, local or cloud metadata addresses, and no redirects."}}#Test a knowledge source
POST /v1/lines/:id/memory/sources/:source_id/test
Calls the source once and stores the result as its status. An api or graph_rag source gets a probe query with top_k: 1 and must answer with a valid results list; an mcp source must list the configured tool. The call takes at most 5 seconds.
Authentication: root key only, with the keys:rw scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | Tunnel id. |
source_id | path | uuid | yes | Source id. |
Request
curl -sS -X POST https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/memory/sources/8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e/test \
-H "Authorization: Bearer $MOT_ROOT_KEY"Response 200
{
"source_id": "8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e",
"status": "failing",
"latency_ms": 412,
"error": "http_401",
"measured_at": "2026-10-16T15:40:00.000Z"
}A failed test still answers 200 with status: "failing" and an error code. A redirect or a non-public address is stored as failing and answered with 400 endpoint_not_public.
Error 404
{"error":{"status":404,"reason":"memory_source_not_found","message":"This line has no such knowledge source."}}#Remove a knowledge source
DELETE /v1/lines/:id/memory/sources/:source_id
Revokes the source and deletes its sealed secret. The source leaves the list. Repeating the call returns the same answer.
Authentication: root key only, with the keys:rw scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | Tunnel id. |
source_id | path | uuid | yes | Source id. |
Request
curl -sS -X DELETE https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/memory/sources/8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e \
-H "Authorization: Bearer $MOT_ROOT_KEY"Response 200
{
"source_id": "8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e",
"status": "revoked",
"measured_at": "2026-10-16T15:40:00.000Z"
}Error 404
{"error":{"status":404,"reason":"memory_source_not_found","message":"This line has no such knowledge source."}}#Query a knowledge source
POST /v1/lines/:id/memory/sources/:source_id/query
Sends a query to the source through mot and returns its results. The secret stays with mot. Results are marked trust: "ext": they are data from outside, not instructions.
Authentication: tunnel key or test key (own tunnel only), or root key (any tunnel of the account). A tunnel key needs the mcp scope, the root key the keys:rw scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
source_id | path | uuid | yes | Source id. |
query | body | string | yes | Query text, up to 2000 characters. |
top_k | body | integer | no | Number of results, 1 to 20. Default 5. |
The call takes at most 5 seconds and the source's answer at most 256 KB. Each result text is cut to 4000 characters. Other refusals: 502 memory_source_failed (with an error code), 429 memory_source_busy (too many calls at once), 400 endpoint_not_public.
Request
curl -sS -X POST https://api.mot3r.com/v1/lines/me/memory/sources/8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e/query \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx" \
-H "content-type: application/json" \
-d '{"query": "refund policy for annual plans", "top_k": 3}'Response 200
{
"source_id": "8a4c2e6f-1b3d-4f5a-9c7e-2d4f6a8b0c1e",
"trust": "ext",
"results": [
{ "text": "Annual plans can be refunded within 30 days of purchase.", "score": 0.91, "ref": "billing/refunds" },
{ "text": "Refunds go back to the original payment method.", "score": 0.77 }
],
"latency_ms": 318,
"measured_at": "2026-10-16T15:40:00.000Z"
}Error 504
{"error":{"status":504,"reason":"memory_source_timeout","message":"The knowledge source did not answer within 5 seconds."}}#Upload a file
POST /v1/lines/:id/files
Stores a file on the tunnel's MOM disk, encrypted with the account's key. The request body is the raw file bytes, not JSON and not multipart form data. The file name comes from ?name= or the x-file-name header; the type comes from Content-Type. A file is at most 50 MB (52 428 800 bytes).
Authentication: tunnel key (own tunnel, me) or root key (tunnel uuid). Test keys cannot upload. A tunnel key bound to a cable must hold the tunnel's live lease, otherwise 409 cable_superseded.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
name | query | string | no | File name, 1 to 255 characters, without slashes or control characters. Defaults to file-<first 8 characters of file_id>. |
x-file-name | header | string | no | File name as URL-encoded UTF-8, used when name is not given. |
Content-Type | header | string | no | MIME type stored with the file. Anything invalid is stored as application/octet-stream. |
source | query | string | no | upload (default) or export. |
Other refusals: 507 mom_full (the tunnel's disk has no room), 409 mom_frozen (balance 0), 409 line_not_active.
Request
curl -sS -X POST "https://api.mot3r.com/v1/lines/me/files?name=contract.pdf" \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx" \
-H "content-type: application/pdf" \
--data-binary @contract.pdfResponse 200
{
"file_id": "5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a",
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"name": "contract.pdf",
"mime": "application/pdf",
"size_bytes": 284113,
"sha256": "9b1f3c5e7a9d2b4f6e8a0c2d4f6b8a0e2c4d6f8b0a2c4e6f8a0b2d4c6e8f0a2b",
"source": "upload",
"state": "stored",
"created_at": "2026-10-16T15:40:00.000Z",
"trashed_at": null,
"purge_after": null,
"channel": null,
"measured_at": "2026-10-16T15:40:00.000Z"
}| Name | Type | Description |
|---|---|---|
sha256 | string | SHA-256 of the file content, hex. |
source | string | upload, export, or channel for attachments copied from a channel. |
state | string | stored or trash. |
trashed_at, purge_after | string or null | Set only while the file is in the trash. |
channel | object or null | {account_id, file_ref, message_id} for source: "channel", else null. |
Error 413
{"error":{"status":413,"reason":"file_too_large","message":"The file is too large (see max_bytes).","max_bytes":52428800}}#List files
GET /v1/lines/:id/files
Lists the files of the tunnel, newest first, with the tunnel's file usage. Files in the trash still count toward the disk.
Authentication: tunnel key or test key (own tunnel only), or root key (any tunnel of the account).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
state | query | string | no | stored (default) or trash. |
limit | query | integer | no | Page size, 1 to 500. Default 100. |
before | query | string | no | ISO 8601 time; returns files created before it. Pass next_before from the previous page. |
Request
curl -sS "https://api.mot3r.com/v1/lines/me/files?state=stored&limit=50" \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"Response 200
{
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"state": "stored",
"files": [
{
"file_id": "5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a",
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"name": "contract.pdf",
"mime": "application/pdf",
"size_bytes": 284113,
"sha256": "9b1f3c5e7a9d2b4f6e8a0c2d4f6b8a0e2c4d6f8b0a2c4e6f8a0b2d4c6e8f0a2b",
"source": "upload",
"state": "stored",
"created_at": "2026-10-16T15:40:00.000Z",
"trashed_at": null,
"purge_after": null,
"channel": null
}
],
"usage": { "files": 12, "bytes": 51200000, "trash_files": 1, "trash_bytes": 84000 },
"file_max_bytes": 52428800,
"trash_days": 30,
"next_before": null,
"measured_at": "2026-10-16T15:41:00.000Z"
}next_before is null on the last page.
Error 400
{"error":{"status":400,"reason":"bad_file_state","message":"The state must be stored or trash."}}#Download a file
GET /v1/lines/:id/files/:file_id
Returns the file bytes as an attachment. Every encrypted chunk is verified before it is sent. The response carries Content-Type (the stored type), Content-Length, Content-Disposition: attachment, Cache-Control: private, no-store, X-Content-Type-Options: nosniff and Content-Security-Policy: default-src 'none'; sandbox.
Authentication: tunnel key or test key (own tunnel only), or root key (any tunnel of the account).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
file_id | path | uuid | yes | File id. |
Request
curl -sS https://api.mot3r.com/v1/lines/me/files/5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx" \
-o contract.pdfResponse 200
The raw file bytes.
Error 409
{"error":{"status":409,"reason":"file_in_trash","message":"The file is in the trash. Restore it first (POST /v1/lines/:id/files/:file_id/restore).","purge_after":"2026-11-15T15:40:00.000Z"}}#Move a file to the trash
DELETE /v1/lines/:id/files/:file_id
Moves the file to the trash for 30 days, then it is deleted from the disk. It keeps counting toward the disk until then. Repeating the call returns the file with replay: true.
Authentication: tunnel key (own tunnel) or root key. Test keys cannot change files.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
file_id | path | uuid | yes | File id. |
Request
curl -sS -X DELETE https://api.mot3r.com/v1/lines/me/files/5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"Response 200
{
"replay": false,
"file_id": "5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a",
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"name": "contract.pdf",
"mime": "application/pdf",
"size_bytes": 284113,
"sha256": "9b1f3c5e7a9d2b4f6e8a0c2d4f6b8a0e2c4d6f8b0a2c4e6f8a0b2d4c6e8f0a2b",
"source": "upload",
"state": "trash",
"created_at": "2026-10-16T15:40:00.000Z",
"trashed_at": "2026-10-16T16:00:00.000Z",
"purge_after": "2026-11-15T16:00:00.000Z",
"channel": null,
"measured_at": "2026-10-16T16:00:00.000Z"
}Error 404
{"error":{"status":404,"reason":"file_not_found","message":"This line has no such file."}}#Restore a file
POST /v1/lines/:id/files/:file_id/restore
Brings a file back from the trash. Allowed until purge_after; after that the file is being removed and the call returns 410 file_purge_due.
Authentication: tunnel key (own tunnel) or root key. Test keys cannot change files.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid or me | yes | Tunnel id. |
file_id | path | uuid | yes | File id. |
Request
curl -sS -X POST https://api.mot3r.com/v1/lines/me/files/5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a/restore \
-H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"Response 200
{
"replay": false,
"file_id": "5d7e9f1a-2b4c-4d6e-8f0a-1b3c5d7e9f2a",
"line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
"name": "contract.pdf",
"mime": "application/pdf",
"size_bytes": 284113,
"sha256": "9b1f3c5e7a9d2b4f6e8a0c2d4f6b8a0e2c4d6f8b0a2c4e6f8a0b2d4c6e8f0a2b",
"source": "upload",
"state": "stored",
"created_at": "2026-10-16T15:40:00.000Z",
"trashed_at": null,
"purge_after": null,
"channel": null,
"measured_at": "2026-10-16T16:05:00.000Z"
}Error 409
{"error":{"status":409,"reason":"file_not_in_trash","message":"The file is not in the trash."}}