Skip to main content

Project config: api-docs/reqbook.md

api-docs/reqbook.md is the project configuration file. It uses YAML frontmatter and structured YAML code blocks inside named markdown sections.

Frontmatter fields

Unknown frontmatter keys produce a warning and are ignored, allowing future versions to add fields without breaking older clients.

Complete example

## Defaults section

The ## Defaults code block sets project-wide defaults for every endpoint. Individual endpoint frontmatter can override each value. CLI flags (--timeout) override both. If ## Defaults is absent, the built-in defaults are used for every endpoint.

## Web preview section

The ## Web preview code block controls rqb serve. CLI flags (--port, --host) override these values.

## Plugins section

the current Reqbook release does not execute plugins. The ## Plugins section is reserved for future use. Keep it as an empty list or omit the section entirely.

## Notes section

Free-form prose, checklists, or team conventions. The Reqbook parser ignores this section entirely. Use it for anything that should live alongside the config but not affect execution.

Auth modes

Set the auth mode in reqbook.md’s ## Defaults section (project-wide) or in individual endpoint frontmatter (per-endpoint override).
Set a project-wide default in reqbook.md’s ## Defaults block, then override per-endpoint with auth: in the endpoint’s frontmatter. The endpoint value always wins.

Retry policy

Configure retries in reqbook.md’s ## Defaults section or in individual endpoint frontmatter.
Retries apply to network errors (exit code 4) and to 5xx responses. They do not retry on test assertion failures (exit code 1) or spec errors (exit code 2). The --timeout CLI flag sets the per-attempt timeout.

Environment config: template and local files

Reqbook uses two environment markdown files: Both files use the same format. Each environment is a second-level heading followed by a yaml code block.
The environment name passed to --env must match one of these headings exactly. If the heading is missing, Reqbook exits with code 2.
Do not put secrets in either env markdown file. Tokens, passwords, and private keys must go in .env.local or RQB_* environment variables. The parser enforces this at validation time and exits with code 5 if a secret pattern is detected.

Variable resolution priority

When the same variable name is defined in more than one source, the highest-priority source wins. OS environment variables are stripped of the RQB_ prefix and converted to lower camel case: