Workspaces and files
Workspaces and their shares, a task's files, uploads, memory notes, what a run changed, and a folder served as a site.
| Operation | Method and path |
|---|---|
| List workspaces | GET /api/v1/workspaces |
| Create a workspace | POST /api/v1/workspaces |
| Read a workspace | GET /api/v1/workspaces/{id} |
| Rename a workspace | PATCH /api/v1/workspaces/{id} |
| Delete a workspace and its files | DELETE /api/v1/workspaces/{id} |
| List a workspace's shares | GET /api/v1/workspaces/{id}/shares |
| Share a workspace by email | PUT /api/v1/workspaces/{id}/shares |
| Share a workspace | PUT /api/v1/workspaces/{id}/shares/{user_id} |
| Remove a share | DELETE /api/v1/workspaces/{id}/shares/{user_id} |
| List one directory of the task's workspace | GET /api/v1/conversations/{id}/files |
| Preview one file | GET /api/v1/conversations/{id}/files/content |
| Download one file | GET /api/v1/conversations/{id}/files/download |
| Show an HTML page, sandboxed | GET /api/v1/conversations/{id}/files/view |
| Show one sheet of a spreadsheet as a table | GET /api/v1/conversations/{id}/files/sheet |
| Upload a file into the workspace's uploads/ | POST /api/v1/conversations/{id}/uploads |
| Write a memory note of the workspace (ADR-0041) | PUT /api/v1/conversations/{id}/memory/{name} |
| Remove a memory note, keeping it for one Undo | DELETE /api/v1/conversations/{id}/memory/{name} |
| Undo the last change to a memory note | POST /api/v1/conversations/{id}/memory/{name}/undo |
| Fork a workspace into a new one of your own | POST /api/v1/workspaces/{id}/fork |
| Files a run changed | GET /api/v1/conversations/{id}/runs/{run_id}/changes |
| One changed file as a unified diff | GET /api/v1/conversations/{id}/runs/{run_id}/changes/diff |
| Mint a pass that serves a workspace folder as a site | POST /api/v1/conversations/{id}/site |
| The root of a workspace folder served as a site, by its pass | GET /api/v1/conversations/{id}/site/{pass}/ |
| A file of a workspace folder served as a site, by its pass | GET /api/v1/conversations/{id}/site/{pass}/{*path} |
List workspaces
GET /api/v1/workspaces
Your own and those shared with you, with your access. all=true (administrators only) lists every workspace's metadata without names, sources or content. limit (1-100) pages the list with an opaque next_cursor, stable while workspaces are added; without limit the whole list comes at once, as before. sort: recent (last used, else created; newest first), created (newest first, the default) or name (A to Z). filter: in_use (a task's sandbox holds its write lease), idle, or shared_with_me (someone else's, shared with you). A cursor belongs to its sort and filter; any other is 400 cursor_invalid. q searches the names the caller may read (their own and those shared with them), case-insensitively and as literal text, even with all=true; trimmed, at most 100 characters, else 400 value_too_long. A cursor belongs to its q as to its sort and filter.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
all | query | boolean | ||
limit | query | integer 1–100 | ||
cursor | query | string | ||
sort | query | "recent", "created", "name" | ||
filter | query | "all", "in_use", "idle", "shared_with_me" | ||
q | query | string | Search text in the names you may read; empty is no search. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Workspaces |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Create a workspace
POST /api/v1/workspaces
An empty workspace. A task clones a repository into it with plain git and a key under Keys (ADR-0037 §7). git_url was removed in this release: a request that still sends it is 400 invalid_request with details [{field: git_url, reason: removed}], never ignored.
Sign-in: A signed-in session or an API token.
Request body
application/json: NewWorkspace
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | Workspace |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 422 | unknown_reference: profile is not one the caller may use | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Read a workspace
GET /api/v1/workspaces/{id}
The owner or a share holder; everyone else gets 403.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Workspace |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Rename a workspace
PATCH /api/v1/workspaces/{id}
Owner only.
Sign-in: A signed-in session or an API token.
Request body
application/json: UpdateWorkspace
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Workspace |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Delete a workspace and its files
DELETE /api/v1/workspaces/{id}
Owner only. Refused with 409 workspace_in_use while a task's environment on it has a run going or is pinned (lease.running, lease.pinned), and while bound active tasks exist unless with_conversations=true and they all belong to the owner (then they are deleted with it); with 409 has_helpers while one of those tasks leads an agent team with helpers (delete that lead with its helpers first). A kept, idle environment is retired for the delete, as for a new task's handover, and the host directory goes once it has let go; with no environment, the directory goes at once; its tasks, recorded changes, snapshots and shares are purged within minutes, and forks stay with forked_from cleared. One content-free audit record is written per workspace and per task deleted with it.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
with_conversations | query | boolean |
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Successful operation | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | workspace_in_use; workspace_not_ready while it is being forked; has_helpers while a task deleted with it leads an agent team with helpers | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
List a workspace's shares
GET /api/v1/workspaces/{id}/shares
Owner only.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | WorkspaceShares |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Share a workspace by email
PUT /api/v1/workspaces/{id}/shares
The owner shares with the one active account whose email matches exactly (case-insensitive). An unknown or inactive email is 404 user_not_found, the same answer either way; nothing lists or searches accounts. Attempts are limited to 10 a minute per caller (429 busy).
Sign-in: A signed-in session or an API token.
Request body
application/json: ShareByEmail
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | WorkspaceShare |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Share a workspace
PUT /api/v1/workspaces/{id}/shares/{user_id}
Owner only. read: see the workspace, read its files, fork it. write: also bind your own tasks to it and run on it. Sharing a workspace never shares tasks or transcripts.
Sign-in: A signed-in session or an API token.
Request body
application/json: ShareWorkspace
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | WorkspaceShare |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Remove a share
DELETE /api/v1/workspaces/{id}/shares/{user_id}
Owner only.
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Successful operation | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
List one directory of the task's workspace
GET /api/v1/conversations/{id}/files
Directories first, then names; links listed but never followed; .tqa/ left out; names that are not UTF-8 are omitted. Authorization is workspace access: the owner or a share (read to list and read, write to upload); the administrator role grants no content. On a Firecracker installation the workspace is read through its runtime (ADR-0030): with no live sandbox on the workspace, the task owner's request starts theirs (429 busy while a slot is awaited) and anyone else gets 409 sandbox_not_ready; a runtime reply outside the request's bounds is 502 upstream_invalid. A link anywhere in the path is 400 path_invalid.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
path | query | string | A path relative to the workspace root: no leading /, no . or .. segment, at most 1024 bytes; never under .tqa/. | |
after | query | string | Continue after this entry name. | |
limit | query | integer 1–500 | 1-500, default 200. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | One page of entries | FilePage |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Preview one file
GET /api/v1/conversations/{id}/files/content
Metadata and, for UTF-8 text, up to files.preview_bytes (default 512 KiB). If-None-Match with the ETag answers 304. Authorization is workspace access: the owner or a share (read to list and read, write to upload); the administrator role grants no content. On a Firecracker installation the workspace is read through its runtime (ADR-0030): with no live sandbox on the workspace, the task owner's request starts theirs (429 busy while a slot is awaited) and anyone else gets 409 sandbox_not_ready; a runtime reply outside the request's bounds is 502 upstream_invalid, and a file that changes while it is read in chunks is 409 file_changed (retryable). A link anywhere in the path is 400 path_invalid.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
path | query | yes | string | A path relative to the workspace root: no leading /, no . or .. segment, at most 1024 bytes; never under .tqa/. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The file's metadata and text preview | FileContent |
| 304 | Not modified since the given ETag | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Download one file
GET /api/v1/conversations/{id}/files/download
The bytes as application/octet-stream with Content-Disposition: attachment and X-Content-Type-Options: nosniff, never rendered by the browser; above files.download_bytes (default 100 MiB) 413 body_too_large. Authorization is workspace access: the owner or a share (read to list and read, write to upload); the administrator role grants no content. On a Firecracker installation the workspace is read through its runtime (ADR-0030): with no live sandbox on the workspace, the task owner's request starts theirs (429 busy while a slot is awaited) and anyone else gets 409 sandbox_not_ready; a runtime reply outside the request's bounds is 502 upstream_invalid, and a file that changes while it is read in chunks is 409 file_changed (retryable). A link anywhere in the path is 400 path_invalid.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
path | query | yes | string | A path relative to the workspace root: no leading /, no . or .. segment, at most 1024 bytes; never under .tqa/. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The file | string (binary) (application/octet-stream) |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Show an HTML page, sandboxed
GET /api/v1/conversations/{id}/files/view
An HTML page of the task's workspace (.html or .htm only), for the Files panel's frame: text/html with Content-Security-Policy sandbox allow-scripts; default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:; media-src data:; connect-src 'none'; form-action 'none'; frame-src 'none'; child-src 'none'; worker-src 'none'; base-uri 'none'; frame-ancestors 'self', so the page has an opaque origin (no cookies or API as the person), no network, no forms, popups or top-level navigation, and only this site's pages may frame it; also X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer, Cache-Control: no-store. Any other type is 415 preview_unsupported (download it instead); above files.preview_html_bytes (default 2 MiB) 413 body_too_large. Access, paths and the runtime-backed read are as for the download.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
path | query | yes | string | A path relative to the workspace root: no leading /, no . or .. segment, at most 1024 bytes; never under .tqa/. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The page, sandboxed | string (text/html) |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 415 | No preview for this file type (preview_unsupported) | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Show one sheet of a spreadsheet as a table
GET /api/v1/conversations/{id}/files/sheet
One sheet of a spreadsheet of the task's workspace (.xlsx, .xlsm, .xlsb or .ods; legacy .xls is not read) as display text, for the Files panel's table. Formulas show their cached values and are never evaluated; macros and external links are ignored; cells are plain text, never markup or links. At most 500 rows and 50 columns are returned, each cell at most 200 characters (a longer one ends in …). Any other type is 415 preview_unsupported; above files.preview_sheet_bytes (default 10 MiB) 413 body_too_large; a file whose parts inflate past 100 MiB, hold more than 10,000 entries, or take longer than 5 s to read 413 preview_too_large; a damaged file, or one that isn't really a spreadsheet, 422 preview_damaged; a password-protected one 422 preview_protected; a sheet the file doesn't have 404 not_found. Access, paths and the runtime-backed read are as for the download.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
path | query | yes | string | A path relative to the workspace root: no leading /, no . or .. segment, at most 1024 bytes; never under .tqa/. |
sheet | query | string | The sheet's name; the first sheet when absent. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The sheet's shown table | SheetPreview |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Over files.preview_sheet_bytes (body_too_large), or the file inflates past what a preview reads (preview_too_large) | Error |
| 415 | No preview for this file type (preview_unsupported) | Error |
| 422 | The spreadsheet is damaged (preview_damaged) or protected with a password (preview_protected) | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Upload a file into the workspace's uploads/
POST /api/v1/conversations/{id}/uploads
The request body is the file. Stored as uploads/<sanitised name> ([A-Za-z0-9._-], no leading dot, at most 128 bytes; an existing name gets -2, -3, never overwritten). Refused before anything is stored: over files.upload_bytes (default 25 MiB) 413 upload_too_large, over files.uploads_bytes of uploads in the workspace (default 1 GiB) 409 uploads_full. Contents are not scanned; uploads are served only as downloads. Cookie requests need the exact Origin. Authorization is workspace access: the owner or a share (read to list and read, write to upload); the administrator role grants no content. On a Firecracker installation the upload streams through the workspace's runtime (ADR-0030) with the same names and limits (files.uploads_bytes is advisory there: usage is counted from the runtime's listing, and the workspace image's size is the real bound); the owner's sandbox is started if none is live, and a runtime reply outside its bounds is 502 upstream_invalid. A link anywhere in the path is 400 path_invalid.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
name | query | yes | string | The client's file name; sanitised as described. |
Request body
application/octet-stream: string (binary)
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Stored | Upload |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Write a memory note of the workspace (ADR-0041)
PUT /api/v1/conversations/{id}/memory/{name}
The request body is the note's text (UTF-8, at most 64 KiB): .memory/<name> is written atomically and its previous version kept for one Undo. A text that holds what looks like a key or token is refused (400 invalid_request): notes are kept and shown to every later task. Authorization is workspace access with a write share, as for uploads; the administrator role grants no content. Cookie requests need the exact Origin. Directory workspaces only: a Firecracker installation answers 409 files_unavailable until its workspace link gains the operation. A link in the way (the memory folder, its undo folder or the note) is 400 path_invalid. Listing and reading notes use the files operations on .memory/. With memory off ([memory] enabled = false, the default) .memory/ is an ordinary folder and this is 409 memory_off (ADR-0041's third amendment, A11).
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
name | path | yes | string | The note's file name: one component of [A-Za-z0-9._-], not hidden, ending .md, at most 128 bytes. |
Request body
text/plain: string
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Stored | Upload |
| 204 | Done | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Remove a memory note, keeping it for one Undo
DELETE /api/v1/conversations/{id}/memory/{name}
Removes .memory/<name>; its content is kept for one Undo. 404 when there is no such note. Authorization is workspace access with a write share, as for uploads; the administrator role grants no content. Cookie requests need the exact Origin. Directory workspaces only: a Firecracker installation answers 409 files_unavailable until its workspace link gains the operation. A link in the way (the memory folder, its undo folder or the note) is 400 path_invalid. Listing and reading notes use the files operations on .memory/. With memory off ([memory] enabled = false, the default) .memory/ is an ordinary folder and this is 409 memory_off (ADR-0041's third amendment, A11).
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
name | path | yes | string | The note's file name: one component of [A-Za-z0-9._-], not hidden, ending .md, at most 128 bytes. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Stored | Upload |
| 204 | Done | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Undo the last change to a memory note
POST /api/v1/conversations/{id}/memory/{name}/undo
Undoes the last change to .memory/<name>, the agent's or a person's: its kept previous version comes back (outcome restored), or, a note that was new at that change is removed (outcome removed). Once: 404 when there is nothing to undo, so the same Undo sent again changes nothing. Authorization is workspace access with a write share, as for uploads; the administrator role grants no content. Cookie requests need the exact Origin. Directory workspaces only: a Firecracker installation answers 409 files_unavailable until its workspace link gains the operation. A link in the way (the memory folder, its undo folder or the note) is 400 path_invalid. Listing and reading notes use the files operations on .memory/. With memory off ([memory] enabled = false, the default) .memory/ is an ordinary folder and this is 409 memory_off (ADR-0041's third amendment, A11).
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
name | path | yes | string | The note's file name: one component of [A-Za-z0-9._-], not hidden, ending .md, at most 128 bytes. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | What the Undo did | object |
| 201 | Stored | Upload |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Fork a workspace into a new one of your own
POST /api/v1/workspaces/{id}/fork
Needs any access (owner or a read or write share). The copy runs in the background within the quota and does not wait for a running task; links are copied as links, never followed.
Sign-in: A signed-in session or an API token.
Request body
application/json: ForkWorkspace
Responses
| Status | Meaning | Body |
|---|---|---|
| 202 | The fork is being copied (state forking) | Workspace |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | workspace_not_ready (the source is still forking or failed) | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Files a run changed
GET /api/v1/conversations/{id}/runs/{run_id}/changes
The files the run added, modified or deleted, compared between the workspace snapshot taken when its message was delivered and the next snapshot of the workspace, or the live workspace for the latest run (live: true). .tqa/, uploads/, .git/ and node_modules/ are left out. A run recorded before this feature, or without a snapshot, is 404 changes_unavailable; an unknown run is 404 not_found. Authorization is workspace access: the owner or a share (read or write); the administrator role grants no content. On a Firecracker installation the live side is read through the workspace's runtime (ADR-0030); a runtime reply outside its bounds is 502 upstream_invalid.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
run_id | path | yes | string |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The run's changed files | RunChanges |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
One changed file as a unified diff
GET /api/v1/conversations/{id}/runs/{run_id}/changes/diff
A unified diff (3 lines of context) of one changed file, from the text copies the snapshots kept; binary files and files over files.snapshot_text_bytes have no diff text. The text is cut at files.diff_bytes (truncated: true). A file the run did not change is 404. Authorization is workspace access: the owner or a share (read or write); the administrator role grants no content. On a Firecracker installation the live side is read through the workspace's runtime (ADR-0030); a runtime reply outside its bounds is 502 upstream_invalid.
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
run_id | path | yes | string | |
path | query | yes | string | A changed file of the run, relative to the workspace root. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The file's diff | FileDiff |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Mint a pass that serves a workspace folder as a site
POST /api/v1/conversations/{id}/site
Owner or share only (the files routes' access). The folder is a path relative to the workspace root (the root itself as an empty string); any folder that exists (404 not_found otherwise): a page beside other files, such as an agent's report.html, is opened by its name under the pass, and index.html is only what the root and a route answer. The pass is a capability: 32 random bytes, unpadded base64url, kept in the gateway's memory for 900 seconds from its last use and forgotten at a restart; at most 8 live passes per task, the 9th is 409 site_passes_limit. The answer's url is the site's root under the pass: the Files panel frames it, and the frame's own requests (CSS, scripts, images, fonts, fetches of the site's own files) resolve under it without a cookie, which an opaque sandboxed frame cannot send. A leaked pass gives read-only reads of that one folder of that one task until it expires, and nothing else. The answer also says what the install's network setting lets the page reach (network: the any-host rule, and the exact and *.domain hosts), so the panel can name what a page loads that the browser will block.
Sign-in: No sign-in.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) |
Request body
application/json: SitePassRequest
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | The pass and the site's root | SitePass |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | not_found: the task, or no such folder | Error |
| 409 | site_passes_limit: 8 live passes already serve this task | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
The root of a workspace folder served as a site, by its pass
GET /api/v1/conversations/{id}/site/{pass}/
The folder's index.html, exactly as siteFile serves it for an empty path (the same pass, headers, Content-Security-Policy and limits); a folder without an index.html is 404 not_found at its root while its files still open by name. This is the address mintSitePass answers as url.
Sign-in: No sign-in.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
pass | path | yes | string | The pass mintSitePass answered (43 characters of unpadded base64url). |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The file's bytes with its extension's type | |
| 404 | not_found: an unknown or expired pass, a path that climbs, or no such file and no index.html | Error |
| 413 | body_too_large: above the page or download limit | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
A file of a workspace folder served as a site, by its pass
GET /api/v1/conversations/{id}/site/{pass}/{*path}
No cookie, no Origin: the pass in the path is the whole credential (see mintSitePass); an unknown or expired pass, a path that climbs or a file outside the folder is 404 not_found, with no distinction. The rest of the path (slashes included) is the file under the folder; empty, a directory, or a path with no file of that name answers the folder's index.html, so a built site's own routes work. Each file is served by its extension's type, never guessed (html/htm text/html, js/mjs text/javascript, css, json and map, svg, png/jpg/jpeg/gif/webp/ico, woff/woff2/ttf/otf, wasm, txt; anything else application/octet-stream) up to files.preview_html_bytes for a page and files.download_bytes otherwise (413 body_too_large above). Every answer carries X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer, Cache-Control: no-store and Cross-Origin-Resource-Policy: cross-origin and Access-Control-Allow-Origin: * (the page's origin is opaque, so its own styles, scripts and images are cross-origin loads to the browser, and a module script is a CORS fetch from origin null; the pass guards the files); a page also carries the site's Content-Security-Policy: sandbox allow-scripts (an opaque origin: no cookies or API as the person), base-uri 'none', form-action 'none', frame-src 'none', worker-src 'none', frame-ancestors 'self', and for script-src, style-src, img-src, font-src, media-src and connect-src the site's own root under this pass plus 'unsafe-inline' (scripts and styles) and data: and blob: (media), plus the install's network setting rendered as sources: the any-host rule as https:, an exact host as https://host (with its ports other than 443), a *.domain rule as https://*.domain; internet access turned off or an empty allow-list adds nothing, so the browser blocks every outside load before it leaves.
Sign-in: No sign-in.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
pass | path | yes | string | The pass mintSitePass answered (43 characters of unpadded base64url). |
*path | path | yes | string | The file under the folder, slashes included; the empty rest is index.html. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The file's bytes with its extension's type | |
| 404 | not_found: an unknown or expired pass, a path that climbs, or no such file and no index.html | Error |
| 413 | body_too_large: above the page or download limit | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |