Read-only schema inference from notes' front matter.
const url = 'https://example.com/datanotes/operations/infer_table/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"folder":null,"paths":null,"table":null,"name":null,"max_enum_values":null}'};
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/infer_table/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "folder": null, "paths": null, "table": null, "name": null, "max_enum_values": null }'Read-only schema inference from notes’ front matter.
folder(recursive; “” = whole vault) and/orpaths: notes not yet in a table. Returnscolumns(type, enumvalues, linkrefto the table most targets belong to,required,unique,dense,fromwhen the front matter key is not a valid column name,stats),proposal, the create_table arguments (name,description,filenameortime_column,columns), andadoptready for adopt_rows (paths,rename,relocate: false), plushintsto read. The notes cannot say what the table and its columns mean:descriptionis null on the proposal and on every column. Write each one (ask the user when unsure), and review the names, enums and required columns, before you pass the proposal to create_table, which refuses null descriptions.table: keys the table’s rows use but the table does not declare (candidates for add_column, each with a description to write, or keys to drop from rows). A string column becomes an enum when its values repeat: at least 3 notes, at mostmax_enum_valuesdistinct values (default 12), each used twice on average, short texts.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Responses
Section titled “Responses”Done.
object
Notes examined.
Their paths.
Notes left out, and why.
object
Inferred columns.
object
Original front matter key when it is not a valid column name.
What the column holds: null, for the caller to write (create_table and add_column refuse a column without one).
object
object
The arguments of create_table (folder/paths mode), once the caller writes the descriptions left null.
object
What a row of the table records: null, for the caller to write (each column’s description too).
The notes’ name template, when their names follow one.
A column spec.
object
Ready for adopt_rows once the table exists (folder/paths mode).
object
object
Remarks for the caller.
Example generated
{ "files": 1, "paths": [ "example" ], "skipped": [ { "path": "example", "reason": "example" } ], "columns": [ { "name": "example", "from": "example", "type": "example", "description": "example", "items": "example", "values": [ "example" ], "ref": "example", "required": true, "unique": true, "dense": true, "stats": { "present": 1, "filled": 1, "distinct": 1, "types": { "additionalProperty": 1 }, "examples": [ "example" ] } } ], "proposal": { "name": "example", "description": "example", "time_column": "example", "filename": "example", "columns": [ {} ] }, "adopt": { "paths": [ "example" ], "rename": { "additionalProperty": "example" }, "relocate": true }, "hints": [ "example" ]}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"}