Skip to main content
Coding agents such as Claude Code work best when they can write a short script against a typed API. This page gives your agent what it needs: a key, the client, and recipes it can adapt.
Prefer commands to scripts? The totebot CLI does all of this with one command each, signs in through your browser, and ships a Claude Code skill. See Use the CLI with coding agents.
Want the agent to find what your knowledge is missing and fix it? See Analyse your agent with Claude Code.
The live OpenAPI spec is public at https://api.totebot.ai/v1/openapi.json. Point your agent at it whenever it needs a field or an endpoint that is not in these recipes.

Set up

1

Create a team key

In Team settings → API keys, create a key. It can only read until you turn on write access, so switch on just the write scopes the agent needs (for example agents:write and knowledge:write). Keep All agents, or pick the agents it may change. You can widen or narrow the key later with Edit access.
2

Put the key in your environment

Never paste the key into a prompt or commit it.
3

Download the client

It is one TypeScript file with no dependencies. Run scripts with npx tsx script.ts, bun script.ts or deno run -A script.ts.
4

Tell your agent where to look

Add this to your project’s CLAUDE.md:
You can then ask things like “Update the shipping FAQ on every agent to say delivery takes 2-3 working days” and the agent writes and runs a script like the ones below.

Recipes

List agents and their instructions

Update one FAQ on every agent

The Q&A is matched by its exact question: agents that have it get the new answer, agents that don’t get it added.

Change a section of the instructions on every agent

Instructions apply from the next message; no training needed.
To set the same full instructions on several agents at once, use totebot.bulk.updateAgents({ agentIds, systemPrompt }).

Keep a text document in sync from a file

The text source is matched by its exact title, so running this again after editing the file replaces the old version.
Text sources hold up to 10,000 characters; split longer documents into several titled sources.

Add only to some agents

Every bulk call takes agentIds. Agent IDs are in totebot.agents.list().

Find and retry failed sources

Remove an outdated answer everywhere

Wait for training to finish

Create an agent from a website and set it up

Clone an agent for a new market

Add lead capture and a handover to every agent

The key needs plugins:write.

Work the help desk

The key needs helpdesk:read and helpdesk:write.

Check plan usage and invite a colleague

The key needs members:write, which lets it add people with dashboard access. The API only invites members; ownership is granted in the dashboard.

Answer the questions your agents could not

Test new instructions, apply them, and roll back if needed

Test runs need quality:write (and quality:read to read results), the preview chat chat:write plus agents:write or quality:write, and the update and restore agents:write. The full loop, with the analysis steps, is in Optimize your agents with Claude Code.

Without the client

Everything above is plain HTTPS. For example, with curl:

Good to know

  • Training. New and edited knowledge reaches the agent after training. Training a large knowledge base takes a few minutes, and an agent trained very recently may ask you to wait (429 with secondsRemaining). Batch your changes and train once.
  • Edits create a new source. Editing a text or Q&A gives it a new id, so look sources up again after changing them, or match by question or title with the bulk endpoints.
  • Retries are safe. The client sends an Idempotency-Key with every write and retries network errors and server errors with the same key.
  • Scopes. Keys start read-only. If a call fails with 403, error.details.missingScopes says which scope to turn on in Edit access.
  • Rate limits. Over the limit you get 429 with Retry-After; the client waits and retries.
  • Not available. Billing, deleting the team, API keys, granting ownership and OAuth connections stay in the dashboard. See What the API does not do.
  • Integration content. Synced products and other integration content show managedByIntegration: true and are read-only here.
See the Public API overview for limits and errors, and the API reference for every field.