RecoupGet a Free AuditFree Audit

API REFERENCE

Stage File

On this page
POST/api/sandboxes/staged-file

Issue a presigned upload token so the browser can upload a file directly to Vercel Blob, then call POST /api/sandboxes/files with the resulting blob URL to commit it to the sandbox repo. Use upload() from @vercel/blob/client rather than calling this route by hand. Max file size 100MB.

Authentication

See the authentication guide for API key and account access requirements.

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/sandboxes/staged-file' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{}'

Request body required

HandleUploadBody envelope from @vercel/blob/client.

application/json

object

Additional properties

Additional keys are allowed.

Responses

200Handshake response from @vercel/blob/client — return verbatim to the library.

application/json

object

Additional properties

Additional keys are allowed.

401Missing or invalid auth on the handshake POST.

application/json

errorstringrequired

Error message describing what went wrong

500Invalid body or upstream Vercel Blob failure.

application/json

errorstringrequired

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "description": "Issue a presigned upload token so the browser can upload a file directly to Vercel Blob, then call `POST /api/sandboxes/files` with the resulting blob URL to commit it to the sandbox repo. Use `upload()` from `@vercel/blob/client` rather than calling this route by hand. Max file size 100MB.",
  "requestBody": {
    "description": "`HandleUploadBody` envelope from `@vercel/blob/client`.",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "additionalProperties": true
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Handshake response from `@vercel/blob/client` — return verbatim to the library.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "401": {
      "description": "Missing or invalid auth on the handshake POST.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SandboxErrorResponse"
          }
        }
      }
    },
    "500": {
      "description": "Invalid body or upstream Vercel Blob failure.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SandboxErrorResponse"
          }
        }
      }
    }
  }
}