Skip to main content
POST
Stage restore upload (limited rollout)
The staged upload contract sends dump bytes directly from the browser or CLI to an isolated S3 prefix. The file does not transit Vercel, Caddy, or the agent request body.
Limited availability: this is not a normal customer or published CLI workflow. Upload initialization requires the exact restore rollout binding and agent capability. Other databases receive FEATURE_NOT_AVAILABLE, and uploading an artifact does not by itself authorize or start a restore.
The historical multipart POST /api/v1/databases/{id}/backups/restore route remains only as a fail-closed compatibility endpoint. It never reads the upload body or calls the agent: exact rollout targets receive PRESIGNED_UPLOAD_REQUIRED, while all other targets receive FEATURE_NOT_AVAILABLE.

Supported files

Maximum object size is 512 MB. The client supplies the exact size and SHA-256 checksum during initialization and completion. Plain .sql and .sql.gz input is limited to 512 MB after decompression and 16 MiB per physical SQL line, including one COPY row. Use custom-format .dump or .backup when a single value requires a larger line. Restore staging has a 30-minute execution deadline; the separate five-minute maintenance window starts only when a validated staging database is ready to swap.

1. Initialize upload

POST /api/v1/databases/{id}/backups/restore-upload/init Send a unique Idempotency-Key header and reuse it only when retrying this exact database, filename, size, and checksum binding. The CLI generates one for each new upload. The key must contain 8-128 characters.
202 Accepted
The presigned URL is bound to the operation, object ID, isolated prefix, size, checksum, content type, encryption policy, and a 15-minute expiry. Treat it as a temporary secret. Send every returned form field unchanged and append the file as the final multipart field named file.

2. Upload directly

Send the file bytes to the returned S3 URL using the exact method and form fields. Do not send the DBHost API key to S3. The dump never passes through a DBHost API, Vercel, Caddy, or agent request body.

3. Complete upload

POST /api/v1/databases/{id}/backups/restore-upload/complete
202 Accepted
Completion verifies the object binding, size and checksum before format/schema validation. Poll GET /api/v1/operations/{id} for further status.

Errors