Push row changes to a URL (a service that would rather be called than poll `list_changes`): batches of up to 100 events POSTed as `{webhook, events, last}`, signed with `X-Datanotes-Signature: sha256=<HMAC of the body>`, retried with backoff until a 2xx. Events are those of `list_changes` (hand edits with their `violations`; the hand edits the service has seen are recorded before it stops). Starts from now unless `since`. Returns the webhook with its `secret` — shown only here: give it to the receiver. Only on the user's explicit request: a webhook sends the database's changes (and, with `since`, its past ones) to that address.
const url = 'https://example.com/datanotes/operations/create_webhook/';const options = { method: 'POST', headers: { 'X-Datanotes-Actor': '{"harness":"my-script","model":"","session":"s-1"}', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"url":"example","tables":null,"kinds":null,"columns":null,"exclude_actor":null,"where":null,"since":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/create_webhook/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \ --data '{ "url": "example", "tables": null, "kinds": null, "columns": null, "exclude_actor": null, "where": null, "since": null }'Push row changes to a URL (a service that would rather be called than poll list_changes): batches of up to 100 events POSTed as {webhook, events, last}, signed with X-Datanotes-Signature: sha256=<HMAC of the body>, retried with backoff until a 2xx. Events are those of list_changes (hand edits with their violations; the hand edits the service has seen are recorded before it stops). Starts from now unless since. Returns the webhook with its secret — shown only here: give it to the receiver. Only on the user’s explicit request: a webhook sends the database’s changes (and, with since, its past ones) to that address.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”JSON: on whose behalf the write is made, recorded in the journal (harness, model, session).
Example
{"harness":"my-script","model":"","session":"s-1"}Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”Done.
The webhook created, with its secret.
object
Webhook id (wh_…).
Receiver URL.
Row filter.
object
Last sequence number delivered (or skipped by the filter).
ISO date-time.
ISO date-time of the last delivery.
Consecutive failed deliveries.
Delivery state.
HMAC secret for X-Datanotes-Signature: shown only here.
Example
{ "kinds": [ "insert" ], "status": "ok"}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"}A named token beyond its permissions (the engine’s administration, tables outside its write patterns, schema changes without ddl).
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Unexpected error.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}