Every API endpoint in MarkApiDown is a singleDocumentation Index
Fetch the complete documentation index at: https://docs.markapidown.net/llms.txt
Use this file to discover all available pages before exploring further.
.md file living under api-docs/apis/<resource>/. Open it in any editor, commit it to version control, and review it in a pull request — no proprietary format, no binary blobs. The mad CLI reads these files directly to validate contracts and send real HTTP requests.
File location and naming
Place each endpoint spec atapi-docs/apis/<resource>/<method>-<slug>.md. The resource maps to a logical group (e.g. posts, users, orders), and the slug is a short human-readable description of what the endpoint does.
Follow the
<method>-<slug>.md naming convention so mad index can regenerate api-docs/README.md automatically and the browser UI can derive the HTTP method badge without parsing the file. Examples: get-post-by-id.md, create-post.md, delete-user.md.Frontmatter fields
Every spec file opens with a YAML frontmatter block fenced by---. MarkApiDown parses this block to know how to route and execute the request.
Required fields
The resource group this endpoint belongs to (e.g.
posts, users). Used to
organize the browser UI and for tag filtering.Transport protocol. Use
http for all standard REST and HTTP APIs.HTTP method in uppercase:
GET, POST, PUT, PATCH, DELETE, HEAD, or
OPTIONS.The URL path, relative to
baseUrl. Use :paramName syntax for path
parameters (e.g. /posts/:postId).Spec schema version. Always set to
1 for current MarkApiDown specs.Optional fields
A list of tags for grouping and filtering in the browser UI (e.g.
[posts, read]).The environments this endpoint is valid for (e.g.
[dev, staging]). When
omitted, the spec runs against any environment.Authentication strategy. Use
none to skip auth, or reference a named auth
scheme from mad.md (e.g. bearer).Request timeout in milliseconds. Overrides the project-level default in
mad.md.Retry configuration. Set
attempts (integer) and backoff (fixed or
exponential) to automatically retry failed requests.Sections
After the frontmatter and a short prose description, structure the file using these headings in order.## Request
Write the outgoing HTTP request as a fenced http code block. The first line is the method and URL. Add headers on subsequent lines, then a blank line, then the body (if any).
## Expected response
Write the full expected HTTP response as a fenced http code block, starting with the status line. MarkApiDown diffs the actual response body against this block and highlights any mismatches in the browser UI.
## Assertions (optional)
List targeted checks that must pass for the execution to succeed. See Assertions for the full operator reference.
## Tests (optional)
An agent-task fenced block containing natural-language instructions for AI agents. The agent executes these steps using the MCP tools.
## Notes (optional)
Free-form markdown for team documentation — context, caveats, and links that help reviewers understand the endpoint.
Annotated GET example
The following spec fetches a single post by its numeric ID. It uses a path parameter (:postId) and reads baseUrl from the environment.
Path parameters
Declare path parameters in thepath frontmatter field using the :param prefix. MarkApiDown substitutes the value at runtime from:
- A matching variable in
_shared/env.mdfor the active environment - A
--varflag passed on the CLI (e.g.--var postId=42) - A value captured by a pipeline step and injected into downstream steps
## Request block, repeat the same :param syntax in the URL path — do not wrap path params in {{ }}:
{{baseUrl}} is a template variable resolved from the environment. :postId is a path parameter declared in the frontmatter.
Template variables {{variable}}
Use double-curly-brace syntax anywhere in the ## Request block — URL, headers, and body — to inject values from the active environment or from CLI --var flags.
{{baseUrl}}, {{apiToken}}, and {{userId}} at execution time using the variable resolution order. Unresolved variables are reported as an error before the request is sent.
POST example with a JSON body
The following spec creates a new post. Notice how{{userId}} in the request body is substituted from the environment, and the ## Expected response block captures only the fields you care about.