What is an endpoint file?
An endpoint file is a.md file that serves as both documentation and an executable HTTP request. The CLI, web preview, CI, and AI agents all read the same file there is no separate schema, generated client, or runtime artifact.
Browser UI
The web preview renders the file, lets you run it, and provides runtime-only params, headers, and body overrides.
Coding agents
Agent skills use this structure to create specs safely and validate them before reporting back.
Terminal and CI
rqb exec and rqb validate read the same markdown file for automation.File location and naming
Endpoint files live underapi-docs/apis/<resource>/. The recommended filename format is <method-lower>-<slug>.md.
| HTTP method + path | Filename |
|---|---|
GET /users/:id | get-user-by-id.md |
POST /orders | post-orders.md |
DELETE /subscriptions/:id | delete-subscription-by-id.md |
PATCH /orders/:orderId/items/:itemId | patch-order-by-order-id-item-by-item-id.md |
Frontmatter reference
Every endpoint file must begin with YAML frontmatter delimited by---.
| Field | Required | Type | Description | Default |
|---|---|---|---|---|
resource | yes | string | Resource group and folder name | |
protocol | yes | enum | http, ws, or sse. Only http executes in the current release | |
method | yes | enum | GET POST PUT PATCH DELETE HEAD OPTIONS | |
path | yes | string | Path with :param for path params | |
tags | no | string[] | Searchable labels shown in web preview and reports | [] |
version | yes | integer | Spec version (must be 1) | |
env | no | string[] | Environments where this endpoint is valid. Empty = all | [] |
auth | no | enum | none / bearer / basic / custom | project default |
timeout | no | integer (ms) | Per-request timeout in milliseconds | 5000 |
retry.attempts | no | integer | Retry count after failure | 0 |
retry.backoff | no | enum | fixed or exponential | fixed |
response.match | no | enum | shape, strict, or schema comparison mode | shape |
response.ignore | no | string[] | Strict-mode paths to ignore, such as body.id | [] |
Unknown frontmatter keys produce a warning and are ignored. This forward-compatible behavior means future Reqbook versions can introduce new fields without breaking existing spec files.
The Request block
## Request must contain exactly one http fenced code block. The first line is the request line; subsequent lines are headers; a blank line separates headers from the optional body.
Request line forms
Relative URLs are resolved against the selected environment’s
baseUrl from api-docs/_shared/env.md. Absolute URLs are used as-is.Full request with headers and body
The Expected response block
## Expected response must contain exactly one http fenced code block. Reqbook diffs the actual response against this block after every execution.
Comparison behavior
| Part | Comparison |
|---|---|
| Status | Strict equality |
| Headers | Subset match listed headers must be present; extra response headers are allowed |
| Body | JSON shape when both sides are valid JSON; exact string match otherwise |
response.match: strict when the JSON/string body must match exactly:
response.match: schema when the actual JSON body should validate against a schema:
Example
Error responses (optional)
Use## Error responses to document representative error contracts such as validation failures, missing auth, not found, or conflict cases.
the current Reqbook release executes only the single
## Expected response block. Error responses are reference examples for humans, the web preview source view, and AI agents.The Assertions block (optional)
## Assertions contains structured rules that Reqbook evaluates after each execution. Results appear in rqb_exec output as assertion_results.
| Operator | Example | Description |
|---|---|---|
exists | body.id: exists | Field is present and non-null |
equals | status: 201 or body.name: equals "Ada" | Exact match |
contains | headers.content-type: contains json | Substring match |
in | body.role: in [admin, user] | Value is one of a list |
matches | body.slug: matches ^[a-z-]+$ | Regex match |
status, body.<field>.<nested>, or headers.<name>.
The Tests block (optional)
## Tests contains an agent-task fenced code block with freeform validation instructions for AI agents. Use this for edge cases that can’t be expressed as structured assertions.
Reqbook does not execute
agent-task code. The block is read by AI agents as instructions.Notes section (optional)
## Notes is free-form markdown for team context: rate limits, edge cases, links to related endpoints, and migration notes. The Reqbook parser ignores this section entirely.
Complete example
Running an endpoint
Use the UI while developing and the CLI when you need automation.- Web UI
- CLI