Validate every row against the table (required, types, ranges, enums, links, unknown
const url = 'https://example.com/datanotes/operations/check_table/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"table":null,"limit":500,"offset":0}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/datanotes/operations/check_table/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "table": null, "limit": 500, "offset": 0 }'Validate every row against the table (required, types, ranges, enums, links, unknown
columns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, front matter that cannot be read: code unreadable, with no column, for a note whose table line names the table but whose YAML is broken, which every other read leaves out). A CHECK violation has code check and the CHECK’s name as constraint (every other code names its column), as in the violations of list_changes. Use it to find rows edited by hand that break the schema. Without table, every table is checked: each row then names its table, tables_checked counts the tables checked, and a table that cannot be checked is listed in errors ({table, error}) while the others are. The rows with violations are paged: limit (default 500, at most 5000) from offset; total counts them all. (Hand edits are also checked as they happen: see violations in list_changes.)
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Responses
Section titled “Responses”Done.
object
Qualified table; null when every table was checked.
Rows checked.
Tables checked (when every table was checked).
Rows breaking the rules in all (violations is the page from offset).
Tables that could not be checked (when every table was checked), with the reason.
object
Rows breaking the table’s rules (this page of them).
A row breaking the rules, with its table when every table was checked.
object
Row note path.
The row’s qualified table (when every table was checked).
What is wrong with this row.
object
The column the violation is about (every code but check and unreadable).
The item of a list column that breaks the rule, from 0.
The CHECK’s name (code check).
Kind of violation.
Agent-readable explanation.
The offending value, when there is one.
Example
{ "violations": [ { "violations": [ { "code": "required" } ] } ]}Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Missing or wrong bearer token.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Unknown table, view, migration, note or folder.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Ambiguous table name: it matches several tables (paths or tables lists them).
object
The tables’ folders the name matches.
The qualified tables the name matches.
Example generated
{ "error": "example", "paths": [ "example" ], "tables": [ "example" ]}Unexpected error.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}