create_database
Make a database in a space: Airtable-style tables of records with typed fields (text, numbers, choices, dates, people, attachments, links between tables). People see each table as a grid, add and edit records in it, and open a record's fields in a side panel. Give its tables with their fields and records; link fields can point at any table given; a record given as { values, page } also gets its page of notes (Markdown). Read guide topic "databases" first; check it with render_database.
Parameters
space_idstringrequiredtitlestringrequiredtablesobject[]requiredShow child attributes
namestringrequiredfieldsobject[]requiredShow child attributes
namestringrequiredtypestringrequiredtext, long_text, number, checkbox, select, multi_select, date, url, email, phone, file, person, link.choicesstring[]formatstringplain, currency, percent.currencystringdecimalsintegerlinkstringrecordsobject[]Show child attributes
valuesobjectrequiredpagestringrequiredread_database
A database as it is now, people's edits included: each table with its id, fields (id, name, type, choices, format, the table a link points at) and how many records. list_records gives the records.
Parameters
item_idstringrequiredlist_records
Records of one table, each with its id (what update_records, delete_records and comment take) and its values by field name as people read them (a person by name, links by the names of the records); pages: true adds each record's page (its notes, Markdown). Filter, search (fields and pages), sort and page through them; total says how many match.
Parameters
item_idstringrequiredtablestringrequiredfiltersobject[]Show child attributes
fieldstringrequiredopstringrequiredis, is_not, contains, not_contains, gt, gte, lt, lte, empty, not_empty.valueanysearchstringsortobject[]Show child attributes
fieldstringrequireddescbooleanfieldsstring[]pagesbooleanlimitintegeroffsetintegeradd_records
Add records to a table (up to 1000 a call), at the end or after a record. Returns their ids. A select value that is not a choice yet is added as one.
Parameters
item_idstringrequiredtablestringrequiredrecordsobject[]requiredShow child attributes
valuesobjectrequiredpagestringrequiredafterstringupdate_records
Change records of a table by id: only the fields given change; null or "" clears one. page replaces the record's page (Markdown; "" clears it).
Parameters
item_idstringrequiredtablestringrequiredrecordsobject[]requiredShow child attributes
idstringrequiredvaluesobjectpagestringdelete_records
Delete records of a table by id; links to them from other tables are taken off.
Parameters
item_idstringrequiredtablestringrequiredidsstring[]requiredupdate_database
Change a database's shape. Any of: title; add_tables (with fields and records); rename_tables; remove_tables (with their records; links into them become text); add_fields; change_fields (by table and field name or id: a new name, type — values are converted through their text, what does not read is cleared — choices, format, link); remove_fields; move_fields (to a 0-based column; 0 makes it the first field, which names records). Applied in that order, all or none.
Parameters
item_idstringrequiredtitlestringadd_tablesobject[]Show child attributes
namestringrequiredfieldsobject[]requiredShow child attributes
namestringrequiredtypestringrequiredtext, long_text, number, checkbox, select, multi_select, date, url, email, phone, file, person, link.choicesstring[]formatstringplain, currency, percent.currencystringdecimalsintegerlinkstringrecordsobject[]Show child attributes
valuesobjectrequiredpagestringrequiredrename_tablesobject[]Show child attributes
tablestringrequirednamestringrequiredremove_tablesstring[]add_fieldsobject[]Show child attributes
tablestringrequiredfieldobjectrequiredShow child attributes
namestringrequiredtypestringrequiredtext, long_text, number, checkbox, select, multi_select, date, url, email, phone, file, person, link.choicesstring[]formatstringplain, currency, percent.currencystringdecimalsintegerlinkstringatintegerchange_fieldsobject[]Show child attributes
tablestringrequiredfieldstringrequiredchangesobjectrequiredShow child attributes
namestringtypestringtext, long_text, number, checkbox, select, multi_select, date, url, email, phone, file, person, link.choicesstring[]formatstringplain, currency, percent.currencystringdecimalsintegerlinkstringremove_fieldsobject[]Show child attributes
tablestringrequiredfieldstringrequiredmove_fieldsobject[]Show child attributes
tablestringrequiredfieldstringrequiredtointegerrequiredimport_records
Fill a table from a range of one of the space's spreadsheets: the range's first row names the fields, each row under it is a record. A header that matches no field adds one (number when every value is a number, else text). Values are read as the sheet shows them; cleaned like add_records.
Parameters
item_idstringrequiredtablestringrequiredsheetstringrequiredrangestringrequiredrender_database
See a database as people do: a screenshot of one table's grid (the first by default), with a record's side panel open when record is given, and errors the page hit.
Parameters
item_idstringrequiredtablestringrecordstring