Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Platform API

Everything the ButterIX console and the biti CLI can do goes through this REST API: managing organizations and members, creating sites, uploading and switching deployments, configuring domains and Git, setting up Ask AI, reading analytics, and driving the visual editor.

Base URLs

The platform API's base URL is https://api.butterix.com/v1.

Endpoints in the "Docs site runtime" group (Ask AI, MCP, explorer proxy, feedback) go to the docs site's own domain, for example https://acme-payments-sites.butterix.com/_mcp/server.

Authentication

Create a key in the console under Organization settings → API Keys and pass it in the Authorization header:

curl https://api.butterix.com/v1/whoami \
  -H "Authorization: Bearer $BITI_TOKEN"

API keys belong to an organization and act as editor: they can deploy, edit content, and read data, but can't do anything that requires admin (members, domains, key management, and so on).

After POST /auth/login succeeds, the platform sets an HttpOnly biti_session cookie (30 days), valid only on the host you signed in to. Requests that change data with cookie authentication must be same-origin: the platform checks the Origin header and answers cross-origin requests with 403.

Roles

RoleWhat it can do
ownerEverything; an organization needs at least one owner
adminManage members, site settings, domains, Git, access control, Ask AI, and API keys; delete sites
editorDeploy, switch the production deployment, edit and publish content, test Ask AI
viewerRead only

Conventions

  • Requests and responses are JSON; deployment uploads use application/gzip, and editor uploads use multipart/form-data.
  • Timestamps are Unix milliseconds.
  • The :site and :org parameters can be a slug or an id.
  • Errors return a matching HTTP status code and { "error": "…" }.
Error response
{ "error": "That subdomain is taken." }

Common workflows

Deploy from CI

Upload source

POST /sites/{site}/deployments with the project's tar.gz as the request body. Returns { id }.

Poll the status

GET /deployments/{id} until status is ready or failed. biti deploy polls once per second.

(Optional) Roll back

POST /deployments/{id}/promote makes any successful deployment the production one, immediately.

POST/sites/:site/deployments
tar --exclude=node_modules --exclude=.git --exclude=dist -czf site.tgz .
curl -X POST https://api.butterix.com/v1/sites/acme-payments/deployments \
  -H "Authorization: Bearer $BITI_TOKEN" \
  -H "Content-Type: application/gzip" \
  -H "x-biti-preview: 1" \
  --data-binary @site.tgz

Edit a page with the editor API

Create a draft

POST /sites/{site}/editor/branches → { name }

Read the file

GET /sites/{site}/editor/file?branch=…&path=… → { content, sha }

Save

PUT /sites/{site}/editor/file with baseSha, so you don't overwrite someone else's changes

Publish

POST /sites/{site}/editor/publish merges into the production branch and deploys

See the groups below or the navigation on the left for the full list of endpoints.

Auth and accounts

Sign up, log in, the current user, and API key identity.

POSTSign up/auth/signup
POSTLog in/auth/login
POSTLog out/auth/logout
GETGet current user/me
PATCHUpdate current user/me
GETGet the API key's organization/whoami

Organizations

An organization holds members, sites, and API keys. Every user gets a personal organization on sign-up.

POSTCreate organization/orgs
GETGet organization/orgs/{org}
PATCHRename organization/orgs/{org}
GETAudit log/orgs/{org}/audit
POSTOrganization MCP server/mcp

Members and invites

Manage organization members and roles. Inviting someone who hasn't signed up creates a one-time invite link.

GETList members and invites/orgs/{org}/members
POSTAdd or invite a member/orgs/{org}/members
PATCHChange a member's role/orgs/{org}/members/{userId}
DELRemove member/orgs/{org}/members/{userId}
DELRevoke invite/orgs/{org}/invites/{inviteId}
POSTAccept invite/invites/{token}/accept

API Keys

Organization-level keys for the CLI and CI (Authorization Bearer biti_…).

GETList API keys/orgs/{org}/api-keys
POSTCreate API key/orgs/{org}/api-keys
DELDelete API key/orgs/{org}/api-keys/{keyId}

Sites

A site is one documentation site, with its own subdomain, deployment history, domains, and settings.

GETList sites/orgs/{org}/sites
POSTCreate site/orgs/{org}/sites
GETGet site/sites/{site}
PATCHRename site/sites/{site}
DELDelete site/sites/{site}
PUTSet access control/sites/{site}/access
GETList access tokens/sites/{site}/access-tokens
POSTCreate access token/sites/{site}/access-tokens
DELRevoke access token/sites/{site}/access-tokens/{id}
GETSuggested redirects for 404s/sites/{site}/redirects
POSTAdd a redirect/sites/{site}/redirects
DELRemove a redirect/sites/{site}/redirects
GETList what can be exported/sites/{site}/export
GETExport Markdown/sites/{site}/export/markdown

Deployments

Every build produces an immutable deployment. Production can be switched (rolled back) to any successful deployment at any time.

GETList deployments/sites/{site}/deployments
POSTCreate deployment/sites/{site}/deployments
GETGet deployment/deployments/{id}
POSTPromote to production (roll back)/deployments/{id}/promote
POSTCancel deployment/deployments/{id}/cancel

Custom domains

Verify ownership with a TXT record, then point traffic to the platform with a CNAME.

GETList domains/sites/{site}/domains
POSTAdd domain/sites/{site}/domains
POSTVerify domain/sites/{site}/domains/{domain}/verify
POSTSet primary domain/sites/{site}/domains/{domain}/primary
DELRemove domain/sites/{site}/domains/{domain}

Git integration

Connect a Git repository such as GitHub: pushes deploy automatically and pull requests get previews.

PUTConnect Git repository/sites/{site}/git
DELDisconnect Git repository/sites/{site}/git
POSTReceive GitHub webhook/webhooks/github/{siteId}

Ask AI

The provider, model, key, and instructions for the site's AI answers, plus custom answers, content sources, and embedding.

GETGet Ask AI settings/sites/{site}/ai
PUTUpdate Ask AI settings/sites/{site}/ai
POSTAsk a test question/sites/{site}/ai/test
GETList available models/ai/models
GETList custom answers/sites/{site}/guidance
POSTCreate custom answer/sites/{site}/guidance
GETGet custom answer/sites/{site}/guidance/{id}
PATCHUpdate custom answer/sites/{site}/guidance/{id}
DELDelete custom answer/sites/{site}/guidance/{id}
GETList content sources/sites/{site}/sources
POSTAdd content source/sites/{site}/sources
GETGet content source/sites/{site}/sources/{id}
PATCHUpdate content source/sites/{site}/sources/{id}
DELDelete content source/sites/{site}/sources/{id}
POSTFetch website again/sites/{site}/sources/{id}/refresh
GETGet embed settings/sites/{site}/embed
PUTUpdate embed settings/sites/{site}/embed
GETDocs eval results/sites/{site}/evals
POSTUpload a docs eval result/sites/{site}/evals
GETGet a docs eval result/sites/{site}/evals/{id}
DELDelete a docs eval result/sites/{site}/evals/{id}

Analytics

Traffic broken down by humans, AI, and crawlers, plus Ask AI questions and page feedback.

GETTraffic/sites/{site}/analytics
GETAsk AI questions/sites/{site}/questions
GETExport Ask AI questions/sites/{site}/questions.csv
GETPage review/sites/{site}/page-reviews
GETResolution rate/sites/{site}/questions/summary
GETPage feedback/sites/{site}/feedback

Scheduled tasks

Have AI check the docs and reader feedback on a schedule and write a report, with changes in a draft branch when you allow them.

GETList scheduled tasks/sites/{site}/automations
POSTCreate scheduled task/sites/{site}/automations
GETGet scheduled task/sites/{site}/automations/{id}
PATCHUpdate scheduled task/sites/{site}/automations/{id}
DELDelete scheduled task/sites/{site}/automations/{id}
POSTRun now/sites/{site}/automations/{id}/run
GETRun history/sites/{site}/automations/{id}/runs

Visual editor

Online editing on draft branches: read and write files, live rendering, checks, previews, and publishing.

GETList draft branches/sites/{site}/editor/branches
POSTCreate draft/sites/{site}/editor/branches
DELDiscard draft/sites/{site}/editor/branches/{name}
GETFile tree and navigation/sites/{site}/editor/tree
GETRead file/sites/{site}/editor/file
PUTSave file/sites/{site}/editor/file
DELDelete file/sites/{site}/editor/file
POSTMove or rename file/sites/{site}/editor/move
POSTUpload an image, media file or font/sites/{site}/editor/upload
POSTLive render/sites/{site}/editor/render
POSTCheck content/sites/{site}/editor/check
POSTPreview draft/sites/{site}/editor/preview
POSTPublish draft/sites/{site}/editor/publish
POSTTranslate the site with AI/sites/{site}/editor/translate
GETComponent list/components

Background jobs

Long-running work (such as AI translation) runs as background jobs; poll progress by job id.

GETGet job/jobs/{id}

Docs site runtime

Dynamic endpoints every hosted docs site comes with. Requests go to the docs site's own domain and need no authentication.

POSTAsk AI chat (SSE)/_biti/ai/chat
GETAsk AI session token/_biti/ai/token
POSTMCP server/_mcp/server
POSTAPI explorer proxy/_biti/proxy
POSTSubmit page feedback/_biti/feedback