FlatpageDocs
Uploads

Start a big upload

Step 1 of the two-step upload for files over 25 MB (PDFs on Plus go up to 500 MB). Answers a signed putUrl: PUT the file there with exactly the contentType given (step 2), then call POST /uploads/{uploadId}/complete (step 3). The URL expires after 15 minutes.

POST
/uploads
AuthorizationBearer <token>

An API key from Settings in the dashboard (fpk_...), or an OAuth access token from the MCP sign-in.

In: header

fileNamestring

Ends in .html, .zip or .pdf.

contentType?string | null

Optional; the extension decides.

bytesinteger

Exact file size.

Formatint64
siteId?string | null

Replace this site (id or link name) instead of publishing a new one.

linkName?string | null

Link name for a new site. Not allowed with siteId.

Response Body

curl -X POST "https://flatpage.app/v1/uploads" \  -H "Content-Type: application/json" \  -d '{    "fileName": "brochure.pdf",    "bytes": 0  }'
{
  "uploadId": "ef523ba8-509e-47af-8e2c-5fa751596497",
  "kind": "html",
  "putUrl": "http://example.com",
  "contentType": "string",
  "expiresAt": "2019-08-24T14:15:22Z"
}
{
  "error": "site not found"
}
{
  "error": "site not found"
}
{
  "error": "site not found"
}
{
  "error": "site not found"
}
{
  "error": "site not found"
}
{
  "error": "site not found"
}
{
  "error": "site not found"
}