Skip to content

Update exactly ONE row, addressed by its `id` (the system UUID) or its `path`; refused when

POST
/datanotes/operations/update_row/
curl --request POST \
--url https://example.com/datanotes/operations/update_row/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \
--data '{ "table": "example", "id": null, "path": null, "set": null, "unset": null, "body": null, "body_sections": null, "body_prepend": null, "expect": null, "body_append": null, "dry_run": false, "autolink": null }'

Update exactly ONE row, addressed by its id (the system UUID) or its path; refused when the row does not exist (or id and path disagree). Same validation, journal and history as update_rows.

  • set / unset: columns to set or remove.
  • body: replace the whole note body; or edit it keeping the rest: body_sections {"History": "…"} replaces the text under that heading (any level, up to the next heading of the same level; added as ## History when missing), body_prepend / body_append add text before / after.
  • expect: compare-and-set — {"status": "open"} writes only if the row still has those values (a person may have changed it since you read it); otherwise refused, nothing written.
  • autolink: the text written links the notes it mentions by name, at their first mention (off with autolink: false or the database’s setting). links_added lists the links made; ambiguous_mentions the mentions left as text with the notes they may name: read those, then link the right one with update_row and autolink: false, or leave the text.
X-Datanotes-Actor
string

JSON: on whose behalf the write is made, recorded in the journal (harness, model, session).

Example

{"harness":"my-script","model":"","session":"s-1"}
Media typeapplication/json
object
table
required
string
id
Any of:
string
path
Any of:
string
set
Any of:
object
key
additional properties
any
unset
Any of:
Array<string>
body
Any of:
string
body_sections
Any of:
object
key
additional properties
string
body_prepend
Any of:
string
expect
Any of:
object
key
additional properties
any
body_append
Any of:
string
dry_run
boolean
autolink
Any of:
boolean

Done.

Media typeapplication/json
OpResult

Result of a write operation. A refusal (ok false) is answered with HTTP 422, a failed write with 500, so a 2xx body has ok true.

object
ok
required

True when the operation was applied (or, on a dry run, would be).

boolean
op
required

The operation, by the name it was called with (e.g. insert_row, create_table, recompute_columns).

string
dry_run
required

True when nothing was written (preview).

boolean
migration_id

Journal id of the applied operation: pass it to undo_migration. Absent on a dry run.

string
notes_changed
required

Notes whose front matter or body were written.

integer
files_created
required

Files created.

integer
files_moved
required

Files moved or renamed.

integer
files_deleted
required

Files deleted or archived.

integer
references_updated
required

Links rewritten in other notes.

integer
conflicts
required

Reasons the operation was refused (empty on success).

Array<object>
object
path
required

Note or file path.

string
message
required

Why the operation cannot proceed.

string
violations
required

Rows that would break the table’s rules (empty on success).

Array<object>
RowViolations

The violations of one row.

object
path
required

Row note path.

string
violations
required

What is wrong with this row.

Array<object>
Violation
object
column

The column the violation is about (every code but check and unreadable).

string
index

The item of a list column that breaks the rule, from 0.

integer
constraint

The CHECK’s name (code check).

string
code
required

Kind of violation.

string
Allowed values: required inverse type min max step enum broken_link ref unique unknown_column check generated cycle vocabulary unreadable
message
required

Agent-readable explanation.

string
value

The offending value, when there is one.

failed
required

Files that could not be written (empty on success).

Array<object>
object
path
required

Vault path.

string
error
required

What went wrong.

string
rolled_back

Set when a write failed partway (failed): true when the engine put back what it had written, so nothing is left written; false when that rollback failed too (failed names the files left, and undo_migration on migration_id retries it).

boolean
planned_edits
required

Front matter edits per note (planned, or made).

Array<object>
object
path
required

Note path.

string
set
required

Front matter keys set, with their new values.

object
key
additional properties
any
remove
required

Front matter keys removed.

Array<string>
body

True when the note body changes too.

boolean
planned_creates
required

Paths of notes created.

Array<string>
planned_moves
required

Files moved: from → to.

Array<object>
object
from
required
string
to
required
string
planned_deletes
required

Paths deleted (or archived).

Array<string>
planned_texts
required

Files rewritten whole, e.g. metastore.yaml for DDL.

Array<string>
commits

Transaction-log commits written (tables with history on).

Array<object>
object
table
required

Qualified table.

string
version
required

New log version.

integer
operation
required

Log operation, e.g. WRITE.

string
links_added

Links the write added to the text it wrote: the notes the text mentions by name (automatic links). Present when there is one.

Array<object>
LinkAdded

A link the write added in place of a mention.

object
path
required

The note the link was written into.

string
text
required

The mention, as written.

string
target
required

Vault path of the note it links.

string
link
required

The link written in place of the mention.

string
ambiguous_mentions

Mentions left as text because the engine is not sure which note they name. Present when there is one: read the candidates and the context, then link the right one with update_row and autolink: false, or leave the text.

Array<object>
LinkAmbiguous

A mention left as text: more than one note could be meant.

object
path
required

The note the mention is in.

string
text
required

The mention, as written.

string
reason
required

Same_name: several notes have this name; adjacent: names of different notes side by side, which may be one name; overlap: names of notes overlap; part_of_name: a capitalized word next to it suggests a longer name; sentence_start: a one-word name at the start of a sentence, a line, a list item or a label, where its capital says nothing.

string
Allowed values: same_name adjacent overlap part_of_name sentence_start
candidates
required

Vault paths of the notes it may name.

Array<string>
context
required

The line around the mention.

string
hint
required

What to do: read the candidates, then link the right one with update_row and autolink: false, or leave the text.

string

Example

{
"violations": [
{
"violations": [
{
"code": "required"
}
]
}
],
"ambiguous_mentions": [
{
"reason": "same_name"
}
]
}

Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A named token beyond its permissions (the engine’s administration, tables outside its write patterns, schema changes without ddl).

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unknown table, view, migration, note or folder.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Ambiguous table name: it matches several tables (paths or tables lists them).

Media typeapplication/json
object
error
required
string
paths

The tables’ folders the name matches.

Array<string>
tables

The qualified tables the name matches.

Array<string>

Example generated

{
"error": "example",
"paths": [
"example"
],
"tables": [
"example"
]
}

Refused (validation failures, conflicts, an unmet expect): nothing written. Same body as 200, with ok: false and the reasons.

Media typeapplication/json
OpResult

Result of a write operation. A refusal (ok false) is answered with HTTP 422, a failed write with 500, so a 2xx body has ok true.

object
ok
required

True when the operation was applied (or, on a dry run, would be).

boolean
op
required

The operation, by the name it was called with (e.g. insert_row, create_table, recompute_columns).

string
dry_run
required

True when nothing was written (preview).

boolean
migration_id

Journal id of the applied operation: pass it to undo_migration. Absent on a dry run.

string
notes_changed
required

Notes whose front matter or body were written.

integer
files_created
required

Files created.

integer
files_moved
required

Files moved or renamed.

integer
files_deleted
required

Files deleted or archived.

integer
references_updated
required

Links rewritten in other notes.

integer
conflicts
required

Reasons the operation was refused (empty on success).

Array<object>
object
path
required

Note or file path.

string
message
required

Why the operation cannot proceed.

string
violations
required

Rows that would break the table’s rules (empty on success).

Array<object>
RowViolations

The violations of one row.

object
path
required

Row note path.

string
violations
required

What is wrong with this row.

Array<object>
Violation
object
column

The column the violation is about (every code but check and unreadable).

string
index

The item of a list column that breaks the rule, from 0.

integer
constraint

The CHECK’s name (code check).

string
code
required

Kind of violation.

string
Allowed values: required inverse type min max step enum broken_link ref unique unknown_column check generated cycle vocabulary unreadable
message
required

Agent-readable explanation.

string
value

The offending value, when there is one.

failed
required

Files that could not be written (empty on success).

Array<object>
object
path
required

Vault path.

string
error
required

What went wrong.

string
rolled_back

Set when a write failed partway (failed): true when the engine put back what it had written, so nothing is left written; false when that rollback failed too (failed names the files left, and undo_migration on migration_id retries it).

boolean
planned_edits
required

Front matter edits per note (planned, or made).

Array<object>
object
path
required

Note path.

string
set
required

Front matter keys set, with their new values.

object
key
additional properties
any
remove
required

Front matter keys removed.

Array<string>
body

True when the note body changes too.

boolean
planned_creates
required

Paths of notes created.

Array<string>
planned_moves
required

Files moved: from → to.

Array<object>
object
from
required
string
to
required
string
planned_deletes
required

Paths deleted (or archived).

Array<string>
planned_texts
required

Files rewritten whole, e.g. metastore.yaml for DDL.

Array<string>
commits

Transaction-log commits written (tables with history on).

Array<object>
object
table
required

Qualified table.

string
version
required

New log version.

integer
operation
required

Log operation, e.g. WRITE.

string
links_added

Links the write added to the text it wrote: the notes the text mentions by name (automatic links). Present when there is one.

Array<object>
LinkAdded

A link the write added in place of a mention.

object
path
required

The note the link was written into.

string
text
required

The mention, as written.

string
target
required

Vault path of the note it links.

string
link
required

The link written in place of the mention.

string
ambiguous_mentions

Mentions left as text because the engine is not sure which note they name. Present when there is one: read the candidates and the context, then link the right one with update_row and autolink: false, or leave the text.

Array<object>
LinkAmbiguous

A mention left as text: more than one note could be meant.

object
path
required

The note the mention is in.

string
text
required

The mention, as written.

string
reason
required

Same_name: several notes have this name; adjacent: names of different notes side by side, which may be one name; overlap: names of notes overlap; part_of_name: a capitalized word next to it suggests a longer name; sentence_start: a one-word name at the start of a sentence, a line, a list item or a label, where its capital says nothing.

string
Allowed values: same_name adjacent overlap part_of_name sentence_start
candidates
required

Vault paths of the notes it may name.

Array<string>
context
required

The line around the mention.

string
hint
required

What to do: read the candidates, then link the right one with update_row and autolink: false, or leave the text.

string

Example

{
"violations": [
{
"violations": [
{
"code": "required"
}
]
}
],
"ambiguous_mentions": [
{
"reason": "same_name"
}
]
}

Unexpected error ({error}), or a write that failed partway and could not be rolled back: rolled_back: false, failed lists the files left (undo_migration on migration_id retries the rollback).

Media typeapplication/json
Any of:
OpResult

Result of a write operation. A refusal (ok false) is answered with HTTP 422, a failed write with 500, so a 2xx body has ok true.

object
ok
required

True when the operation was applied (or, on a dry run, would be).

boolean
op
required

The operation, by the name it was called with (e.g. insert_row, create_table, recompute_columns).

string
dry_run
required

True when nothing was written (preview).

boolean
migration_id

Journal id of the applied operation: pass it to undo_migration. Absent on a dry run.

string
notes_changed
required

Notes whose front matter or body were written.

integer
files_created
required

Files created.

integer
files_moved
required

Files moved or renamed.

integer
files_deleted
required

Files deleted or archived.

integer
references_updated
required

Links rewritten in other notes.

integer
conflicts
required

Reasons the operation was refused (empty on success).

Array<object>
object
path
required

Note or file path.

string
message
required

Why the operation cannot proceed.

string
violations
required

Rows that would break the table’s rules (empty on success).

Array<object>
RowViolations

The violations of one row.

object
path
required

Row note path.

string
violations
required

What is wrong with this row.

Array<object>
Violation
object
column

The column the violation is about (every code but check and unreadable).

string
index

The item of a list column that breaks the rule, from 0.

integer
constraint

The CHECK’s name (code check).

string
code
required

Kind of violation.

string
Allowed values: required inverse type min max step enum broken_link ref unique unknown_column check generated cycle vocabulary unreadable
message
required

Agent-readable explanation.

string
value

The offending value, when there is one.

failed
required

Files that could not be written (empty on success).

Array<object>
object
path
required

Vault path.

string
error
required

What went wrong.

string
rolled_back

Set when a write failed partway (failed): true when the engine put back what it had written, so nothing is left written; false when that rollback failed too (failed names the files left, and undo_migration on migration_id retries it).

boolean
planned_edits
required

Front matter edits per note (planned, or made).

Array<object>
object
path
required

Note path.

string
set
required

Front matter keys set, with their new values.

object
key
additional properties
any
remove
required

Front matter keys removed.

Array<string>
body

True when the note body changes too.

boolean
planned_creates
required

Paths of notes created.

Array<string>
planned_moves
required

Files moved: from → to.

Array<object>
object
from
required
string
to
required
string
planned_deletes
required

Paths deleted (or archived).

Array<string>
planned_texts
required

Files rewritten whole, e.g. metastore.yaml for DDL.

Array<string>
commits

Transaction-log commits written (tables with history on).

Array<object>
object
table
required

Qualified table.

string
version
required

New log version.

integer
operation
required

Log operation, e.g. WRITE.

string
links_added

Links the write added to the text it wrote: the notes the text mentions by name (automatic links). Present when there is one.

Array<object>
LinkAdded

A link the write added in place of a mention.

object
path
required

The note the link was written into.

string
text
required

The mention, as written.

string
target
required

Vault path of the note it links.

string
link
required

The link written in place of the mention.

string
ambiguous_mentions

Mentions left as text because the engine is not sure which note they name. Present when there is one: read the candidates and the context, then link the right one with update_row and autolink: false, or leave the text.

Array<object>
LinkAmbiguous

A mention left as text: more than one note could be meant.

object
path
required

The note the mention is in.

string
text
required

The mention, as written.

string
reason
required

Same_name: several notes have this name; adjacent: names of different notes side by side, which may be one name; overlap: names of notes overlap; part_of_name: a capitalized word next to it suggests a longer name; sentence_start: a one-word name at the start of a sentence, a line, a list item or a label, where its capital says nothing.

string
Allowed values: same_name adjacent overlap part_of_name sentence_start
candidates
required

Vault paths of the notes it may name.

Array<string>
context
required

The line around the mention.

string
hint
required

What to do: read the candidates, then link the right one with update_row and autolink: false, or leave the text.

string

Example

{
"violations": [
{
"violations": [
{
"code": "required"
}
]
}
],
"ambiguous_mentions": [
{
"reason": "same_name"
}
]
}

A write that failed partway (a file another program holds) and was rolled back: rolled_back: true, nothing written. Send it again later. Same body as 200, with ok: false and failed.

Media typeapplication/json
OpResult

Result of a write operation. A refusal (ok false) is answered with HTTP 422, a failed write with 500, so a 2xx body has ok true.

object
ok
required

True when the operation was applied (or, on a dry run, would be).

boolean
op
required

The operation, by the name it was called with (e.g. insert_row, create_table, recompute_columns).

string
dry_run
required

True when nothing was written (preview).

boolean
migration_id

Journal id of the applied operation: pass it to undo_migration. Absent on a dry run.

string
notes_changed
required

Notes whose front matter or body were written.

integer
files_created
required

Files created.

integer
files_moved
required

Files moved or renamed.

integer
files_deleted
required

Files deleted or archived.

integer
references_updated
required

Links rewritten in other notes.

integer
conflicts
required

Reasons the operation was refused (empty on success).

Array<object>
object
path
required

Note or file path.

string
message
required

Why the operation cannot proceed.

string
violations
required

Rows that would break the table’s rules (empty on success).

Array<object>
RowViolations

The violations of one row.

object
path
required

Row note path.

string
violations
required

What is wrong with this row.

Array<object>
Violation
object
column

The column the violation is about (every code but check and unreadable).

string
index

The item of a list column that breaks the rule, from 0.

integer
constraint

The CHECK’s name (code check).

string
code
required

Kind of violation.

string
Allowed values: required inverse type min max step enum broken_link ref unique unknown_column check generated cycle vocabulary unreadable
message
required

Agent-readable explanation.

string
value

The offending value, when there is one.

failed
required

Files that could not be written (empty on success).

Array<object>
object
path
required

Vault path.

string
error
required

What went wrong.

string
rolled_back

Set when a write failed partway (failed): true when the engine put back what it had written, so nothing is left written; false when that rollback failed too (failed names the files left, and undo_migration on migration_id retries it).

boolean
planned_edits
required

Front matter edits per note (planned, or made).

Array<object>
object
path
required

Note path.

string
set
required

Front matter keys set, with their new values.

object
key
additional properties
any
remove
required

Front matter keys removed.

Array<string>
body

True when the note body changes too.

boolean
planned_creates
required

Paths of notes created.

Array<string>
planned_moves
required

Files moved: from → to.

Array<object>
object
from
required
string
to
required
string
planned_deletes
required

Paths deleted (or archived).

Array<string>
planned_texts
required

Files rewritten whole, e.g. metastore.yaml for DDL.

Array<string>
commits

Transaction-log commits written (tables with history on).

Array<object>
object
table
required

Qualified table.

string
version
required

New log version.

integer
operation
required

Log operation, e.g. WRITE.

string
links_added

Links the write added to the text it wrote: the notes the text mentions by name (automatic links). Present when there is one.

Array<object>
LinkAdded

A link the write added in place of a mention.

object
path
required

The note the link was written into.

string
text
required

The mention, as written.

string
target
required

Vault path of the note it links.

string
link
required

The link written in place of the mention.

string
ambiguous_mentions

Mentions left as text because the engine is not sure which note they name. Present when there is one: read the candidates and the context, then link the right one with update_row and autolink: false, or leave the text.

Array<object>
LinkAmbiguous

A mention left as text: more than one note could be meant.

object
path
required

The note the mention is in.

string
text
required

The mention, as written.

string
reason
required

Same_name: several notes have this name; adjacent: names of different notes side by side, which may be one name; overlap: names of notes overlap; part_of_name: a capitalized word next to it suggests a longer name; sentence_start: a one-word name at the start of a sentence, a line, a list item or a label, where its capital says nothing.

string
Allowed values: same_name adjacent overlap part_of_name sentence_start
candidates
required

Vault paths of the notes it may name.

Array<string>
context
required

The line around the mention.

string
hint
required

What to do: read the candidates, then link the right one with update_row and autolink: false, or leave the text.

string

Example

{
"violations": [
{
"violations": [
{
"code": "required"
}
]
}
],
"ambiguous_mentions": [
{
"reason": "same_name"
}
]
}