Create file or directory
PreviewManage execution sessions and rooms, and their files, tasks, storage, databases and managed sandboxes.
/v1/workspaces/{workspace_id}/fs/{path}See authentication for credentials and permissions.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID (wsp_<32-hex>)
File or directory path
Request Bodyrequired
Section titled “Request Bodyrequired”Request to create a file
object
File content (text or base64-encoded). Must match encoding.
Example
# Project notes
Draft outline of the migration plan.Content encoding: “text” or “base64”. Defaults to text.
Example
textWhether to create a directory instead of a file (ignores content/encoding).
Example
falseWhether file is read-only
Example
falseResponses
201Created
Created
Complete file with content
object
File content. Encoding is controlled by the encoding field: plain UTF-8 text for text, base64-encoded bytes for base64. None for directories and when this is a metadata-only listing.
Timestamp when this entry was created (RFC 3339).
Content encoding for the content field: text (UTF-8) or base64 (binary).
Internal database UUID for this file entry.
true when this entry represents a directory; false for a regular file.
Whether the entry was marked read-only at creation. Read-only entries cannot be edited or deleted by the session.
File or directory name (the last segment of path).
Absolute path within the session workspace (e.g. /notes.md).
UUID of the owning session.
File size in bytes. 0 for directories.
Timestamp when this entry was last updated (RFC 3339).
Example generated
{ "content": "example", "created_at": "2026-04-15T12:00:00Z", "encoding": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "is_directory": true, "is_readonly": true, "name": "example", "path": "example", "session_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "size_bytes": 1, "updated_at": "2026-04-15T12:00:00Z"}400Invalid request
Invalid request
409Already exists
Already exists
500Internal server error
Internal server error