Metadata tables
A metadata table records facts about the fields a record already has, never new attributes. If you want to record something new about a record, such as a colour, a size or a contract term, add a field to the table. A metadata table is for facts about a field’s value: where an invoice’s total was read on the scanned page, how sure the scanner was, or who confirmed it.
Each metadata row is about exactly one field of one record. An invoice with a
detections metadata table has at most one detection row for its total and
one for its due_date, and nothing else.
When to use one
Section titled “When to use one”| You want to keep… | Use |
|---|---|
| A new piece of information about the record (a colour, a supplier, a VAT number) | A field on the table |
| Several values per record that each have their own fields (an invoice’s lines) | A child table with a reference to the record |
| Facts about one existing field’s value (its position on a page, a confidence score, a reviewer’s note) | A metadata table |
A table of attribute / value rows stands in for missing fields and loses
their types, validation, filters, rollups and permissions. Schema plan
validation warns ATTRIBUTE_VALUE_TABLE on any table or metadata table shaped
that way, and names the fields to create instead. Acknowledge the warning only
for a genuine key/value store, such as settings or translations.
Declaring a metadata table
Section titled “Declaring a metadata table”A metadata table belongs to one table, its host, and has:
- a name (
detections), unique on the host, and a label (Detections); - coverage: the host fields its rows may be about, listed by name, or every stored field of the host;
- its own fields: simple values only (text, numbers, currency, dates and times, picklists, checkboxes, email, phone, URL, a geolocation or a region), never references, attachments or computed fields;
- append-only (the default): a row, once written, is never edited in place. Delete it and write a new one instead. Turn it off for notes people correct;
- a summary field: the one value shown beside the covered field.
A table carries at most five metadata tables. Declare one with
POST /tables/{tableId}/metadata-tables, which needs tables:manage, or in a
schema plan under the table’s metadata key (or addMetadata for a table that
already exists). List a table’s metadata tables with
GET /tables/{tableId}/metadata-tables.
Deleting the host table deletes its metadata tables with it. Deleting a field keeps the metadata about it, so restoring the field restores its metadata; purging the field deletes its metadata for good.
Who can see metadata
Section titled “Who can see metadata”Metadata is never more visible than the field it describes. A reader sees a metadata row only when they can read both:
- the host record, under the host table’s row scope and rules; and
- the host field, under its field visibility.
There is no separate read permission to grant. The same rule applies to every surface that can show metadata: record reads, SQL queries, exports, views, rollups, flows, webhooks and the realtime stream.
Who can write metadata
Section titled “Who can write metadata”Writing a metadata row needs all of these:
- the right to edit the host record (its update scope);
- the right to change the covered field;
records:createfor a new row,records:updateto replace one, orrecords:deleteto remove one;- a grant on the metadata table for that verb.
Grants are per role and per metadata table, with separate create, update and
delete. Members hold none by default; workspace admins hold create and delete.
Manage them with PUT /roles/{roleId}/metadata-tables/{metadataTableId}, which
needs permissions:manage. An editor who is not a workspace admin can grant
only what they hold on that metadata table themselves.
Reading and writing over the API
Section titled “Reading and writing over the API”Read a record’s metadata with the record: GET /tables/{tableId}/items/{itemId}
with the query parameter metadata=detections adds a metadata object to the
record, keyed by metadata table and then by field name. Use metadata=* for
every metadata table the host carries. Read one metadata table on its own
with GET /tables/{tableId}/items/{itemId}/metadata/{metadataName}.
Write one field’s row with
PUT /tables/{tableId}/items/{itemId}/metadata/{metadataName}/{fieldName}:
{ "data": { "page": 1, "confidence": 0.94 } }The first write creates the row (201); a later one replaces its values
(200), unless the table is append-only. Remove the row with DELETE on the
same path. The record and the field come from the path, so a write can never
move a row to another record or field. Metadata tables have no other write
path: the generic record endpoints, bulk writes, imports and flows refuse them.
Each write leaves one entry on the host record’s history, counting the rows created, updated and deleted per field. Readers see only the fields they can read, and an entry about fields they cannot read is not shown to them.
Your workspace’s own OpenAPI document types each table’s metadata tables, their fields and these operations.
Over MCP
Section titled “Over MCP”get_table_schema lists a table’s metadata tables. create_record and
update_record take an optional metadata argument, written after the
record through the same path as the API:
{ "detections": { "total": { "page": 1, "confidence": 0.94 }, "due_date": null } }null deletes that field’s row. Each entry succeeds or fails on its own, and
the result lists them under metadata.written and metadata.failed.
Rollups over metadata
Section titled “Rollups over metadata”A rollup on the host can summarise its metadata through _record, for example
an invoice’s lowest detection confidence. A rollup counts only rows about
fields the viewer can read, so a hidden field’s confidence never shows through
the summary.