FlatpageDocs

Big files

The two-step upload for files over 25 MB.

Bodies sent straight to POST /v1/sites or PUT /v1/sites/{site} can be up to 25 MB. Bigger files, up to your plan's limit (100 MB on Starter, 500 MB on Plus), go straight to storage in three steps.

Ask for an upload URL

curl -X POST https://flatpage.app/v1/uploads \
  -H "Authorization: Bearer $FLATPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "brochure.pdf", "bytes": 48000000, "linkName": "brochure"}'
{
  "uploadId": "1b7c…",
  "kind": "pdf",
  "putUrl": "https://storage.googleapis.com/…",
  "contentType": "application/pdf",
  "expiresAt": "2026-11-02T16:15:00Z"
}

bytes must be the exact file size. To replace an existing site instead of publishing a new one, send siteId (its id or link name) instead of linkName.

PUT the file to putUrl

Send exactly the contentType from step 1; it's part of the URL's signature. No Authorization header here. The URL expires after 15 minutes.

curl -X PUT "$PUT_URL" -H "Content-Type: application/pdf" --data-binary @brochure.pdf

Tell us it's there

curl -X POST "https://flatpage.app/v1/uploads/$UPLOAD_ID/complete" \
  -H "Authorization: Bearer $FLATPAGE_API_KEY"

This answers like a direct publish: 200 with the live site, or 202 while it's still processing.