Skip to content

docs: document POST /api/sandboxes/staged-files#198

Merged
sweetmantech merged 12 commits into
mainfrom
feature/sandbox-staged-files
May 11, 2026
Merged

docs: document POST /api/sandboxes/staged-files#198
sweetmantech merged 12 commits into
mainfrom
feature/sandbox-staged-files

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented May 9, 2026

Summary

Documents the new sandbox staged-files token-handshake endpoint that pairs with api#541. Adds an OpenAPI entry under content.json, a frontmatter-only MDX page, and the sandboxes nav slot in docs.json.

Test plan

  • python3 -m json.tool clean on api-reference/openapi/content.json and docs.json
  • npx mintlify@latest dev — verify the new "Stage Files" page renders under Sandboxes

Summary by cubic

Documents POST /api/sandboxes/staged-file for the Vercel Blob client-upload handshake.

OpenAPI notes @vercel/blob/client usage, adds a 100MB limit and 401/500 responses, adds a Stage File page (stage-file.mdx), renames Upload→Upload Files and File→Get File, and updates the Sandboxes nav.

Written for commit 9d79852. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • Added a new API endpoint for staging files with direct browser uploads to Vercel Blob using a two-step handshake process.
    • Added documentation page for the file staging endpoint.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbe3ba27-4785-428e-9c30-a44f132d1a1e

📥 Commits

Reviewing files that changed from the base of the PR and between 4820191 and 9d79852.

📒 Files selected for processing (5)
  • api-reference/openapi/content.json
  • api-reference/sandboxes/get-file.mdx
  • api-reference/sandboxes/stage-file.mdx
  • api-reference/sandboxes/upload-files.mdx
  • docs.json

📝 Walkthrough

Walkthrough

This PR adds documentation for a new POST /api/sandboxes/staged-file endpoint that implements a two-step handshake for browser direct uploads to Vercel Blob storage. The OpenAPI specification, MDX documentation page, and navigation routing configuration are introduced.

Changes

Sandboxes File Staging Endpoint

Layer / File(s) Summary
OpenAPI Specification
api-reference/openapi/content.json
New POST /api/sandboxes/staged-file endpoint defined with generic object request/response schemas for Vercel Blob client passthrough and 401, 500 error responses documented.
Documentation Page
api-reference/sandboxes/stage-file.mdx
MDX page created with frontmatter linking to the new OpenAPI endpoint specification.
Navigation Configuration
docs.json
Sandboxes section routes updated from file and upload to get-file, stage-file, and upload-files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • recoupable/docs#84: Both PRs modify the sandboxes file-upload flow in the OpenAPI spec: this PR adds a new POST /api/sandboxes/staged-file handshake for direct browser uploads to blob storage while the related PR switches POST /api/sandboxes/files to accept blob URLs — they target complementary parts of the same blob-based upload workflow.

Suggested reviewers

  • sweetmantech

Poem

🐰 A handshake so neat, two steps to complete,
Blob uploads now sweet, browser uploads so fleet,
Docs staged and in place, routes find their grace,
The file staging race is won with this pace! 📤

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title references '/api/sandboxes/staged-files' (plural) but the actual endpoint and documentation added is for '/api/sandboxes/staged-file' (singular). Update the PR title to 'docs: document POST /api/sandboxes/staged-file' to match the actual endpoint name in the changeset.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sandbox-staged-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="api-reference/openapi/content.json">

<violation number="1" location="api-reference/openapi/content.json:361">
P1: The endpoint path appears mistyped as `/api/sandboxes/stage-files`; this should remain `/api/sandboxes/staged-files` to match the API being documented.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Comment thread api-reference/openapi/content.json Outdated
@cubic-dev-ai
Copy link
Copy Markdown

cubic-dev-ai Bot commented May 9, 2026

You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment @cubic-dev-ai review.

arpitgupta1214 and others added 12 commits May 11, 2026 17:51
Pairs with api PR adding the Vercel Blob client-upload handshake
endpoint. Adds OpenAPI entry to content.json, MDX page, and
sandboxes nav entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Page documents POST /api/sandboxes/files (the GitHub-commit half of
the sandbox upload flow). With the new staged-files page covering
the Vercel Blob handshake half, "Upload Files" was ambiguous —
"Commit Files" matches what the endpoint actually does.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stage as a verb (matches Commit Files) reads more naturally than the
adjective form, and Get File matches the GET method.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Matches the existing /api/sandboxes/file noun pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Endpoint stays /api/sandboxes/staged-file (noun); docs filenames are
verb-shaped because the HTTP method is not in the path
(parallel: commit-files.mdx for POST /api/sandboxes/files).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The /api/sandboxes/files endpoint accepts any URL but its cleanup
step assumes Vercel Blob — the two endpoints are coupled in a way
that doesn't justify locking in commit/stage semantics in the docs
yet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verb-noun shape parallels stage-file and get-file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pairs with the api-side change to hide raw exception details and
return a generic 500.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sweetmantech sweetmantech force-pushed the feature/sandbox-staged-files branch from a0e7fe1 to 9d79852 Compare May 11, 2026 22:51
@sweetmantech sweetmantech merged commit b6dbc66 into main May 11, 2026
1 of 2 checks passed
@sweetmantech sweetmantech deleted the feature/sandbox-staged-files branch May 11, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants