Partner docs

Let your agents act. Keep a person on the hook.

Embed ClearedBy in your product. Your agent proposes a change instead of making it, the merchant's rules decide whether a person needs to see it, a reviewer approves it inside your app, and your executor carries out exactly what was signed off. Your merchants never sign up for ClearedBy, never log in to it and never see it.

API v1 @clearedby/sdk 0.1.1 @clearedby/react 0.1.0 Updated 24 Sep 2026

Start here

Build it with your AI coding agent

Paste this into Claude Code, Cursor, Codex or similar, in your app's repository, and fill in your stack. The spec it points to covers every step, signature, endpoint, error code and security rule, so the agent can implement the whole integration from it alone.

prompt
Implement ClearedBy in this codebase using https://clearedby.com/docs/partners/llms-full.txt.
Read the whole spec before writing code, and follow every MUST rule in its Security section.
Our stack: [framework, e.g. Next.js App Router], [auth/session, e.g. NextAuth],
[database, e.g. Postgres with Prisma], [job queue, e.g. BullMQ], [secret store].
Build, in this order: partner settings; merchant onboarding in our signup flow; the executor
route; the embedded review UI (partner proxy + @clearedby/react, themed to our design system);
and replace our agent's direct store writes with gate() proposals.
Our partner key is in the CLEAREDBY_PARTNER_KEY environment variable (server only).

Only need the look? The theme prompt turns your design system into a ClearedBy theme.

How it works

  1. Propose. Your agent calls gate() with the action, the exact parameters and its case for doing it. It holds a key that can propose but never approve, and no write access to the store.
  2. Policy. The merchant's approval rules, installed for every org and shown as plain-English sliders, clear small safe changes on their own, refuse what is never allowed and hold the rest.
  3. Human. A reviewer approves, declines, sends it back or escalates, inside your app: drop in @clearedby/react or build on the API. ClearedBy checks that person's authority itself.
  4. Authorise. Every approval carries an Ed25519-signed receipt naming the org, the action and the exact parameters.
  5. Execute. ClearedBy dispatches it to your executor, which checks it with verifyDispatch and makes exactly that change.
  6. Report. The executor reports per-item results. ClearedBy compares them with what was approved and keeps a tamper-evident record of the whole chain.
You buildClearedBy does
The agent, proposing with gate()Validates it against the action catalogue and the merchant's stores, applies the merchant's rules
The review screens (or our components) and a small proxy routeWorks out who can approve, checks every decision against that person's authority
The executor that holds your store write credentialsSigns every approval, delivers it, retries, and answers "has this been revoked?"
Nothing: no audit codeKeeps a signed, tamper-evident record of every proposal, decision, cancellation and result

Packages and examples

PackageWhere it runsWhat it's for
@clearedby/sdkYour servers, your agentClearedBy (org key: propose, follow, complete) and ClearedByPartner (partner key: orgs, reviewers, decisions, rules, erasure)
@clearedby/sdk/dispatchYour executor (Node)verifyDispatch: check every approval before acting on it
@clearedby/sdk/receiptAny service handed a receipt (Node)Verify Authorisation Receipts offline, check revocation online
@clearedby/sdk/partner-proxyYour web serverThe server half of the embedded approval UI
@clearedby/reactYour web appQueue, review panel, decision buttons, approval rules and history; hooks for a custom UI

Runnable examples are in the public ClearedBy/clearedby-js repository: partner-approvals-next (the embedded UI in Next.js) and dispatch-receiver (a complete executor endpoint with an offline demo).

Need a partner key, or something here doesn't match what you see? Talk to your ClearedBy contact.