request_upload_url
Get a short-lived upload URL for a website. The returned URL is a session-based
endpoint — PUT file bytes directly to it with the filename as a query parameter.
Prefer upload_asset with the url parameter for typical image uploads and
migrations. request_upload_url is intended for large local files that exceed
upload_asset’s size limits.
Usage
- Call
request_upload_urlwith the website identifier - PUT files to the returned URL with the filename as a query parameter and the matching
Content-Typeheader:PUT https://pageweave.dev/api/v1/websites/uploads/:id?filename=photo.jpg Content-Type: image/jpeg [file bytes] - Session expires in 10 minutes
Parameters
website— Website subdomain, domain, or UUIDasset_id— Optional existing asset UUID. When set, the PUT replaces that asset’s bytes (URL/filename preserved) instead of creating a new asset. TheContent-Typeheader on the PUT must match the existing asset’s content type. If the asset is deleted between therequest_upload_urlcall and the PUT, the PUT returns 422 with"Asset not found".
Response
| Field | Type | Description |
|---|---|---|
upload_url |
string | Session-based URL for the PUT upload |
expires_at |
string (ISO 8601) | When the session expires |
storage |
object | used_bytes and limit_bytes for the website |
Size Limits
Effective max = min(per-type cap, remaining website storage):
| Content type | Cap |
|---|---|
| Images | 5MB |
| Fonts | 2.5MB |
| Video | 15MB |
| Audio | 15MB |
| Other (PDF, docs, archives) | 10MB |
OAuth Scopes
| Action | Scope |
|---|---|
| request_upload_url | asset:write |
| request_upload_url with asset_id (replace) | asset:write |