Exchange API — bRRAIn Docs

Programmatic API for the Exchange — browse listings, purchase, ingest content packs into your Vault.

Exchange API

The Exchange API lets you browse the content marketplace, purchase items, and ingest them into your Vault programmatically. It's distinct from the Marketplace API (which is for installable extensions).

Base path

https://exchange.brrain.io/api
https://<your-org-slug>.brrain.io/api/console/exchange   (per-org purchase management)

Public browsing

Unauthenticated.

List items

GET /items?category=&type=&sort=popular&limit=50&cursor=

Item types include:

  • skill — a reusable agent skill / prompt template.
  • plan — a multi-step orchestration plan.
  • standard — an industry standard or playbook.
  • project — a complete project template (ontology + data + orchestrations).
  • dataset — a curated dataset.
  • lora — a LoRA adapter for the Handler.
  • template — a starter document template.

Get an item

GET /items/{id}

Full detail including license terms, content preview, and seller info.

GET /search?q=...&type=...

Full-text search across items.

Purchase and license

Authenticated. Requires Architect or higher.

Purchase

POST /api/console/exchange/purchases
Content-Type: application/json

{
  "item_id": "ex_8a2b3c...",
  "license": "commercial",
  "quantity": 1
}

Returns the purchase record and a download URL valid for 7 days.

List purchases

GET /api/console/exchange/purchases

Active purchases on the organization.

Re-download

GET /api/console/exchange/purchases/{id}/download

Returns a fresh signed URL for the purchased asset.

Ingestion

Most Exchange items can ingest directly into your Vault.

Trigger ingestion

POST /api/console/exchange/purchases/{id}/ingest
Content-Type: application/json

{
  "target_zone": "knowledge-bases/legal",
  "merge_strategy": "additive",
  "dry_run": false
}

Merge strategies:

  • additive — add new records, leave existing alone.
  • upsert — overwrite records on ID match.
  • replace — wipe target zone first, then ingest.

dry_run: true returns what would be ingested without writing.

Get ingestion status

GET /api/console/exchange/purchases/{id}/ingest/status

States: queued, running, completed, failed, partial.

Submitter API (sellers)

Authenticated as a verified Exchange submitter.

Create a listing

POST /api/submit/items

Submits for review; review SLA is 5 business days.

Update a listing

PUT /api/submit/items/{id}

Major changes (price, license, content) trigger re-review.

Earnings

GET /api/submit/earnings?from=&to=

Earnings statement for the period. Payouts follow Marketplace billing cadence.

Webhooks

  • exchange.purchase_completed
  • exchange.ingestion_completed
  • exchange.listing_approved
  • exchange.listing_rejected

Errors

  • item_not_found
  • license_required — the operation needs a license tier you don't have.
  • payment_failed
  • ingestion_conflict — additive ingest collided with existing IDs (use merge_strategy: upsert).

Where to next