Give a named token a new value (owner only): the old one stops working.
POST
/datanotes/tokens/rotate/
const url = 'https://example.com/datanotes/tokens/rotate/';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"}'};
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/rotate/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \ --data '{ "name": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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"}Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
string
Example generated
{ "name": "example"}Responses
Section titled “Responses”Done.
Media typeapplication/json
object
token
The token itself: shown once, stored hashed.
string
Example generated
{ "token": "example"}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"}Unexpected error.
Media typeapplication/json
object
error
required
What went wrong, for a person or an agent.
string
Example generated
{ "error": "example"}