Topolo Docs Topolo Platform
Open workspace

Create folder

Create a .keep marker under a normalized folder path in the verified storage scope. An existing folder answers 409.

Outcome

Create a .keep marker under a normalized folder path in the verified storage scope. An existing folder answers 409.

Before you start

  • Verify identity, pin environment and organization, and discover a granted Bytes workspace before choosing file keys.
  • The action requires folders:write. Select a verified workspace resource separately from action input; a body field cannot supply a workspace grant.
  • Scope org uses the verified workspace shared root; private uses the caller’s private subtree. The accepted legacy all value resolves to org and does not grant cross-organization browsing. The bucket input cannot switch the configured R2 binding.
  • Authorize the described effect or private-data export before passing CLI --confirm or MCP confirm:true. GET listing/search can persist derived data; HTTP method alone does not establish a read-only action.

Discover the target

topolo whoami --json
topolo actions get app_topolo_bytes.folders.create_alt --detail --json
topolo resources topolo-bytes --json
topolo workspaces list topolo-bytes --json
  • File keys are paths returned by files.list/search in the selected workspace and scope. Discover the granted workspace id; do not derive access from fixture ids.

Request

POST /api/folders/create

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and the HTTP body. Set BYTES_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
folderPathRequiredstring{"minLength":1}
bucketOptionalstring{"minLength":1}
scopeOptionalstring{"enum":["org","private","all"]}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "folderPath": {
      "type": "string",
      "minLength": 1
    },
    "bucket": {
      "type": "string",
      "minLength": 1
    },
    "scope": {
      "type": "string",
      "enum": [
        "org",
        "private",
        "all"
      ]
    }
  },
  "required": [
    "folderPath"
  ],
  "additionalProperties": false
}

Effects

  • Writes a zero-byte folder marker, not a platform workspace or permission grant.

Interpret the response

The response identifier path is $.folderPath for folder. An empty list does not discover a target.

List the folder path and inspect the returned trailing-slash folderPath.

The schema describes supported success fields; optional metadata and integration-dependent values may vary. Errors have the exact shapes shown in refused examples.

Success schema:

{
  "type": "object",
  "required": [
    "success",
    "folderPath",
    "message"
  ],
  "properties": {
    "success": {
      "type": "boolean"
    },
    "folderPath": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  }
}

Worked examples

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Replace synthetic identifiers through credential-scoped discovery. Refused scenarios document failure boundaries; they are not successful workflows.

Successful request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "folderPath": "sdk-reports"
}

CLI:

topolo actions validate app_topolo_bytes.folders.create_alt --data @payload.json --json
topolo actions plan app_topolo_bytes.folders.create_alt --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.folders.create_alt --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.folders.create_alt",
    "input": {
      "folderPath": "sdk-reports"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "success": true,
  "folderPath": "sdk-reports/",
  "message": "Folder \"sdk-reports/\" created successfully"
}

HTTP 201. List the folder path and inspect the returned trailing-slash folderPath.

Another supported request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "folderPath": "reports"
}

CLI:

topolo actions validate app_topolo_bytes.folders.create_alt --data @payload.json --json
topolo actions plan app_topolo_bytes.folders.create_alt --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.folders.create_alt --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.folders.create_alt",
    "input": {
      "folderPath": "reports"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "success": true,
  "folderPath": "reports/",
  "message": "Folder \"reports/\" created successfully"
}

HTTP 201. List the folder path and inspect the returned trailing-slash folderPath.

Refused request · HTTP 400

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_bytes.folders.create_alt --data @payload.json --json
topolo actions plan app_topolo_bytes.folders.create_alt --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 400:

{
  "error": "Folder path is required"
}

HTTP 400. This request was refused; preserve the exact response and correct its cause before retrying.

Refused request · HTTP 409

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "folderPath": "dup"
}

CLI:

topolo actions validate app_topolo_bytes.folders.create_alt --data @payload.json --json
topolo actions plan app_topolo_bytes.folders.create_alt --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 409:

{
  "error": "Folder already exists (has .keep marker)",
  "folderPath": "dup/"
}

HTTP 409. This request was refused; preserve the exact response and correct its cause before retrying.

Verify the result

  • List the folder path and inspect the returned trailing-slash folderPath.

Errors and recovery

  • Folder path is required (HTTP 400): Correct the exact fields using the discovered input schema and prerequisites. Refused input examples demonstrate errors and must not be executed as successful workflows.
  • Folder already exists (has .keep marker) (HTTP 409): Inspect the existing target and workspace state. Resolve the documented conflict before resubmitting; do not erase content to bypass an emptiness or destination check.

Authentication, the action-input validator or resource middleware can refuse a request before this handler. Preserve the exact request id, error and selected credential context. The fixtures establish no live credentials or configured provider.

Recovery boundary

Remove an unwanted empty folder with folder.delete_alt; ensure it has acquired no valuable content first.

  • List files: List one page of files and directories in the verified workspace; eligible files can have derived thumbnails generated during listing.
  • Delete folder: Delete objects beneath one folder prefix. A nonempty folder requires force:true; action input wraps the HTTP query in a query object.

Evidence

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Capture digests and test scenarios are retained in the source fixture records.