Build with AI
Use Medblocks docs, Markdown routes, llms files, and API references with AI coding agents.
AI coding agents work best when they have the same context you would give an engineer: what you are building, which Medblocks flow you are using, which framework you are in, and which docs page is the source of truth.
This page shows the docs surfaces to give an agent before it writes code.
Start with product context
Use Our approach when the agent needs to understand Medblocks terminology, direct integration, patient access, clinical workflows, backend access, or why records are modeled after they arrive.
Then give the exact build guide for the flow:
| Goal | Docs to provide |
|---|---|
| Patient-facing record connection | Patient access overview, Create patients, Create a patient session, Handle the return |
| Dashboard-first setup | Set up your workspace, Configure connections, Use Medblocks without code |
| Webhook receiver | Webhooks, Signatures, Events |
| API integration | API Reference, API errors |
Use Markdown routes
Every docs page has a Markdown version. Use it when you want to paste clean source material into an agent without navigation, styling, or screenshots.
The docs also expose:
/docs/llms.txtfor a compact index./docs/llms-full.txtfor a larger docs export.- Per-page Markdown from the Copy Markdown action.
Markdown is better than copied HTML because tabs, callouts, and code blocks are easier for agents to parse.
Use the API Reference for exact wire shape
When the agent is writing REST calls, give it the relevant API Reference page. The reference includes request parameters, auth requirements, response examples, and standard error behavior.
For TypeScript projects, prefer the SDK when it fits the codebase. For other stacks, use the REST reference and keep the Medblocks API key on the server.
Prompt checklist
Give the agent these details before it starts:
- The product flow you are building.
- Your framework and server runtime.
- The Medblocks docs pages it should follow.
- Whether you want SDK code or REST calls.
- Where server-only environment variables live.
- The return URL or webhook URL your app owns.
- The UI behavior for success, retry, and support states.
For patient access work, also say whether you want Medblocks to host the source search page or whether you are building source search into your own UI.
Guardrails
Ask the agent to follow these rules:
- Keep
MEDBLOCKS_API_KEYon the server. - Do not call Medblocks from browser code with a secret key.
- Use the API Reference as the source of truth for request and response shapes.
- Log Medblocks error codes and request IDs on the server.
- Verify webhook signatures before trusting event payloads.
- Treat the patient return URL as UI state; use server-side reads, webhooks, or dashboard monitoring to confirm record availability.
