Undo what the assistant changed
Reverts the changes a selector names, newest first, by applying each one's inverse through the ordinary write it would take by hand, so permissions, validation and the workspace ledger apply as for any edit; the writes are the caller's and are tagged with the returned `revertId`. One conflict refuses the whole revert (`blocked`, nothing changes) unless `skipConflicts` is true, which leaves the conflicting changes as they are. Changes already reverted are left alone, so repeating a revert is a no-op that reports them as reverted. Reverting with the selector `{ revertId }` undoes that revert (redo). Send an `Idempotency-Key` header to make a retried request replay its first result. Requires a Clerk session for a workspace member with the `ai:write` permission, plus the permissions each underlying write needs.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringapplication/json- body
selector*||skipConflicts?boolean|nullSuccess
application/json- response
data*curl -X POST 'https://api.snoze.dev/v1/workspaces/string/agent/edits/revert' \ -H 'Content-Type: application/json' \ -d '{ "selector": { "chatId": "string" }}'{ "data": { "revertId": "string", "status": "reverted", "applied": 0, "calls": [ { "toolCallId": "string", "operation": "string", "chatId": "string", "messageId": "string", "jobId": "string", "at": "string", "changes": [ { "id": "string", "subject": { "kind": "record", "id": "string", "databaseId": "string", "label": "string" }, "action": "created", "state": "revertible", "fields": [ "string" ], "reason": "string", "conflict": { "by": "string", "at": "string", "fields": [ "string" ] }, "at": "string" } ] } ], "counts": { "total": 0, "revertible": 0, "conflict": 0, "reverted": 0, "unsupported": 0, "failed": 0 }, "truncated": true }}List what the assistant changed
The workspace changes one assistant response, tool call, background job or earlier revert made, read from the workspace ledger and grouped per tool call (newest first), each with whether it can be undone now: `revertible`, `conflict` (someone changed the same thing afterwards; the reason says who, when and which fields), `reverted`, or `unsupported` (it happened outside Snoze, or nothing recorded what it replaced). Name exactly one of `chatId` (narrowed by `messageId` and `toolCallId`), `jobId` or `revertId`. A chat must be the caller's own (workspace administrators may read any); job and revert writes are listed when they were made for the caller. Requires a Clerk session for a workspace member with the `ai:read` permission.
Estimate filling a field with AI
Plans a background job that writes one field over a database's records (or those a view shows), without starting it: how many records and parts it covers, what it is expected to cost, and the spend ceiling it would stop at. With `onlyEmpty`, records that already have a value are left out. Requires a Clerk session for a workspace member with the `ai:write` permission who can read the database.