TheDocumentation Index
Fetch the complete documentation index at: https://docs.markapidown.net/llms.txt
Use this file to discover all available pages before exploring further.
mad import command converts existing API definitions into MarkApiDown markdown spec files and drops them into your api-docs/ collection. Every subcommand writes one .md file per endpoint, with correct frontmatter and section structure, ready to validate and run immediately.
Overview of mad import
mad import has five subcommands covering the most common API description sources:
| Subcommand | Source |
|---|---|
mad import curl | A raw curl command read from a file or stdin |
mad import postman | A Postman Collection v2.1 JSON file |
mad import insomnia | An Insomnia v4 JSON export |
mad import openapi | An OpenAPI 3.x YAML or JSON file |
mad import project | Your project’s source code or running dev server |
mad validate api-docs/ to confirm all generated specs are structurally valid before you start modifying them.
Import from cURL
Pass the path to a file containing thecurl command, or pipe the command from stdin. MarkApiDown parses the method, URL, headers, and body and writes a spec file into api-docs/.
- From a file
- From stdin (pipe)
Save the
curl command to a text file, then pass the file path as an argument:api-docs/apis/users/get-users.md with the method, path, and headers pre-populated. Authorization header values are replaced with {{authToken}} — move the actual value to .env.local or a MAD_* environment variable.
Import from Postman
Export your Postman collection as Collection v2.1 JSON (File → Export → Collection v2.1) and run:## Expected response blocks. JavaScript pre-request scripts and complex test assertions become agent-task blocks for manual review.
After the import, scan the generated files for agent-task blocks and decide whether to implement each as a structured ## Assertions rule or remove it.
Import from Insomnia
Export your Insomnia workspace as Insomnia v4 JSON (Application → Preferences → Data → Export Data → Current Workspace) and run:{{ var }}) are converted to {{var}} syntax. Plugin-based pre/post-request logic is imported as agent-task blocks.
Import from OpenAPI
Pointmad import openapi at any OpenAPI 3.x file in YAML or JSON format:
servers URL becomes the baseUrl in _shared/env.md under the dev environment. Add additional server URLs to env.md manually as extra environment sections.
MarkApiDown imports only the first documented response code per operation. If your OpenAPI spec documents multiple response codes (200, 400, 404), only the first is written to
## Expected response. Document the others in ## Notes or add them as separate spec files.Scan project source code
mad import project scans your project for API route definitions and creates spec files for any routes that do not already have one. It uses a four-priority import strategy:
Explicit URL (highest priority)
If you pass
--url, MarkApiDown fetches the OpenAPI spec from that URL and imports it directly — no scanning needed.Static OpenAPI file
MarkApiDown searches the project directory for common OpenAPI file names (
openapi.yaml, openapi.json, swagger.yaml, etc.). If found, it imports the full spec including parameters, request bodies, and response schemas.Running dev server
If
--port is provided, MarkApiDown probes the running server for an OpenAPI spec at common paths (/openapi.json, /docs/openapi.json, /api-docs). Use this when your framework generates an OpenAPI spec at runtime.Regex source scan (fallback)
If no OpenAPI spec is found, MarkApiDown falls back to a regex-based scan of your source code. It detects route definitions in Express, FastAPI, Spring Boot, Gin, and other common frameworks and imports the method and path. Request bodies and response schemas are not available from a static scan.
mad import project from your project root without any flags to let MarkApiDown choose the best available strategy automatically:
Import via the browser UI
If you have mad-ui open withmad serve, you can also import from cURL without leaving the browser:
- Open the New Request panel by clicking New Request in the top navigation bar.
- Paste a
curlcommand into the cURL input field. - The panel automatically parses the command and populates the method, URL, headers, and body fields.
- Send the request to verify it, then click Save as spec to write it to
api-docs/.
What gets created
Every import subcommand writes files intoapi-docs/apis/<resource>/ following the MarkApiDown spec convention. Each file includes:
- Frontmatter with
resource,protocol,method,path,version, andenvset correctly. - A
## Requestsection with the resolved HTTP block. - A
## Expected responsesection with the recorded or inferred response, or an empty stub ({}) if no response data was available. - An optional
## Testsor## Notessection for imported comments and agent-task blocks.
After importing
Run
mad index after any import to regenerate api-docs/README.md with an up-to-date list of all spec files. The index is used by the browser UI sidebar and by the MCP server.