Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api-reference/files/list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'List Files'
openapi: "/api-reference/openapi/content.json GET /api/files"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python - <<'PY'
import pathlib, re
for p in sorted(pathlib.Path("api-reference").rglob("*.mdx")):
    text = p.read_text()
    m = re.search(r'^\s*openapi:\s*(.+)$', text, re.MULTILINE)
    if m:
        print(f"{p}: {m.group(1).strip()}")
PY

Repository: recoupable/docs

Length of output: 12075


Update openapi frontmatter to match the required format

The frontmatter uses the format openapi: "/api-reference/openapi/content.json GET /api/files" but should follow the format openapi: 'METHOD /path' per the API reference standard, such as openapi: "GET /api/files". This pattern affects most api-reference pages in the repository and should be corrected systematically.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/files/list.mdx` at line 3, The frontmatter value for openapi is
incorrectly set to a file path plus method; update the openapi frontmatter in
this file (and similar api-reference pages) to the required format "METHOD
/path" (e.g., change openapi: "/api-reference/openapi/content.json GET
/api/files" to openapi: "GET /api/files"); ensure any other api-reference pages
follow the same pattern and perform a quick grep for the malformed pattern to
fix them consistently.

---
183 changes: 183 additions & 0 deletions api-reference/openapi/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,101 @@
}
}
},
"/api/files": {
"get": {
"description": "List files for an artist account the authenticated caller can access. Returns immediate children by default, or all descendants when `recursive=true`. Each file row always includes `owner_email`, which is `null` when the file owner's account has no email on record. Authentication is handled via the x-api-key header or Authorization Bearer token.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "artist_account_id",
"in": "query",
"required": true,
"description": "Artist account whose files should be listed.",
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "path",
"in": "query",
"required": false,
"description": "Optional relative path to list files from.",
"schema": {
"type": "string"
}
},
{
"name": "recursive",
"in": "query",
"required": false,
"description": "When true, return all descendant files under the given path.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Files retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FilesListResponse"
}
}
}
},
"400": {
"description": "Missing or invalid artist_account_id",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContentErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContentErrorResponse"
}
}
}
},
"403": {
"description": "Forbidden - account does not have access to the artist",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContentErrorResponse"
}
}
}
},
"500": {
"description": "Unexpected internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContentErrorResponse"
}
}
}
}
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
"/api/sandboxes/file": {
"get": {
"description": "Retrieve the raw contents of a file from the authenticated account's sandbox GitHub repository. Resolves the github_repo from the [account's snapshot](/api-reference/sandboxes/list), then fetches the file at the specified path from the repository's main branch. Authentication is handled via the x-api-key header or Authorization Bearer token.",
Expand Down Expand Up @@ -2350,6 +2445,94 @@
}
}
},
"FileListItem": {
"type": "object",
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
"required": [
"id",
"owner_account_id",
"artist_account_id",
"file_name",
"storage_key",
"mime_type",
"is_directory",
"size_bytes",
"description",
"tags",
"created_at",
"updated_at",
"owner_email"
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"owner_account_id": {
"type": "string",
"format": "uuid"
},
"artist_account_id": {
"type": "string",
"format": "uuid"
},
"file_name": {
"type": "string"
},
"storage_key": {
"type": "string"
},
"mime_type": {
"type": "string",
"nullable": true
},
"is_directory": {
"type": "boolean"
},
"size_bytes": {
"type": "integer",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"owner_email": {
"type": "string",
"nullable": true,
"description": "Primary email address of the file owner account, or `null` when no email is on record."
}
}
},
"FilesListResponse": {
"type": "object",
"required": [
"files"
],
"properties": {
"files": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FileListItem"
},
"description": "Array of file and folder rows"
}
}
},
"ContentCreateImageRequest": {
"type": "object",
"properties": {
Expand Down
6 changes: 6 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@
"api-reference/content-agent/callback"
]
},
{
"group": "Files",
"pages": [
"api-reference/files/list"
]
},
{
"group": "Image",
"pages": [
Expand Down