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.
OpenAPI 3.1 (YAML)
Organization keys for the CLI and CI
Upload source or rebuild from the repository
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
| Role | What it can do |
|---|---|
owner | Everything; an organization needs at least one owner |
admin | Manage members, site settings, domains, Git, access control, Ask AI, and API keys; delete sites |
editor | Deploy, switch the production deployment, edit and publish content, test Ask AI |
viewer | Read only |
Conventions
- Requests and responses are JSON; deployment uploads use
application/gzip, and editor uploads usemultipart/form-data. - Timestamps are Unix milliseconds.
- The
:siteand:orgparameters can be a slug or an id. - Errors return a matching HTTP status code and
{ "error": "…" }.
{ "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 }.
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.tgzimport requests
url = "https://api.butterix.com/v1/sites/acme-payments/deployments"
payload = {
"preview": True,
"branch": "docs/new-quickstart"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const response = await fetch("https://api.butterix.com/v1/sites/acme-payments/deployments", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"preview": true,
"branch": "docs/new-quickstart"
})
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.butterix.com/v1/sites/acme-payments/deployments"
payload := strings.NewReader(`{
"preview": true,
"branch": "docs/new-quickstart"
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require "uri"
require "net/http"
require "json"
url = URI("https://api.butterix.com/v1/sites/acme-payments/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"preview": true,
"branch": "docs/new-quickstart"
}.to_json
response = http.request(request)
puts response.read_bodyHttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.butterix.com/v1/sites/acme-payments/deployments"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"preview\":true,\"branch\":\"docs/new-quickstart\"}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.butterix.com/v1/sites/acme-payments/deployments', [
'body' => '{"preview":true,"branch":"docs/new-quickstart"}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.butterix.com/v1/sites/acme-payments/deployments");
request.Headers.Add("Authorization", "Bearer <token>");
request.Content = new StringContent("{\"preview\":true,\"branch\":\"docs/new-quickstart\"}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());import Foundation
var request = URLRequest(url: URL(string: "https://api.butterix.com/v1/sites/acme-payments/deployments")!)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = """
{
"preview": true,
"branch": "docs/new-quickstart"
}
""".data(using: .utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$ biti deploy --site acme-payments --message "Release v1.2"Edit a page with the editor API
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.
| POST | Sign up | /auth/signup |
| POST | Log in | /auth/login |
| POST | Log out | /auth/logout |
| GET | Get current user | /me |
| PATCH | Update current user | /me |
| GET | Get the API key's organization | /whoami |
Organizations
An organization holds members, sites, and API keys. Every user gets a personal organization on sign-up.
| POST | Create organization | /orgs |
| GET | Get organization | /orgs/{org} |
| PATCH | Rename organization | /orgs/{org} |
| GET | Audit log | /orgs/{org}/audit |
| POST | Organization MCP server | /mcp |
Members and invites
Manage organization members and roles. Inviting someone who hasn't signed up creates a one-time invite link.
| GET | List members and invites | /orgs/{org}/members |
| POST | Add or invite a member | /orgs/{org}/members |
| PATCH | Change a member's role | /orgs/{org}/members/{userId} |
| DEL | Remove member | /orgs/{org}/members/{userId} |
| DEL | Revoke invite | /orgs/{org}/invites/{inviteId} |
| POST | Accept invite | /invites/{token}/accept |
API Keys
Organization-level keys for the CLI and CI (Authorization Bearer biti_…).
| GET | List API keys | /orgs/{org}/api-keys |
| POST | Create API key | /orgs/{org}/api-keys |
| DEL | Delete API key | /orgs/{org}/api-keys/{keyId} |
Sites
A site is one documentation site, with its own subdomain, deployment history, domains, and settings.
| GET | List sites | /orgs/{org}/sites |
| POST | Create site | /orgs/{org}/sites |
| GET | Get site | /sites/{site} |
| PATCH | Rename site | /sites/{site} |
| DEL | Delete site | /sites/{site} |
| PUT | Set access control | /sites/{site}/access |
| GET | List access tokens | /sites/{site}/access-tokens |
| POST | Create access token | /sites/{site}/access-tokens |
| DEL | Revoke access token | /sites/{site}/access-tokens/{id} |
| GET | Suggested redirects for 404s | /sites/{site}/redirects |
| POST | Add a redirect | /sites/{site}/redirects |
| DEL | Remove a redirect | /sites/{site}/redirects |
| GET | List what can be exported | /sites/{site}/export |
| GET | Export 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.
| GET | List deployments | /sites/{site}/deployments |
| POST | Create deployment | /sites/{site}/deployments |
| GET | Get deployment | /deployments/{id} |
| POST | Promote to production (roll back) | /deployments/{id}/promote |
| POST | Cancel deployment | /deployments/{id}/cancel |
Custom domains
Verify ownership with a TXT record, then point traffic to the platform with a CNAME.
| GET | List domains | /sites/{site}/domains |
| POST | Add domain | /sites/{site}/domains |
| POST | Verify domain | /sites/{site}/domains/{domain}/verify |
| POST | Set primary domain | /sites/{site}/domains/{domain}/primary |
| DEL | Remove domain | /sites/{site}/domains/{domain} |
Git integration
Connect a Git repository such as GitHub: pushes deploy automatically and pull requests get previews.
| PUT | Connect Git repository | /sites/{site}/git |
| DEL | Disconnect Git repository | /sites/{site}/git |
| POST | Receive 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.
| GET | Get Ask AI settings | /sites/{site}/ai |
| PUT | Update Ask AI settings | /sites/{site}/ai |
| POST | Ask a test question | /sites/{site}/ai/test |
| GET | List available models | /ai/models |
| GET | List custom answers | /sites/{site}/guidance |
| POST | Create custom answer | /sites/{site}/guidance |
| GET | Get custom answer | /sites/{site}/guidance/{id} |
| PATCH | Update custom answer | /sites/{site}/guidance/{id} |
| DEL | Delete custom answer | /sites/{site}/guidance/{id} |
| GET | List content sources | /sites/{site}/sources |
| POST | Add content source | /sites/{site}/sources |
| GET | Get content source | /sites/{site}/sources/{id} |
| PATCH | Update content source | /sites/{site}/sources/{id} |
| DEL | Delete content source | /sites/{site}/sources/{id} |
| POST | Fetch website again | /sites/{site}/sources/{id}/refresh |
| GET | Get embed settings | /sites/{site}/embed |
| PUT | Update embed settings | /sites/{site}/embed |
| GET | Docs eval results | /sites/{site}/evals |
| POST | Upload a docs eval result | /sites/{site}/evals |
| GET | Get a docs eval result | /sites/{site}/evals/{id} |
| DEL | Delete a docs eval result | /sites/{site}/evals/{id} |
Analytics
Traffic broken down by humans, AI, and crawlers, plus Ask AI questions and page feedback.
| GET | Traffic | /sites/{site}/analytics |
| GET | Ask AI questions | /sites/{site}/questions |
| GET | Export Ask AI questions | /sites/{site}/questions.csv |
| GET | Page review | /sites/{site}/page-reviews |
| GET | Resolution rate | /sites/{site}/questions/summary |
| GET | Page 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.
| GET | List scheduled tasks | /sites/{site}/automations |
| POST | Create scheduled task | /sites/{site}/automations |
| GET | Get scheduled task | /sites/{site}/automations/{id} |
| PATCH | Update scheduled task | /sites/{site}/automations/{id} |
| DEL | Delete scheduled task | /sites/{site}/automations/{id} |
| POST | Run now | /sites/{site}/automations/{id}/run |
| GET | Run history | /sites/{site}/automations/{id}/runs |
Visual editor
Online editing on draft branches: read and write files, live rendering, checks, previews, and publishing.
| GET | List draft branches | /sites/{site}/editor/branches |
| POST | Create draft | /sites/{site}/editor/branches |
| DEL | Discard draft | /sites/{site}/editor/branches/{name} |
| GET | File tree and navigation | /sites/{site}/editor/tree |
| GET | Read file | /sites/{site}/editor/file |
| PUT | Save file | /sites/{site}/editor/file |
| DEL | Delete file | /sites/{site}/editor/file |
| POST | Move or rename file | /sites/{site}/editor/move |
| POST | Upload an image, media file or font | /sites/{site}/editor/upload |
| POST | Live render | /sites/{site}/editor/render |
| POST | Check content | /sites/{site}/editor/check |
| POST | Preview draft | /sites/{site}/editor/preview |
| POST | Publish draft | /sites/{site}/editor/publish |
| POST | Translate the site with AI | /sites/{site}/editor/translate |
| GET | Component list | /components |
Background jobs
Long-running work (such as AI translation) runs as background jobs; poll progress by job id.
| GET | Get 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.
| POST | Ask AI chat (SSE) | /_biti/ai/chat |
| GET | Ask AI session token | /_biti/ai/token |
| POST | MCP server | /_mcp/server |
| POST | API explorer proxy | /_biti/proxy |
| POST | Submit page feedback | /_biti/feedback |