# METADATA TABLES Invoke the Metadata Tables API to create, retrieve, update, and delete Tabular Attributes, a Metadata Attribute type that stores structured, multi-column data on an Asset. ## (NEW!) List Metadata Tables (Paginated) - [GET /metadata/tables](https://api.tenovos.com/openapi/v1.5/metadata-tables/listmetadatatables.md): Retrieve a paginated, searchable list of metadata tables for UI consumption. Column detail is excluded to keep this endpoint lightweight; only a count (fieldCount) is returned here, with full column detail available via GET /metadata/tables/{id}. Defaults: - sortField defaults to name. - order defaults to asc. - from defaults to 0. - limit defaults to 100, maximum 100. Business Rules: - searchTerm is a case-insensitive partial match on table name. - inUse accepts a boolean (true/false — aggregate: used anywhere at all) or one of metadataGroups, metadataTemplates, filtering to tables referenced in that specific usage category. Omitted applies no filter. inUse and isSmartTable are both valid sortField values. - isSmartTable filters to smart or standard tables only; omitted applies no filter. - includeSystem defaults to false. When true, also returns read-only, platform-owned tables used internally by various platform functionalities, alongside user-created ones. System tables cannot be edited or deleted by users. - visible and tableNameVisible are excluded entirely from this response — both are dead fields (the admin screen never lets anyone set either to anything but its fixed default). - usedIn is shaped { metadataGroups: [], metadataTemplates: [] } and never includes an attributes category — attributes never reference a table; a table contains attributes as its columns, never the reverse. The user submitting the request must have the Metadata Template Management admin privilege. ## (NEW!) Create Metadata Table - [POST /metadata/tables](https://api.tenovos.com/openapi/v1.5/metadata-tables/createmetadatatable.md): Create a new metadata table in a single call. Defaults: - isSmartTable defaults to false. Business Rules: - tableFields must contain between 1 and 12 effective columns — a plain or controlled-vocabulary field counts as 1, a cascade field counts as its number of levels. Example: a table with 9 plain fields can add one more cascade only if that cascade has 3 or fewer levels. - Each tableFields[].fieldId must reference an existing attribute or cascade (never another table); no two entries may reference the same fieldId. - isSingleRow and isSmartTable are mutually exclusive and permanently fixed once set. - isSmartTable is subject to a 25-per-customer smart-table cap, enforced at creation time. - A duplicate name/searchField is rejected with 409. The user submitting the request must have the Metadata Template Management admin privilege. ## (NEW!) Get Metadata Table - [GET /metadata/tables/{id}](https://api.tenovos.com/openapi/v1.5/metadata-tables/getmetadatatable.md): Retrieve a single metadata table by its ID, returning the same fields as the list endpoint (minus fieldCount) plus the full, flat list of columns (tableFields), each denormalized with a type indicator so the UI can render the right control without a second lookup. The user submitting the request must have the Metadata Template Management admin privilege. ## (NEW!) Update Metadata Table - [PATCH /metadata/tables/{id}](https://api.tenovos.com/openapi/v1.5/metadata-tables/updatemetadatatable.md): Update an existing table's name and/or its column list. searchField, isSingleRow, isSmartTable, and featured are permanently fixed once set and are never accepted here — featured in particular exists specifically to protect a table from deletion; if it could be toggled here, that protection would mean nothing. Business Rules: - At least one of name, tableFields is required. - name is capped at 32 characters and does not regenerate searchField. - When tableFields is provided, it fully replaces the existing columns — same effective-12-column, valid-reference, and no-duplicate-fieldId rules as create. - A new name colliding with an existing table's name/searchField is rejected with 409. The user submitting the request must have the Metadata Template Management admin privilege. ## (NEW!) Delete Metadata Table - [DELETE /metadata/tables/{id}](https://api.tenovos.com/openapi/v1.5/metadata-tables/deletemetadatatable.md): Permanently remove a metadata table by its ID. Deletion is blocked if the table is featured, and blocked if it is still referenced by any group or template. Business Rules: - Checks run in this order: not found, then featured, then in-use. The user submitting the request must have the Metadata Template Management admin privilege. ## (NEW!) Convert Metadata Table to Smart Table - [POST /metadata/tables/{id}/convert-to-smart](https://api.tenovos.com/openapi/v1.5/metadata-tables/convertmetadatatabletosmart.md): Stage a standard table for one-way conversion to a smart table. This endpoint does not perform the search-index remapping migration itself — that happens later, generically, when the admin applies changes in the metadata admin screen. Conversion is irreversible once it completes, which is why it's its own deliberate endpoint rather than something that could happen as a side effect of a routine field update via PATCH /metadata/tables/{id}. Business Rules: - isSingleRow tables cannot be converted. - At least one column, directly or via a cascade level, must be facetable. - Subject to the same 25-per-customer smart-table cap enforced at creation. - A table that's already smart, or already has a conversion pending, is rejected with 409. The user submitting the request must have the Metadata Template Management admin privilege.