API Reference

The Backbuild API gives your applications, scripts, and AI agents programmatic access to everything the platform does. This page is the starting point: it teaches the contract every endpoint shares, walks you through your first successful call, and points you to the guide for each capability.

After reading this page you will be able to: reach the API, authenticate, make a first call in a few minutes, read the uniform response envelope, handle any error by its machine-readable code, back off correctly on a rate limit, and page through a list. Everything below applies to every endpoint unless a specific guide says otherwise.

Base URL

https://api.backbuild.ai/v1

Every path in these guides is relative to that base. All request and response bodies are JSON. Send Content-Type: application/json on any request that carries a body.

Authentication

Almost every request carries a Bearer token in the Authorization header. There is no cookie-based or ambient authentication for the API: if the header is absent the request is unauthenticated, full stop.

Authorization: Bearer YOUR_TOKEN

There are two kinds of token, and you choose by how the caller runs:

CredentialUse it forHow you get it
Access token (eyJ...) A signed-in user or a session-bound app. Short-lived; rotate with a refresh token. Authentication (register, login, refresh)
API key (bb_live_...) A server, a CI job, or an AI agent that runs unattended. Long-lived, scoped, revocable. API Keys

Both go in the same Authorization: Bearer header. The organization every request acts on is resolved from the credential itself: it is never passed in the body or the query string, and a credential can never reach an organization it is not bound to.

Endpoints That Need No Auth

Only two endpoints are public. Everything else requires a token. Use these to verify connectivity before you have a credential in hand:

EndpointReturns
GET /v1/healthService liveness
GET /v1/pricingPublic pricing information

Your First Call

Start with the no-auth health check to confirm you can reach the API, then make an authenticated call. This is the fastest path from zero to a working request.

# 1. Reach the API (no auth needed)
curl https://api.backbuild.ai/v1/health

# 2. Make an authenticated call with an API key
curl https://api.backbuild.ai/v1/projects \
  -H "Authorization: Bearer bb_live_abc123_yourSecret"

A successful call returns the standard envelope described next. If you get a 401, the token is missing, malformed, or expired; if you get a 403, the token is valid but lacks the scope or role for that action. See API Keys to create a scoped key, or Authentication for the user token flow.

The Settings API Keys screen immediately after creating a key. The API Key Created dialog is open, warning that the key is shown only once. Callout 1 circles the full bb_live_ key value in its copy field, with a red label reading shown once, copy it now, next to a Copy to Clipboard button and a Done button.
The full key value is returned only once, at creation. Copy it into your secret manager before you close the dialog.

Response Envelope

Every endpoint returns the same envelope, so you write one parser, not one per call. On success, success is true and the payload is under data. A single-record action returns the same shape as a list action; only the contents of data differ.

{
  "success": true,
  "data": { /* the requested resource, or an array of them */ }
}

On failure, success is false and the details live under error as a stable machine-readable code and a human-readable message. Branch your handling on error.code, never on the message text (messages may change; the code is the contract).

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input"
  }
}

Error Codes

All errors use the envelope above. The HTTP status tells you the class of problem; the code tells you exactly what to do.

CodeHTTPMeaningWhat to do
VALIDATION_ERROR400The request body or parameters are malformed or fail a ruleFix the input; the message names the offending field
AUTH_REQUIRED401The token is missing, malformed, or expiredAttach a valid token, or refresh it
FORBIDDEN403The token is valid but lacks the scope, role, or permissionGrant the scope or role; do not retry unchanged
NOT_FOUND404No such resource, or it is outside your organizationCheck the id; a cross-org id reads as not found
FEATURE_DISABLED403The feature is not enabled for this planUpgrade the plan or enable the feature
RATE_LIMIT_EXCEEDED429Too many requests in the current windowBack off and retry; honor Retry-After
INTERNAL_ERROR500An unexpected server errorRetry with backoff; if it persists, contact support

Some endpoints return a more specific code inside the same shape (for example, the authentication endpoints return codes such as AUTH_INVALID_CREDENTIALS). Treat any code you do not recognize by its HTTP status class: 4xx means fix the request, 5xx means retry with backoff.

Rate Limiting

Requests are rate limited per credential and per endpoint; authentication endpoints are stricter. Every response carries your current budget so you can throttle proactively rather than wait to be rejected.

HeaderMeaning
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterOn a 429, seconds to wait before retrying

When you receive a 429, wait the number of seconds in Retry-After before retrying. Build clients to back off exponentially with jitter rather than to loop immediately, and slow down as X-RateLimit-Remaining approaches zero. Published request ceilings for your plan are on the pricing page.

Pagination

List endpoints page with limit and offset query parameters and return a pagination block alongside the data. Request the first page by omitting offset (or sending offset=0); fetch the next page by increasing offset by your limit, not by the number of rows the last page happened to return.

# First page
GET /v1/projects?limit=20

# Next page (offset advances by the limit, not by rows returned)
GET /v1/projects?limit=20&offset=20
{
  "success": true,
  "data": [ /* ...up to `limit` items... */ ],
  "pagination": {
    "total": 42,
    "limit": 20,
    "offset": 0,
    "has_more": true
  }
}

Stop when has_more is false. The default and maximum limit are stated on each list endpoint (commonly a maximum of 100).

Cross-Origin Requests (CORS)

Browser calls are governed by a CORS allowlist: only approved web origins receive an Access-Control-Allow-Origin grant, so a script on another site cannot read your API responses. If a browser integration is blocked by CORS, it is calling from an origin that is not on the allowlist; move the call server-side. Server-to-server clients such as curl or a backend do not send an Origin header and are never subject to CORS. Authentication is always Bearer-token based, never cookies, so the safe pattern for a browser app is to keep the credential on your own server and proxy the call.

Endpoint Categories

Select a category for detailed, teaching-grade documentation:

Authentication Register, login, OAuth, passkeys, password reset, refresh, device authorization for CLI and agents. API Keys Create, scope, rotate, and revoke long-lived keys for servers and agents. Mandatory expiry, shown once. MCP Server The JSON-RPC Model Context Protocol surface: discover and call hundreds of tools with scoped keys. Webhooks Manage delivery endpoints, verify signatures, inspect the delivery log, and rotate signing secrets. RBAC Custom roles, permissions, policies, departments, groups, and effective-permission evaluation. Integrations Stripe Connect, email and SMS provider configuration, and outbound email send scopes. Organizations Create, update, list organizations. Invitations and member management. Projects Create, update, list, delete projects within organizations. Entities CRUD for entities, entity types, and relationships. Files The Files app API: upload, download, list, delete documents. Search Semantic search across all content by meaning. AI & Assistant WebSocket assistant, conversations, skills, model configuration. Tasks Task management with states, assignment, and priorities. Workflows & Automation Workflow definitions, automation rules, time triggers, campaigns. Billing & Subscriptions Subscriptions, invoices, payment methods, Stripe integration. SaaS Builder Packages, pricing plans, domains, marketing pages, revenue analytics. Tenant Management Provision tenants, manage subscriptions, configure feature flags. Security & Compliance Audit events, security alerts, metrics, SBOM, visibility policies. SSO & SCIM OIDC, SAML 2.0 single sign-on, and SCIM 2.0 user provisioning. Tools & Sandbox Custom tool builder and isolated sandbox code execution. Themes Visual themes with colors, typography, layout, spacing, branding. Notifications & Settings Notification management, user/org settings, alert rules. Collaboration Real-time collaborative document editing, version history, offline sync.

Full Endpoint Reference

For the machine-generated, per-operation reference (request and response schemas for every endpoint), see the Endpoint Reference (OpenAPI). It is generated from the published OpenAPI specification and stays in lock-step with the live API.

Frequently Asked Questions

Which header carries the token, and is it a cookie?
Always Authorization: Bearer <token>. There is no cookie or ambient auth. Use an access token for a signed-in user or an API key for a server or agent.

Does every endpoint return a different shape?
No. Every endpoint returns the same envelope: success plus data on success, or success: false plus error.code and error.message on failure. Single records and lists share the shape.

How do I get the next page?
Increase offset by your limit, not by the number of rows the last page returned, and stop when pagination.has_more is false.

Why am I getting a CORS error from the browser?
You are calling from an origin that is not on the allowlist. Move the call to your server; server-to-server requests are never subject to CORS.

Which endpoints work without a token?
Only GET /v1/health and GET /v1/pricing. Everything else requires a Bearer token.

How should I handle a 429?
Wait the seconds in the Retry-After header, then retry with exponential backoff and jitter. Watch X-RateLimit-Remaining to throttle before you are rejected.