Business OntologyBusiness Ontology

Put Business Ontology inside your product

Your users get the full workspace — research, business plans, the app builder, campaigns, hiring and the work panel — signed in as themselves, billed to your credits. The assistant can use actions from your product, your data feeds their business context, and you hear back when work finishes.

1. Create an embed

In the workspace, open Embed & API. Create an embed, add the websites allowed to show it, create an API key and buy credits ($10 per 10 runs). Store the API key and signing secret on your server; they are shown once.

2. Sign your user in (your server)

Each embed code is single-use and expires after 10 minutes. Never send your API key to the browser.

curl -X POST https://businessontology.app/api/public/partner/v1/sessions \
  -H "Authorization: Bearer bo_sk_..." -H "content-type: application/json" \
  -d '{"user_id":"u_123","name":"Ada","company":"Ada's Bakery"}'
# → {"embed_code":"boe_...","expires_at":"...","created":true}

Each of your users gets their own private Business Ontology account and business, linked to your user id.

3. Show the widget (your page)

<div id="bo" style="height:720px"></div>
<script src="https://businessontology.app/embed.js"></script>
<script>
  const bo = BO.mount("#bo", {
    getCode: () => fetch("/api/bo-session").then(r => r.json()).then(d => d.embed_code),
    // mode: "launcher", label: "Ask BO", accent: "#0f766e"  → floating button instead
    onReady: () => {}, onError: (e) => console.error(e),
  });
  bo.prefill("Plan a spring promotion for my bakery");
</script>

4. Send business data

Records are stored as typed, versioned records in that user's business, marked with your product as the source, so plans use real numbers.

POST https://businessontology.app/api/public/partner/v1/users/u_123/records
{"records":[{"type":"order","key":"o-981","name":"Order 981","content":{"total":412.5,"items":12}}]}

GET  https://businessontology.app/api/public/partner/v1/users/u_123/records

5. Let the assistant use your product

Register actions. Read-only actions run when the assistant needs them; actions that change things wait for the user to approve each call inside the widget. We call your endpoint with a signed POST and show your reply as the result.

PUT https://businessontology.app/api/public/partner/v1/tools
{"name":"create_invoice","description":"Create a draft invoice for a customer",
 "endpoint":"https://api.yourproduct.com/bo/create_invoice","mode":"approve",
 "input_schema":{"type":"object","properties":{"customer":{"type":"string"},"amount":{"type":"number"}},"required":["customer","amount"]}}

# Your endpoint receives:
{"call_id":"...","tool":"create_invoice","user_id":"u_123","input":{"customer":"...","amount":120}}

GET https://businessontology.app/api/public/partner/v1/tools        DELETE https://businessontology.app/api/public/partner/v1/tools/create_invoice

6. Start work from your code

POST https://businessontology.app/api/public/partner/v1/users/u_123/runs
{"prompt":"Research local competitors and price my cakes","mode":"plan","idempotency_key":"<uuid>"}
# → 202 {"run_id":"...","status":"queued"}   (402 when credits or the user's monthly limit run out)

GET https://businessontology.app/api/public/partner/v1/runs/<run_id>   → {"status":"succeeded","result":"..."}
GET https://businessontology.app/api/public/partner/v1/credits

Retrying with the same idempotency key never charges twice.

7. Events

Webhooks follow the Standard Webhooks format (webhook-id, webhook-timestamp, webhook-signature), signed with your signing secret. Failed deliveries are retried with backoff; replay any time with GET https://businessontology.app/api/public/partner/v1/events?after=ISO_TIME.

Types: run.finished, run.failed, approval.needed, tool_call.finished, credits.low, credits.exhausted.

import { Webhook } from "standardwebhooks";
const wh = new Webhook(process.env.BO_SIGNING_SECRET.replace(/^whsec_/, ""));
const event = wh.verify(rawBody, headers); // throws if forged or stale

Your action endpoints receive the same signature headers — verify them the same way.

Safety

The widget only opens on the websites you list. Your users' work stays private to them; you see results of runs you started, events you receive and usage counts. Ad campaigns are still created paused and nothing spends money without the user's approval.