Change a named token. A token may change its own description and autolink default; permissions are the owner's.
const url = 'https://example.com/datanotes/tokens/update/';const options = { method: 'POST', headers: { 'X-Datanotes-Actor': '{"harness":"my-script","model":"","session":"s-1"}', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"name":"example","description":"example","write":["example"],"ddl":true,"maintain":true,"autolink":true}'};
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/tokens/update/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \ --data '{ "name": "example", "description": "example", "write": [ "example" ], "ddl": true, "maintain": true, "autolink": true }'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 Body
Section titled “Request Body”object
Owner only (a named token updates itself).
An empty string removes it.
The default of the token’s writes for automatic links; null follows the database’s setting again.
Example generated
{ "name": "example", "description": "example", "write": [ "example" ], "ddl": true, "maintain": true, "autolink": true}Responses
Section titled “Responses”Done.
object
A named token as the registry shows it (never its value).
object
The default of its writes for automatic links (absent: the database’s setting).
The last request made with it (saved within a minute).
Example generated
{ "entry": { "name": "example", "description": "example", "write": [ "example" ], "ddl": true, "maintain": true, "autolink": true, "created_at": "example", "updated_at": "example", "last_seen": "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"}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"}