Skip to main content
An agent run started from the API, the CLI or the Claude Connector follows the same Approval mode as a chat in the app. Three things limit it: the token’s scopes, the owner’s workspace role, and the approval mode that applies to the run.

Start a run and get its answer

A chat run asks CloudThinker a question with the token owner’s rights and spends credits. The token needs chat:runs:write. The POST returns 201 at once, usually with status: pending; poll the run until it reaches a final status.
This script stops on the first HTTP error. In production, wrap each call in the retry loop. A workspace runs at most 20 agent runs at once, pending or running; the next POST gets 429 rate_limited. A prompt that contains credentials is refused with 422. To continue the conversation, send its conversation_id in the next POST. See Ask CloudThinker for every field.

What limits an API run

Which approval mode applies

These runs are chat runs, so they use the Chat run type. The mode comes from the first of these that is set:
  1. The mode picked for that conversation
  2. The Chat run type override, in When no Rule matches on Settings → Workspace → Autonomy → Rules
  3. The workspace mode
New workspaces start on Auto · Rules + AI · Ask me. Under Auto, each write goes through your Rules, then AI judgment, and if neither allows it, it waits for a person (Ask me) or is refused (Refuse). See Approval mode for every choice.
Under Auto, a write that a Rule or AI judgment allows runs with no person in the loop, recorded as the token’s owner. Pick Auto · Rules · Refuse for unattended pipelines, on the conversation or the Chat run type, and accept Allow Rules only for the writes the job needs.

When a run pauses

A run waiting for a person has status required_approval. Its url opens the conversation in the browser, where an approver decides. cloudthinker chat exits with code 5. A token with approvals:requests:read can list the pending requests you can answer. To answer one from a script, call POST /v1/workspaces/{workspace_id}/approvals/requests/{request_id}/decision with a personal token that has approvals:requests:write, or with your own sign-in. The body is {"decision": "approve"}, or {"decision": "deny", "reason": "..."}, because a deny needs a reason. You answer as yourself, with your own rights.
  • Service account and MCP tokens are refused, so an unattended pipeline can’t approve its own writes.
  • You can’t answer a request you started.
  • Only pending requests can be answered. After a Chat request is answered, the conversation resumes, so its status can still read pending for a moment.
The polling example above keeps waiting through a pause and prints the approval link once. A script that can’t wait, such as a CI job, can stop at required_approval and report the url instead; the run still continues after a person decides.

Approval mode

Set the mode for the workspace, a run type or one chat.

Rules

Allow, ask first or deny an exact write.