What it does
Upload one image or short video (png, jpg, gif, webp, avif, mp4, webm) into a file column of a site table. Send one of content_base64 or source_url (a public https link Pagehive downloads, up to max_file_bytes). The type is read from the bytes. The answer's file is the address (/_pagehive/uploads/<id>.<ext>); write it into the column with create_row, update_row or bulk_upsert_rows, within 24 hours, or the upload is removed. The file shows on the site at once, to whoever may read its row; no publish. Counts against max_file_bytes and the account's storage; at most 20 uploads per table may wait for a row. create_file_upload_url sends a file from your disk without the bytes passing through a call. Site files for pages (/files/name) are upload_file.
Plans
Works on every plan: Free, Basic, Pro and Ultra.
Parameters
| Name | Type | About |
|---|---|---|
namerequired | string | The table. |
columnrequired | string | The file column's key. |
content_base64 | string | The file's bytes as base64. Only for small files: use create_file_upload_url for anything bigger. |
source_url | string | A public https link to the file. Pagehive downloads it. |
site_id | string | Only for a site shared with you (whoami lists them): read or change that site's data as its member. |
idempotency_key | string | Any unique string (1-200 printable ASCII). A retry with the same key and arguments returns the first call's result instead of running again. Same as the Idempotency-Key header. |
Example
Call upload_row_file with these arguments:
{
"name": "articles",
"column": "image",
"source_url": "https://example.com/photo.jpg"
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Photos and videos in tablesAdd photos and short videos to rows, from a form or through your agent.