fabro/docs/api-reference/overview.mdx
Bryan Helmkamp 28884ae093 rename Arc to Fabro in all Rust crates, symbols, env vars, and supporting files
- Rename 20 crate directories lib/crates/arc-* → fabro-*
- Update all Cargo.toml: crate names, dep paths, feature flags, bin name
- Rename arc_server module → fabro_server in fabro-llm
- ArcError → FabroError across 30+ files
- ARC_VERSION/ARC_GIT_SHA/ARC_BUILD_DATE → FABRO_* constants
- All use/qualified paths: arc_agent:: → fabro_agent::, etc. (~1500 occurrences)
- Env vars ARC_* → FABRO_* in string literals and shell scripts
- String literals: X-Arc-Demo, arc-bot, arc@local, arc-web, arc-mcp, etc.
- Path strings: .arc/ → .fabro/, arc.toml → fabro.toml, refs/arc/ → refs/fabro/
- arc-api.yaml → fabro-api.yaml (OpenAPI spec)
- skills/arc-create-workflow → fabro-create-workflow
- trycmd fixtures: $ arc → $ fabro
- Inline snapshots (insta) updated
- CI, Docker, install.sh, scripts, CLAUDE.md, AGENTS.md
- TypeScript app: env vars, headers, JWT issuer
- Docs: page slugs, git refs, config paths, sandbox names, repo URLs
- Repo references: brynary/arc → fabro-sh/fabro

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:25:58 -04:00

149 lines
4.5 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "API Overview"
description: "Introduction to the Fabro REST API"
---
<Warning>
The Fabro API is **under active development** and may be subject to change. Endpoints, request/response formats, and authentication mechanisms may evolve as the project matures.
</Warning>
The Fabro API is a REST API for managing workflow runs, interactive sessions, and related resources. All requests and responses use JSON.
## Base URL
The API is served by `fabro serve`, which defaults to:
```
http://localhost:3000
```
The base URL is configurable via `server.toml`:
```toml title="server.toml"
[api]
base_url = "https://fabro.example.com"
```
## Authentication
The API supports two authentication strategies, configured in `server.toml`:
```toml title="server.toml"
[api]
authentication_strategies = ["jwt"]
```
### JWT (Bearer Token)
Send an Ed25519-signed JWT in the `Authorization` header:
```
Authorization: Bearer <token>
```
The token must include these claims:
| Claim | Description |
|-------|-------------|
| `iss` | Issuer — must be `fabro-web` |
| `iat` | Issued-at timestamp (Unix seconds) |
| `exp` | Expiration timestamp (Unix seconds) |
| `sub` | Subject — a URL identifying the user (e.g. `https://github.com/username`) |
The username is extracted from the last path segment of the `sub` claim and checked against the `allowed_usernames` list in the web auth config.
Set the verification key via the `FABRO_JWT_PUBLIC_KEY` environment variable (PEM format or base64-encoded PEM).
### mTLS (Mutual TLS)
With mTLS, the client authenticates using a TLS client certificate. Configure both the strategy and TLS paths:
```toml title="server.toml"
[api]
authentication_strategies = ["mtls"]
[api.tls]
cert = "~/.fabro/certs/server.crt"
key = "~/.fabro/certs/server.key"
ca = "~/.fabro/certs/ca.crt"
```
The Common Name (CN) from the client certificate identifies the user.
### Multiple Strategies
You can configure both strategies. They are tried in order — the first successful match wins:
```toml title="server.toml"
[api]
authentication_strategies = ["jwt", "mtls"]
```
## Errors
### Error Shape
All error responses share a consistent JSON structure:
```json
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Run abc123 not found."
}
]
}
```
Each entry in the `errors` array contains:
| Field | Type | Description |
|-------|------|-------------|
| `status` | `string` | The HTTP status code as a string |
| `title` | `string` | The canonical reason phrase for the status code |
| `detail` | `string` | A human-readable explanation of the error |
### HTTP Status Codes
| Status | Meaning | When It Occurs |
|--------|---------|----------------|
| `400 Bad Request` | The request body or parameters are invalid | Missing required fields, malformed JSON |
| `401 Unauthorized` | Authentication is missing or invalid | No token, expired token, invalid certificate |
| `403 Forbidden` | The authenticated user lacks access | Username not in the allowed list |
| `404 Not Found` | The requested resource does not exist | Unknown run ID, unknown workflow name |
| `409 Conflict` | The resource is in a conflicting state | Answering a question on a run that isn't running yet |
| `410 Gone` | The resource is no longer available | SSE event stream has closed |
| `501 Not Implemented` | The endpoint exists but is not yet implemented | Placeholder routes |
| `502 Bad Gateway` | An upstream dependency failed | Graphviz `dot` not installed or returned an error |
## Pagination
List endpoints that return large collections use offset-based pagination. Pass pagination parameters as query strings:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page[limit]` | `integer` | `20` | Maximum number of items to return (clamped to 1100) |
| `page[offset]` | `integer` | `0` | Number of items to skip |
Paginated responses include a `meta` object alongside the `data` array:
```json
{
"data": [...],
"meta": {
"has_more": true
}
}
```
When `has_more` is `true`, increment the offset by the limit to fetch the next page.
## Versioning
The Fabro API does not currently use versioning. All endpoints reflect the latest behavior of the running server. Breaking changes will be communicated in the [changelog](/changelog/2026-03-06).
## Discovery
The root endpoint (`GET /`) returns discovery URLs. The health endpoint (`GET /health`) can be used for liveness checks. The OpenAPI spec is available at `GET /openapi.json`.