Workdir

files, folders, commands, code and skills

filev1.0.0

the project's and working directory's files: list, read, find, search, write, edit, upload, re-read

The files a project holds: read the records and the folder tree, move and delete, put up a new version that re-reads only its delta (the file id never changes, so every reference survives), and watch the file set change over a stream rather than polling it.

POST/v1/api/actionsAPI keyPay-as-you-go

Register one uploaded file

Register a single content-addressed file you already pushed to storage, in one dispatch.

The one-call sibling of the register route below: same content addressing, same queue, one dispatch. Reach for the REST register when you are driving the chunk-diff flow yourself.

Dispatched as `{"action": "file_upload", "input": {...}}`.

Body

FieldTypeRequiredDescription
actionstringrequiredMust be `"file_upload"`.
input.fileIdstringrequiredContent-derived id of the whole file (43 base62 chars).
input.namestringrequiredThe file's display name.
input.extstringoptionalLowercased extension or mime subtype (e.g. txt, md, pdf).
input.fileTypestringoptionalMime content type stamped on the chunk blob.
input.fileSizenumberoptionalTotal byte size of the file.
input.filepathstringoptionalFolder the file lands in within the project — a client value; the server resolves the session project and overrides the destination, so a forged path lands in the session root.
input.chunkIdsstring[]requiredOrdered chunk ids whose bytes reassemble the file.
input.chunkingstringoptionalChunking mode: 'sections' | 'bytes' | '' for a single chunk.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/api/actions" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "file_upload",
  "input": {
    "chunkIds": [
      "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
    ],
    "ext": "swift",
    "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
    "name": "Router.swift"
  }
}'
Response · 200
{
  "action": "file_upload",
  "result": {
    "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
    "status": "queued"
  }
}

Errors

StatuserrorWhen
400fileId, name and chunkIds are requiredA required field was absent.
403action not available to an API keyThe key's tier does not reach this action.
400invalid request bodyThe body is not JSON, or exceeds the 1 MB request-body cap.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
GET/v1/projects/{projectId}/filesAPI keyTeam

List files

One cursor page of the project's visible files, newest cursor on `X-Next-Cursor`.

Soft-deleted files never appear. The body is a bare array; page it to exhaustion by following `X-Next-Cursor` until the header stops coming back.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe project to list.

Query parameters

FieldTypeRequiredDescription
cursorstringoptionalCursor from a previous page.
limitintegeroptionalPage size, capped at 200.
Request · curl
curl -X GET "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files?limit=100" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
[
  {
    "chunkIds": [
      "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
    ],
    "chunking": "",
    "createdAt": "2026-08-07T18:22:10Z",
    "ext": "swift",
    "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
    "fileSize": 41822,
    "fileType": "code",
    "filepath": "Sources/Net",
    "name": "Router.swift",
    "projectId": "p7Kd2mQx",
    "status": "queued",
    "updatedAt": "2026-08-07T18:22:10Z"
  }
]

Errors

StatuserrorWhen
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.

Answers ProjectFile[]: One file in the project: its place, its size, and how far its reading has come.

FieldTypeRequiredDescription
fileIdstringrequiredThe file's id, the base62 SHA-256 of its bytes, so identical bytes share one id.
projectIdstringrequiredThe project the file sits in.
namestringrequiredThe file name, extension included.
filepathstringoptionalThe folder the file sits in, relative to the project root.
extstringoptionalThe file's extension.
fileTypestringoptionalWhat kind of file Runlog read it as, as `code` or `document`.
fileSizeintegeroptionalThe size in bytes.
statusstringoptionalWhere its reading stands: `queued` or `pending` before it starts, `processing`, then `done`, `partial`, `error` or `aborted`.
statusMessagestringoptionalWhy a read ended `partial` or `error`.
ingestProgressintegeroptionalHow far the running read has come, from 0 to 100.
ingestPhasestringoptionalWhat the running read is doing, in words.
titlestringoptionalThe title Runlog read off the file.
summarystringoptionalA summary of the file.
contentHashstringoptionalThe lowercase hex SHA-256 of the bytes.
chunkIdsstring[]optionalThe content-addressed chunks the file is made of, in order.
sourceUrlstringoptionalThe page a web-imported file was fetched from; empty for an upload.
versionintegeroptionalRaised on every write to the record.
createdAtstringoptionalWhen the file was first added, as an RFC 3339 timestamp.
updatedAtstringoptionalWhen the record last changed, as an RFC 3339 timestamp.
GET/v1/projects/{projectId}/files/{fileId}API keyTeam

Get a file

Read one file record: where its reading got to, and everything the project knows about it.

`status` moves `queued` → `processing` → `done`, or lands on `partial` or `error` with the cause in `statusMessage`. A soft-deleted or unknown file answers 404.

For ONE file you are waiting on. To watch an ingestion, read the lease instead — one call however many files it holds, rather than one call per file.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
fileIdstringrequiredThe file to read.
Request · curl
curl -X GET "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "chunkIds": [
    "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
  ],
  "chunking": "",
  "createdAt": "2026-08-07T18:22:10Z",
  "ext": "swift",
  "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
  "fileSize": 41822,
  "fileType": "code",
  "filepath": "Sources/Net",
  "name": "Router.swift",
  "projectId": "p7Kd2mQx",
  "status": "done",
  "updatedAt": "2026-08-07T18:22:10Z"
}

Errors

StatuserrorWhen
404file not foundThe file does not exist in this project, or was soft-deleted.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.

Answers ProjectFile: One file in the project: its place, its size, and how far its reading has come.

FieldTypeRequiredDescription
fileIdstringrequiredThe file's id, the base62 SHA-256 of its bytes, so identical bytes share one id.
projectIdstringrequiredThe project the file sits in.
namestringrequiredThe file name, extension included.
filepathstringoptionalThe folder the file sits in, relative to the project root.
extstringoptionalThe file's extension.
fileTypestringoptionalWhat kind of file Runlog read it as, as `code` or `document`.
fileSizeintegeroptionalThe size in bytes.
statusstringoptionalWhere its reading stands: `queued` or `pending` before it starts, `processing`, then `done`, `partial`, `error` or `aborted`.
statusMessagestringoptionalWhy a read ended `partial` or `error`.
ingestProgressintegeroptionalHow far the running read has come, from 0 to 100.
ingestPhasestringoptionalWhat the running read is doing, in words.
titlestringoptionalThe title Runlog read off the file.
summarystringoptionalA summary of the file.
contentHashstringoptionalThe lowercase hex SHA-256 of the bytes.
chunkIdsstring[]optionalThe content-addressed chunks the file is made of, in order.
sourceUrlstringoptionalThe page a web-imported file was fetched from; empty for an upload.
versionintegeroptionalRaised on every write to the record.
createdAtstringoptionalWhen the file was first added, as an RFC 3339 timestamp.
updatedAtstringoptionalWhen the record last changed, as an RFC 3339 timestamp.
GET/v1/projects/{projectId}/foldersAPI keyTeam

List folders

Read the project's folder tree, derived from the `filepath` every file carries.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe project to read.
Request · curl
curl -X GET "https://runlogai.com/runlogapi/projects/p7Kd2mQx/folders" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
[
  {
    "fileCount": 2,
    "path": "checkout"
  },
  {
    "fileCount": 14,
    "path": "checkout/Sources/Net"
  }
]

Errors

StatuserrorWhen
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
GET/v1/projects/{projectId}/files/{fileId}/entitiesAPI keyTeam

Read what a file resolved to

The names of every entity the file's ingestion derived — the other half of what an ingestion gives you back.

Registering a file returns its `fileId` immediately. The entities do not exist until the derivation pass has run, so they are read here rather than promised on a response written before they were derived.

These names are exactly the strings the retrieval lane accepts as an `entities` tether, and the `fileId` is what it accepts as a `fileIds` tether. Ingest, read this, then ask your question anchored to both.

A file still ingesting answers `200` with an empty list. Nothing is wrong — the names are not derived yet, and `status` on the file record is the field that says which it is.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
fileIdstringrequiredThe ingested file.
Request · curl
curl -X GET "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN/entities" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "entityCount": 3,
  "entityNames": [
    "Curtain Wall Type A",
    "North Elevation",
    "Level 3 Slab"
  ],
  "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
  "status": "ready"
}

Errors

StatuserrorWhen
404file not foundThe file does not exist in this project, or was soft-deleted.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
PATCH/v1/projects/{projectId}/files/{fileId}API keyTeam

Rename or move a file

Change a file's name, title, or folder. A `filepath` change is a move.

A move is a pure placement rewrite: the file id, its content, and its ingestion state are all unchanged.

At least one of the three fields is required; a field you do not name is left alone.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
fileIdstringrequiredThe file to change.

Body

FieldTypeRequiredDescription
namestringoptionalNew file name including extension.
titlestringoptionalNew display title.
filepathstringoptionalNew folder. `""` moves the file to the project root.
Request · curl
curl -X PATCH "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "filepath": "Sources/Networking"
}'
Response · 200
{
  "chunkIds": [
    "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
  ],
  "chunking": "",
  "createdAt": "2026-08-07T18:22:10Z",
  "ext": "swift",
  "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
  "fileSize": 41822,
  "fileType": "code",
  "filepath": "Sources/Networking",
  "name": "Router.swift",
  "projectId": "p7Kd2mQx",
  "status": "queued",
  "updatedAt": "2026-08-07T18:22:10Z"
}

Errors

StatuserrorWhen
400at least one field is requiredThe body named none of `name`, `title`, `filepath`.
404file not foundNo such file in this project.
403editor access requiredYou can read the project but not write to it.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
PATCH/v1/projects/{projectId}/folders/{folderPath}API keyTeam

Move a folder

Relocate a whole subtree in one batched prefix rewrite.

One batch rewrites every contained file's `filepath`. File ids never change, and the move either lands wholly or fails — never a silent half-move.

Moving a folder across the `Docs/Artifacts/` boundary is the promote/demote gesture; see below.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
folderPathstringrequiredThe folder to move, as a slash-separated path.

Body

FieldTypeRequiredDescription
newPathstringrequiredDestination path for the subtree.
Request · curl
curl -X PATCH "https://runlogai.com/runlogapi/projects/p7Kd2mQx/folders/src/net" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "newPath": "Sources/Transport"
}'
Response · 200
{
  "from": "Sources/Net",
  "moved": 14,
  "to": "Sources/Transport"
}

Errors

StatuserrorWhen
400invalid folder moveThe move is structurally impossible — the project root, a no-op, or a folder into its own subtree.
403editor access requiredYou can read the project but not write to it.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
500internal errorThe batch failed partway. The move is reported failed rather than partially applied.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
DELETE/v1/projects/{projectId}/files/{fileId}API keyTeam

Delete a file

Soft-delete a file and retire the derivations that rested only on it.

Chunk blobs are global and shared, so a delete never removes bytes another file still references. Re-registering the same content later costs no upload.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
fileIdstringrequiredThe file to delete.
Request · curl
curl -X DELETE "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "deleted": true,
  "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
}

Errors

StatuserrorWhen
404file not foundNo such file in this project.
403editor access requiredYou can read the project but not write to it.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
PATCH/v1/projects/{projectId}/files/{fileId}API keyTeam

Promote or demote an artifact

Move a file across the `Docs/Artifacts/` boundary to reclassify it as generated or as ingested source.

There is no separate promote endpoint, and that is deliberate. The `Docs/Artifacts/` folder boundary IS the classification, so one move gesture is the whole operation and the tree can never disagree with the label.

**Demote** — moving a file INTO `Docs/Artifacts/` relabels it generated: it becomes a derived product, and the pipeline stops treating it as evidence.

**Promote** — moving a file OUT of `Docs/Artifacts/` relabels it ingested: it becomes source evidence, and the derivation cascade re-reconciles everything that rests on it.

Each crossing triggers its reconciliation cascade, and discrepancies the cascade finds are surfaced rather than silently resolved. A batch that fails lands on each file's own status as `error`; nothing is skipped quietly.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
fileIdstringrequiredThe file to reclassify.

Body

FieldTypeRequiredDescription
filepathstringrequiredDestination folder. A path under `Docs/Artifacts/` demotes; a path outside it promotes.
Request · curl
curl -X PATCH "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "filepath": "Docs/Artifacts/design"
}'
Response · 200
{
  "chunkIds": [
    "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
  ],
  "chunking": "",
  "createdAt": "2026-08-07T18:22:10Z",
  "ext": "swift",
  "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
  "fileSize": 41822,
  "fileType": "code",
  "filepath": "Docs/Artifacts/design",
  "name": "Router.swift",
  "projectId": "p7Kd2mQx",
  "sourceClass": "generated",
  "status": "queued",
  "updatedAt": "2026-08-07T18:22:10Z"
}

Errors

StatuserrorWhen
404file not foundNo such file in this project.
403editor access requiredYou can read the project but not write to it.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
PUT/v1/projects/{projectId}/files/{fileId}/contentAPI keyTeam

Replace a file's content

Flip an existing file onto a replacement chunk you have already uploaded, and re-derive only what changed.

The edit lane is a diff, not a rewrite. The server compares the old content-addressed derivations against the new ones and re-ingests only the differing parts; unchanged regions are untouched, and derivations that no longer have a source retire.

Upload the replacement bytes through `chunks/missing` first, exactly as for a new file. This endpoint moves the pointer; it never carries bytes.

The `fileId` does not change. Everything that cites the file — retrieval results, plan proposals, folder placement — keeps citing it.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.
fileIdstringrequiredThe file to edit.

Body

FieldTypeRequiredDescription
chunkIdstringrequiredThe replacement content's chunk id. Its bytes must already be stored.
fileSizeintegeroptionalNew total size in bytes.
Request · curl
curl -X PUT "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN/content" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "chunkId": "Yt4RcVbNm2QaZsXdCfVgBhNjMkLoPiUyTrE",
  "fileSize": 42190
}'
Response · 200
{
  "chunkIds": [
    "Yt4RcVbNm2QaZsXdCfVgBhNjMkLoPiUyTrE"
  ],
  "chunking": "",
  "createdAt": "2026-08-07T18:22:10Z",
  "ext": "swift",
  "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
  "fileSize": 42190,
  "fileType": "code",
  "filepath": "Sources/Net",
  "name": "Router.swift",
  "projectId": "p7Kd2mQx",
  "status": "queued",
  "updatedAt": "2026-08-07T18:22:10Z"
}

Errors

StatuserrorWhen
400chunk is not storedYou named a chunk whose bytes never landed. Run `chunks/missing` and PUT the body first.
400file is not editableThe file's family has no content-edit lane (a media container, for instance).
404file not foundNo such file in this project.
403editor access requiredYou can read the project but not write to it.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
POST/v1/projects/{projectId}/files/reingestAPI keyTeam

Reingest files

Re-run the derivation pass over named files without re-uploading their bytes.

Bytes are already content-addressed and stored, so this costs no upload. The whole set lands in one enqueue — one queue write and one wake for N files, never a wake per file.

An id that no longer resolves is dropped rather than failing the batch.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe owning project.

Body

FieldTypeRequiredDescription
fileIdsstring[]requiredFiles to re-derive. A single-element array is the single-file reingest.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/reingest" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "fileIds": [
    "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN"
  ]
}'
Response · 200
{
  "enqueued": 1,
  "skipped": 0
}

Errors

StatuserrorWhen
400fileIds are requiredThe batch was empty.
403editor access requiredYou can read the project but not write to it.
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
GET/v1/projects/{projectId}/files/streamSessionTeam

Subscribe to file changes

Hold an SSE connection open and receive the file list on every change — how you watch an ingestion settle.

A baseline frame arrives immediately on connect — `[]` when the project is empty — so you can tell "connected, nothing here" from "no frame yet".

A file leaving the set arrives as an `{id, removed}` tombstone. The connection heartbeats every 25 seconds; a missed heartbeat means reconnect.

The same `/stream` suffix exists on `cells`, `entities`, and `factions`.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe project to watch.
Request · curl
curl -X GET "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/stream" \
  -H "Authorization: Bearer $RUNLOG_SESSION_TOKEN" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
data: [{"fileId":"4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN","status":"ready"}]

Errors

StatuserrorWhen
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
POST/v1/api/projects/{projectId}/files/stream-ticketAPI keyTeam

Mint a file-stream ticket

Receive the short-lived ticket that opens the project's file stream without a header.

The agent-run stream's precedent, on the file stream: a normal keyed call mints a ticket that opens the stream once, within 120 seconds, so the key itself never travels in a URL. Mint one per connection.

Path parameters

FieldTypeRequiredDescription
projectIdstringrequiredThe project whose file stream to open.
The flow
# 1. Mint a ticket: a normal keyed call.
curl -X POST "https://runlogai.com/runlogapi/api/projects/p7Kd2mQx/files/stream-ticket" \
  -H "Authorization: Bearer $RUNLOG_API_KEY"
# → {"ticket": "st_7Qk2Mv…", "expiresInSeconds": 120}

# 2. Open the stream with it. No header, so EventSource can.
curl -N "https://runlogai.com/runlogapi/projects/p7Kd2mQx/files/stream?ticket=$TICKET"
Request · curl
curl -X POST "https://runlogai.com/runlogapi/api/projects/p7Kd2mQx/files/stream-ticket" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "expiresInSeconds": 120,
  "ticket": "st_7Qk2Mv…"
}

Errors

StatuserrorWhen
404project not foundThe project does not exist, or you have no access to it. Projects are non-enumerable, so a denied read is indistinguishable from a missing one.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
project-write

Upload a file

file_upload: Register a file the visitor already content-addressed and pushed to storage as chunks, staging it into the caller's session project so it ingests through the ordinary queue.Pay-as-you-goanswers inline

FieldTypeRequiredDescription
fileIdstringrequiredcontent-derived id of the whole file (43 base62 chars)
namestringrequiredthe file's display name
extstringoptionallowercased extension or mime subtype (e.g. txt, md, pdf)
fileTypestringoptionalmime content type stamped on the chunk blob
fileSizenumberoptionaltotal byte size of the file
filepathstringoptionalfolder the file lands in within the project — a client value; the server resolves the session project and overrides the destination, so a forged path lands in the session root
chunkIdsstring[]requiredordered chunk ids whose bytes reassemble the file
chunkingstringoptionalchunking mode: 'sections' | 'bytes' | '' for a single chunk

Contract The destination resolves server-side: the file always lands in the caller's session project, never in a project_id the visitor names.

Contract One session per caller: the first upload mints the session; later calls reuse it, each advancing its idle watermark.

Contract Upload URLs are minted per chunk — a caller cannot name a source to fetch.

read

List the project's files

file_list: List the files the project holds as the Files screen shows them — name, folder, ingestion status and its message — narrowed by folder, status or name, or read one file's record in full.Teamruns on a thread, stream it

FieldTypeRequiredDescription
fileIdstringoptionalone file to read in full: its summary, status, phase, failure and source address
folderstringoptionalkeep only files under this folder path
statusstringoptionalkeep only files in this status — pending, processing, done, partial or error
querystringoptionalkeep only files whose name or title holds these words
cursorstringoptionalthe cursor a prior page ended on, to continue
limitnumberoptionalrows in this page; fifty by default and two hundred at most

Contract A page is a window over the files in id order, filters applied inside a bounded scan; the reply states the cursor it stopped on and never treats a page as every file.

Contract What a file says is read with corpus_read or source_read; this reads the record the Files screen shows.

project-write

Read files again

file_reingest: Read the named files of the project again from what they already hold, as the Files screen's reingest does: a file whose ingestion failed or stopped is queued anew, and its findings are derived again.Teamruns on a thread, stream it

FieldTypeRequiredDescription
fileIdsstring[]requiredthe ids of the files to read again

Contract A file the project no longer holds is named as such and nothing starts for it.

folderv1.0.0

set up or reorganize a working directory

A folder on your machine becomes a project that stays current. Ask what the key opens and what is never read, compare against what the project holds, then push only the files whose content moved; an unchanged file is never re-read or re-sent. Credentials are refused by shape, so a key in a synced folder stays on disk.

GET/v1/api/workspace/describeAPI keyTeam

Describe the binding

Ask which project this key opens, what reads as code, and what is never read.

Read this at run time rather than carrying your own copy. The skip lists and the per-file ceiling move with the reading pipeline, and a client that hardcodes them starts pushing bytes the server refuses.

`secretShapes` names the credential shapes no lane stores unasked. Skip them locally; a client that sends one anyway is refused per file rather than per push.

Request · curl
curl -X GET "https://runlogai.com/runlogapi/api/workspace/describe" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "codeExtensions": [
    ".go",
    ".ts",
    ".py"
  ],
  "maxFileBytes": 2097152,
  "projectId": "p7Kd2mQx",
  "projectName": "Checkout",
  "secretShapes": [
    "private-key",
    "cloud-credential"
  ],
  "skippedDirectories": [
    "node_modules",
    ".git"
  ],
  "skippedExtensions": [
    ".lock"
  ],
  "skippedNames": [
    ".DS_Store"
  ],
  "version": 1
}

Errors

StatuserrorWhen
401unauthorizedNo valid API key on the request.
GET/v1/api/workspace/manifestAPI keyTeam

List what the project holds

List every file this working directory already put in the project, under its content address.

Compare `contentId` against the same content address computed locally. Equal means the file is already read, and sending it again would cost money to learn nothing.

Request · curl
curl -X GET "https://runlogai.com/runlogapi/api/workspace/manifest" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx"
Response · 200
{
  "files": [
    {
      "contentId": "9dRk2mVt7QzLpXe4Nb1CsHgYo6JwFu3Ai0",
      "path": "cmd/main.go"
    }
  ],
  "version": 1
}

Errors

StatuserrorWhen
401unauthorizedNo valid API key on the request.
POST/v1/api/workspace/syncAPI keyTeam

Push what changed

Send one batch of changed files and learn which of them landed.

A refusal is per file and never stops the rest of the push, so one unreadable file cannot cost you the batch. Every refusal names its path and says why in the words the person who ran the command reads.

`includeSecret` is you naming one exact path to read anyway. It is per path rather than a mode, so nothing sends a whole folder of credentials by setting one flag.

A push lands on any plan, credits or none. A file the reading pipeline cannot afford stops as a transient error, and the next project open queues it again.

Body

FieldTypeRequiredDescription
itemsobject[]requiredThe files to send.
items[].pathstringrequiredPath relative to the folder root.
items[].contentTypestringoptionalDefaults from the path's extension.
items[].contentstringrequiredThe file's bytes, base64.
items[].includeSecretbooleanoptionalRead this one path despite its shape.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/api/workspace/sync" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {
      "content": "cGFja2FnZSBtYWluCg==",
      "contentType": "text/x-go",
      "path": "cmd/main.go"
    }
  ],
  "version": 1
}'
Response · 200
{
  "indexed": [
    "cmd/main.go"
  ],
  "refused": [
    {
      "path": ".env",
      "reason": "This looks like a credential, so it was left alone."
    }
  ],
  "version": 1
}

Errors

StatuserrorWhen
401unauthorizedNo valid API key on the request.
POST/v1/api/workspace/reconcileAPI keyTeam

Drop what is gone

Tell the project which paths no longer exist on disk, so what it holds matches the folder.

Deletion is a separate call from the push on purpose: a client that crashed mid-scan must not be able to empty a project by reporting the files it had not reached yet as gone.

Body

FieldTypeRequiredDescription
pathsstringrequiredThe paths that are gone, relative to root.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/api/workspace/reconcile" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "paths": [
    "cmd/old.go"
  ],
  "version": 1
}'
Response · 200
{
  "refused": [],
  "removed": [
    "cmd/old.go"
  ],
  "version": 1
}

Errors

StatuserrorWhen
401unauthorizedNo valid API key on the request.
read

Reorganize a folder

folder_reorganize: Propose how a folder of the project could be organized, from what ties its files together (cells citing them together, shared entities, files changed together, links), with no model call: at most five entries a level, families named by their dominant kind, a code module never moved. With no plan it answers one card of two plans side by side, a minimal-move plan and a from-scratch plan, every move with its reason and every near-duplicate pair offered for merging; with the plan the person picked it stages that plan as one change set: the moves, the links they break rewritten, the layout updated, and a README for each new folder.Teamruns on a thread, stream it

FieldTypeRequiredDescription
rootstringoptionalthe folder to organize, a project path (default: the project root)
planstringoptionalminimal or fresh, the plan the person picked on the card; empty proposes the card

Contract Nothing moves unless the person picks a plan on the card: the person may keep any layout they like, so a proposal is never applied on its own.

Contract The picked plan lands as one change set confirmed on the run, through the same card and write path as any file change, and the cells keep their provenance.

Contract A near-duplicate pair is never moved: it is offered as an antislop merge-and-regenerate task.

codev1.0.0

the code plane: find units, pack context, vet a dependency

Reads over a codebase's units: the context a task needs, packed to a budget, and every reference to a symbol.

POST/v1/api/actionsAPI keyTeam

Code context pack

Assemble the declarations, files, and relationships a stated task needs, packed to a token budget.

This is the endpoint an editor integration calls before a completion or a refactor. You describe the task in words and optionally seed it with the symbols and files the user is looking at; the response is a ranked, budget-bounded pack rather than a similarity dump.

`budget` is approximate tokens. Ask for what your model can actually spend — the pack fills the budget rather than truncating a fixed-size result. Omit it and the pack fills the model's own input window, so an unstated budget returns everything the ranking earned rather than a silent cut.

Dispatched through the action endpoint: `{"action": "code_context_pack", "input": {...}}`.

Body

FieldTypeRequiredDescription
actionstringrequiredMust be `"code_context_pack"`.
input.taskstringrequiredThe coding task in prose — what is being changed, in the words the codebase itself uses.
input.seedSymbolsstringoptionalDeclarations already in your context, comma- or newline-separated; they steer the ranking and are never returned back to you.
input.seedFilesstringoptionalFile paths already open in your context, comma- or newline-separated; same effect as seed symbols.
input.budgetnumberoptionalApproximate token ceiling the pack fills. Leave it unset unless your context is genuinely smaller than the model window — unset fills to the model's own input window.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/api/actions" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "code_context_pack",
  "input": {
    "budget": 8000,
    "seedFiles": [
      "Sources/Net/Router.swift"
    ],
    "seedSymbols": [
      "Router.send",
      "CheckoutClient"
    ],
    "task": "add retry with exponential backoff to the checkout network client"
  }
}'
Response · 200
{
  "action": "code_context_pack",
  "result": {
    "budget": 8000,
    "declarations": [
      {
        "body": "func send<T: Decodable>(_ req: URLRequest) async throws -> T { ... }",
        "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
        "filepath": "Sources/Net/Router.swift",
        "kind": "method",
        "lines": [
          88,
          131
        ],
        "symbol": "Router.send"
      }
    ],
    "files": [
      {
        "fileId": "4mHqZ1nR8vTbC0sWyLpAeGkJ3dXfU6iO2rN",
        "filepath": "Sources/Net/Router.swift",
        "reason": "seed"
      }
    ],
    "used": 7412
  }
}

Errors

StatuserrorWhen
400action is requiredThe body named no action.
403action not available to an API keyThe key's tier does not reach this action.
404unknown actionThe action id is not in the catalog.
400invalid request bodyThe body is not JSON, or exceeds the 1 MB request-body cap.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
POST/v1/api/actionsAPI keyTeam

Find references

Resolve every declaration and usage site matching a symbol query.

Dispatched as `{"action": "code_references", "input": {"query": "..."}}`. Use it for jump-to-definition and find-usages against the derived graph rather than a text scan.

Body

FieldTypeRequiredDescription
actionstringrequiredMust be `"code_references"`.
input.querystringoptionalThe prefix typed so far; empty lists the first page alphabetically.
Request · curl
curl -X POST "https://runlogai.com/runlogapi/api/actions" \
  -H "Authorization: Bearer $RUNLOG_API_KEY" \
  -H "X-Project-Id: p7Kd2mQx" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "code_references",
  "input": {
    "query": "CheckoutClient"
  }
}'
Response · 200
{
  "action": "code_references",
  "result": {
    "references": [
      {
        "filepath": "Sources/Net/CheckoutClient.swift",
        "kind": "declaration",
        "lines": [
          12,
          96
        ],
        "symbol": "CheckoutClient"
      },
      {
        "filepath": "Sources/App/AppDelegate.swift",
        "kind": "usage",
        "lines": [
          41,
          41
        ],
        "symbol": "CheckoutClient.init"
      }
    ]
  }
}

Errors

StatuserrorWhen
400action is requiredThe body named no action.
403action not available to an API keyThe key's tier does not reach this action.
400invalid request bodyThe body is not JSON, or exceeds the 1 MB request-body cap.
401invalid API keyThe `Authorization` header is missing, malformed, or names a revoked key.
400name the target project via the X-Project-Id header or projectId queryNo project was named and the key is not bound to one.
429rate limit exceededYou passed 60 requests/minute on this key. `Retry-After` carries the seconds to wait.
500internal errorThe service failed to serve the request. Retry with backoff; the cause is logged server-side against your request.
read

Pack code context

code_context_pack: Return the slice of an ingested repository one coding task needs: the declarations ranked most relevant to the task, each as a signature citing its file and line, packed to a token budget. Complements an exact-string search rather than replacing it — it answers which code to read, not what it says.Teamanswers inline

FieldTypeRequiredDescription
taskstringrequiredthe coding task in prose — what is being changed, in the words the codebase itself uses
seedSymbolsstringoptionaldeclarations already in your context, comma- or newline-separated; they steer the ranking and are never returned back to you
seedFilesstringoptionalfile paths already open in your context, comma- or newline-separated; same effect as seed symbols
budgetnumberoptionalapproximate token ceiling the pack fills. Leave it unset unless your context is genuinely smaller than the model window — unset fills to the model's own input window

Contract The response is signatures, never bodies: each declaration carries its header, file, and line span so you read the source yourself at the cited position.

Contract The pack is ranked for precision, not coverage — it returns the few declarations a task turns on and stops well short of the budget when nothing else scores. A short pack is an answer, not a truncation; re-dispatch with a sharper task rather than a larger budget.

Contract Seeds are subtracted from the answer: anything you name in seedSymbols or seedFiles steers the ranking and is never spent on your budget.

read

Find code units

code_references: List the ingested code units whose symbol name matches a typed prefix, each as an addressable reference — a stable symbol id, the symbol name as its label, and its file path as its sublabel. This is the manual override for retrieval: the named way to point at code.Teamanswers inline

FieldTypeRequiredDescription
querystringoptionalthe prefix typed so far; empty lists the first page alphabetically

Contract References are a bounded page ordered prefix-matches-first, then substring matches, each alphabetical, so the list stays stable as the user keeps typing.

Contract The symbol id is stable across re-ingests — store that, never the label, when persisting what a user picked.

read

Vet a dependency

code_dependency_vet: Check one open-source package before proposing it over hand-written code (license for a hosted product, advisories, Scorecard, latest release, dependents, npm bundle size; adopt, review or refuse with reasons), audit a whole manifest for upgrades and re-vets, or sweep the staged code for logic written by hand that a vetted package or the standard library does better.Teamruns on a thread, stream it

FieldTypeRequiredDescription
sweepstringoptionala folder to sweep for hand-rolled logic, empty for the whole project, in place of a package or a manifest
manifeststringoptionala go.mod, package.json, pyproject.toml, requirements.txt or Cargo.toml path to audit whole, in place of a package
ecosystemstringoptionalthe registry: npm, go, pypi, cargo, maven, nuget or rubygems
packagestringoptionalthe package's registry name, e.g. zod or github.com/spf13/cobra
versionstringoptionalthe version to vet; omit for the registry's default release

Contract Reads OSV for advisories and deps.dev for license, Scorecard, releases and dependents; nothing is installed or written.

Contract Refuse is a failed bar (a license refused for hosted code, an open high or critical advisory, a quiet repository, no release inside the window, a deprecated version, a name the registry does not hold); review is a bar no source settled.

Contract Propose only an adopt, with the report as its evidence; a review is the person's call, a refuse is never proposed.

Contract A manifest audit vets each dependency at its pin and at its registry's default release, and answers findings (upgrade, replace or remove, re-vet by hand) in the shape {area, action, dependencies, keep, priority, reason}.

Contract A sweep matches the staged code against depvet's hand-rolled catalog and answers one finding per pattern and registry in the same shape, citing the sites and the replacement's vet; a refused replacement is a gap and the hand-written path stands.