Skip to main content

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 under api-docs/apis/<resource>/. The recommended filename format is <method-lower>-<slug>.md.

Frontmatter reference

Every endpoint file must begin with YAML frontmatter delimited by ---.
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

Set response.match: strict when the JSON/string body must match exactly:
Set 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.
Supported operators: Paths follow the format 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.
Open the endpoint, fill runtime-only params or headers, click Run, and inspect the response panel. The markdown file changes only when you enter edit mode and save.