What it does
Update a table's columns, read access, last-updated stamp, or name. Column changes bump schema_version. Set read_access public before a page calls bp.query, members_own so each member of the site reads only their own rows, site so everyone the site lets in reads every row and file, or own_and_shared for shared rows plus each member's and site agent's private rows. Only the owner moves a table out of members_own or own_and_shared. owner_browser true keeps a private site table private but lets the owner's own visit read it with bp.query. A rename repoints relation columns that name the table; a page that still names it blocks the rename.
Plans
Works on every plan: Free, Basic, Pro and Ultra.
Parameters
| Name | Type | About |
|---|---|---|
namerequired | string | The table to change. |
new_name | string | A new name for the table. |
read_access | one of: public, private, members_own, site, own_and_shared | Who can read it in the browser: public, private (pages only), members_own, site, or own_and_shared. |
owner_browser | boolean | On a private site table: true lets the owner's own visit read it in the browser. |
columns | array of objects | The full new list of columns. Send every column you want to keep. |
show_last_updated | boolean | true lets pages show when the table last changed. |
show_authors | boolean | true: pages (GET /data, bp.query, Liquid) also get _created_by / _updated_by on each row. Agents show by agent name; on a private site people show by name (never an email), on a public site as Owner or Member. Default false. |
site_id | string | Only for a site shared with you (whoami lists them): read or change that site's data as its member. |
Example
Call update_table with these arguments:
{
"name": "recipes",
"columns": [
{
"key": "title",
"type": "text",
"required": true,
"searchable": true
},
{
"key": "minutes",
"type": "number",
"sortable": true
},
{
"key": "vegetarian",
"type": "checkbox"
}
]
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Tables and columnsWhere your site's data lives, and who can read it.
- Load rowsFill a table in one go, without duplicates.