Agents and LLMs: the LLM Guide is the canonical contract: every endpoint, field, validation rule, and worked example. Give your agent that one URL and your API key and it has everything. These pages are the human tour of the same surface. Where a page and the guide differ, the guide wins, except where a page says it documents observed behaviour.
Base URL
Authentication
Every request carries a Bearer token: a per-user API key generated in the app.pb_, are scoped to your projects, and are generated from Settings → API Keys. See Authentication.
Endpoints at a glance
Search nodes by meaning
List nodes (with filters)
Create a node
Update a node
Get the current phase
Navigate the tree
ancestors starts with the node itself and walks to the root. children is the whole subtree beneath the node, each entry carrying a depth. See Tree.
The full surface
Batches on
/mutate are validated as a whole before anything is written. Apply is sequential, and a failure part-way is compensated where that is safe; the Mutations page explains the rolledBack and partial fields.
The _meta block
Every endpoint can add a _meta object next to its data. It is advisory and forward-compatible:
_meta._tip: a next-step or recovery hint (what to do on an empty search, why a view command did not apply, that a secret is shown once)._meta.advisory: structured backpressure, for example{ type: "inbox_overflow", memos, threshold, suggestedFlow }._meta.focus:{ nodeId, viewCommand }after a write, ready to pass toPOST /view-command._meta.guide: on a400,401or403frommutate,search,nodes,tree,iterationsandworkflow, the URL of the LLM guide.
Key principles
Search first
Use
/api/v1/search?q=... to find nodes by meaning. Do not pull all nodes and filter. Search uses vector embeddings and returns ranked results with ancestor paths.One write endpoint
All writes go through
/api/v1/mutate. The action field selects the operation: add, update, delete, restore, batch, classify, the phase actions, and the project actions.For LLM agents
This API is designed as a session contract for LLM agents. Your agent reads the documentation, operates the tree, and the session ends. There is no SDK to update and no version to pin. Changes to the API are reflected in the documentation, and your agent picks them up on the next session. The LLM Guide covers the data model, hierarchy rules, field validation, placement workflow, and worked examples for generating a brain from a codebase or artifact. It is also served asllms.txt and as one plain-text file at llms-full.txt.
Rate limits
The API is rate-limited per IP address, currently 100 requests per 60 seconds. Exceed it and you get an HTTP429. Back off and retry after about a minute. This is a coarse guard against abuse, not a per-key quota.
- The limit is per IP, not per API key. Several clients behind one IP (an office network, a shared CI runner, a serverless platform that reuses egress IPs) share one budget.
- Prefer one batch over many calls.
POST /api/v1/mutatetakes a batch of mutations in a single request.
Versioning and stability
The API is versioned in the URL path.https://productbrain.com/api/v1 is the current version. The commitment:
- We will not break your integration without warning. Breaking changes (removed or renamed fields, endpoints or actions; tightened validation; changed error shapes) only ship in a new version (
/api/v2/...). - The previous version keeps working for at least 6 months after a new version ships.
- Breaking changes are announced in the changelog at least 30 days before the new version goes live.
- Additive changes (new endpoints, new optional fields, new actions) ship on the current version without notice. Write your integration to tolerate unknown fields.
Deprecation: true header plus a Link header pointing at the /api/v1 successor. Those headers are stamped on /api/nodes, /api/mutate, /api/search, /api/tree, /api/iterations, /api/projects, /api/view-command, /api/view-state, /api/share and /api/webhooks. /api/workflow, /api/export-okf, /api/tier-status and /api/members also answer on their unversioned paths but carry no headers today. Use /api/v1 for all of them.
An unknown or mistyped /api/* path returns 404 with Content-Type: application/json and the body { "error": "unknown_endpoint", ... }, whose _meta._tip lists the valid v1 endpoints. That includes any /api/v2/... path while v2 does not exist, so probing for a version that has not shipped gets a clear answer rather than HTML. Key off error. A client should never see HTML from /api/*; if it does, that is a bug, not a signal about the API.
This contract is enforced mechanically: a frozen contract test suite runs in CI against every release candidate, and a breaking change blocks the deploy.
Your data is yours
You can download your entire project at any time: every goal, need, bet, job, task, and phase. No export restrictions and no premium-only data access. The API your agents use to read and write the tree is the same API you use to export everything, as JSON or as an OKF bundle.Pricing
API access is included on the Builder (99/mo) plans. The free Builder tier also includes the API, with a per-project node cap. Read the live cap from/tier-status (limits.node_cap) rather than hard-coding a number. Strategist plans use AI features through the app UI instead. Sign up at app.productbrain.com.
