Full reference
Complete schema documentation for every bolla concept.
Request definition
A request definition is any file ending in .bolla.yaml. bolla recursively scans your collection directory for them.
id: string # unique within collection (required)
name: string # display name
method: GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS
url: string # supports {{variables}}
headers:
X-My-Header: value
query:
param_name: value
auth: # see Authentication section
body: # see Body section
assertions: # see Assertions section
examples: # used by mock server
- name: success
status: 200
headers:
Content-Type: application/json
body: '{"id": "123"}'
Body
body:
type: json # json | raw | form
content: # for type: json — a YAML map serialized to JSON
key: value
# or for type: raw:
raw: '{"manual":"json"}'
content_type: application/json # overrides default Content-Type
Authentication
| Type | Fields | Notes |
|---|---|---|
bearer | token | Sends Authorization: Bearer <token> |
basic | username, password | Base64-encodes and sends header |
api_key | header, value | Custom header name |
oauth2 | flow_id | References an OAuth2 flow — see OAuth2 section |
none | — | Explicit no-auth (overrides collection default) |
# Bearer example
auth:
type: bearer
token: "{{TOKEN}}"
# API key example
auth:
type: api_key
header: X-API-Key
value: "{{API_KEY}}"
Assertions
Assertions run after every request. A failed assertion marks the run as failed in CI mode.
| check | Fields | Description |
|---|---|---|
status_code | value: int | Exact HTTP status match |
status_in | values: [int] | Status is one of the list |
body_contains | text: string | Response body contains substring |
body_json_path | path: string, value: any | JSONPath expression equals value |
header_equals | name: string, value: string | Response header equals value |
header_contains | name: string, value: string | Response header contains substring |
elapsed_ms | max: int | Response time < max milliseconds |
response_size | max: int | Body size < max bytes |
Variables
Use {"{{name}}"} anywhere in url, headers, body, auth. Variables are resolved from the active environment at request time.
# staging.env.yaml
id: staging
name: Staging
vars:
base_url: https://api-staging.example.com
TOKEN: "" # overridden by env var BOLLA_VAR_TOKEN at runtime
Any vars field can be overridden by an environment variable named BOLLA_VAR_<UPPERCASE_KEY>. This is the recommended pattern for secrets in CI.
Protocols
| Protocol | How to use |
|---|---|
| HTTP/1.1 & HTTP/2 | Default. Any http:// or https:// URL. |
| GraphQL | Set method: POST, body.type: json, include query and optional variables fields in body content. |
| WebSocket | Use ws:// or wss:// URL. Add ws_messages: list to send after connect. |
| SSE | Use HTTP GET to an SSE endpoint. bolla streams events and captures them in the response body. |
Load & scenarios Core
A scenario file (*.scenario.yaml) defines a multi-step load test.
id: smoke
name: Smoke test
load:
type: ramp # ramp | constant | spike
start_concurrency: 5
end_concurrency: 50
duration_s: 60
steps:
- request_id: create-user
extract:
USER_ID: "$.id" # JSONPath extraction into a variable
- request_id: get-user
vars:
id: "{{USER_ID}}"
think_time_ms: 500 # pause between steps (simulates real user)
gates:
p50_ms: { max: 100 }
p95_ms: { max: 300 }
p99_ms: { max: 800 }
error_pct: { max: 0.5 }
rps: { min: 100 }
| Load type | Description |
|---|---|
ramp | Linear ramp from start_concurrency to end_concurrency over duration_s |
constant | Fixed concurrency for duration_s. Uses end_concurrency. |
spike | Ramp up, hold at peak, ramp down. Configure with ramp_s, hold_s. |
Mock server Optional
bolla --mock --collection ./my-api --mock-port 3078
Serves your collection as an HTTP mock. Route matching uses method + url path from each request definition.
Example selection: by default the first example matching the request is returned. Override per-request with the header X-Bolla-Example: <name>.
Auto-generated responses: if no example matches, bolla generates realistic fake data based on field names. Fields named id, uuid, email, phone, name, price, created_at etc. receive appropriate fake values.
CI / CD gates Optional
bolla --ci --scenario smoke --env staging
Runs headless, prints a structured pass/fail summary, and exits 0 on pass or 1 on any gate failure.
Output files in .bolla/runs/<run-id>/:
junit.xml— for GitHub Actions, GitLab CI, Jenkinsresult.json— full metrics JSON for custom dashboards
Publish JUnit in GitHub Actions: add uses: EnricoMi/publish-unit-test-result-action@v2 pointing at .bolla/runs/**/junit.xml to get inline PR annotations.
OAuth2 Optional
Define flows in .bolla/oauth2.yaml:
flows:
- id: my-service
grant_type: client_credentials # or authorization_code, device_code
token_url: https://auth.example.com/token
client_id: "{{OAUTH_CLIENT_ID}}"
client_secret: "{{OAUTH_CLIENT_SECRET}}"
scopes: [read, write]
Reference a flow from any request: auth: { type: oauth2, flow_id: my-service }.
Tokens are cached in .bolla/tokens/ encrypted with AES-256-GCM. Expired tokens are refreshed automatically.
Presets available for: Google, GitHub, Microsoft (Azure AD), Okta, Auth0.
OpenAPI contracts Optional
# Import a spec and generate a collection
bolla --import-spec ./openapi.yaml --output ./my-api/
# Detect drift between spec and live responses
bolla --drift --spec ./openapi.yaml --env staging
Supported formats: OpenAPI 3.0, OpenAPI 3.1, Swagger 2.0. Import creates one .bolla.yaml per operation with auto-generated assertions for required fields and response schema.
History & reports Optional
All runs are stored in .bolla/history.db (SQLite). Browse and filter via the UI or REST API.
| Export format | Endpoint |
|---|---|
| CSV | GET /api/runs/export?format=csv |
| HTML report | GET /api/runs/export?format=html |
| JSON | GET /api/runs/export?format=json |
Run-to-run comparison: GET /api/load-runs/compare?a=<id>&b=<id> returns delta percentages for all metrics, with improved: true/false per metric.
Polish bundle Optional
A collection of productivity extras:
- Code snippets — export any request as cURL, Python (requests), JavaScript (fetch), or Go (net/http) via
GET /api/polish/snippet?id=<req-id>&lang=python - cURL import — paste a cURL command and get a
.bolla.yamlback:POST /api/polish/import/curl - HAR import — import a browser HAR file into a collection:
POST /api/polish/import/har - Security linter — scan a request for hardcoded secrets, missing auth, insecure URLs:
GET /api/polish/lint?id=<req-id> - HTML docs — generate self-contained HTML documentation for your collection:
GET /api/polish/docs - Dashboard stats — aggregate pass rate, avg latency, top failing requests:
GET /api/polish/dashboard
AI assist Optional
Powered by Claude. You supply your own Anthropic API key — it never touches disk and is never sent anywhere except api.anthropic.com.
# Set key via env var (recommended for CI)
export ANTHROPIC_API_KEY=sk-ant-...
# Or set it in the UI: Settings → AI assist → API key
| Feature | Endpoint | Description |
|---|---|---|
| Assertion suggestions | POST /api/ai/suggest-assertions | Analyzes a response and suggests assertion rules |
| CI summary | POST /api/ai/summarize-ci | Plain-English summary of a CI run result |
| Load summary | POST /api/ai/summarize-load | Plain-English analysis of a load test result |
| Set key | POST /api/ai/key | Set API key at runtime (in-memory only) |
REST API
When running bolla --server, all capabilities are accessible via a local REST API on port 3077.
Core
| Method | Path | Description |
|---|---|---|
| GET | /api/requests | List all request definitions |
| GET | /api/requests/:id | Get a single request definition |
| POST | /api/run | Execute a request |
| GET | /api/environments | List environments |
| GET | /api/runs | Search run history |
| GET | /api/runs/export | Export history (format=csv|html|json) |
| GET | /api/load-runs | Search load run history |
| GET | /api/load-runs/compare | Compare two load runs |
Load
| Method | Path | Description |
|---|---|---|
| POST | /api/load/run | Start a load test scenario |
| GET | /api/load/status | Poll live metrics during a run |
| POST | /api/load/stop | Abort the current load test |
CLI flags
| Flag | Default | Description |
|---|---|---|
--server | false | Start the API server + UI |
--port | 3077 | Server port |
--collection | . | Directory to scan for .bolla.yaml files |
--env | — | Environment ID to activate |
--ci | false | Headless CI mode |
--scenario | — | Scenario ID or path for CI/load run |
--load | false | Run a load test (interactive) |
--mock | false | Start the mock server |
--mock-port | 3078 | Mock server port |
--import-spec | — | Path to OpenAPI spec to import |
--output | . | Output directory for imported collection |
--version | — | Print version and exit |