Fill a field with AI in the background
Plans and starts a background job that writes one field over a database's records, as the caller, a batch of records per model call. The job runs on the workers and survives closed tabs; follow it through the job endpoints or the live job summary. Requires a Clerk session for a workspace member with the `ai:write` permission. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
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
databaseId*stringfield*stringinstruction*string1 <= length <= 4000onlyEmpty*booleanviewId?string|nullceilingMicrousd?number|nullSuccess
application/json- response
data*curl -X POST 'https://api.snoze.dev/v1/workspaces/string/agent/jobs/fill' \ -H 'Content-Type: application/json' \ -d '{ "databaseId": "string", "field": "string", "instruction": "string", "onlyEmpty": true}'{ "data": { "id": "string", "workspaceId": "string", "chatId": "string", "kind": "records", "status": "queued", "statusReason": "person", "title": "string", "estimateMicrousd": 0, "ceilingMicrousd": 0, "spentMicrousd": 0, "waivedMicrousd": 0, "totalUnits": 0, "doneUnits": 0, "failedUnits": 0, "rowsWritten": 0, "summary": { "unitsDone": 0, "unitsFailed": 0, "unitsCancelled": 0, "rowsWritten": 0, "rowsSkipped": 0, "spentMicrousd": 0, "waivedMicrousd": 0, "durationMs": 0 }, "lastError": "string", "createdAt": "string", "updatedAt": "string", "startedAt": "string", "finishedAt": "string" }}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.
List your background AI jobs
The caller's own jobs in the workspace, newest first, with status, counters and spend. Another member's jobs are never listed. Pass `limit` (1–100) to cap the page. Requires a Clerk session for a workspace member with the `ai:read` permission.