Document an endpoint with an API block
API blocks present an endpoint's method, URL, parameters and response examples inside a documentation page.
Add and configure a block
In an editable page, use the insert menu or /api command to add an API documentation block. Enter a clear title, description, HTTP method, base URL and endpoint path.
Document headers, path parameters and query parameters separately. Mark required values and explain their meaning. For example, a path parameter called id should say what resource it identifies, not merely repeat “ID.”
Add a request and responses
Choose the appropriate request body type, such as JSON, form data, raw text or none. Provide an example matching the real endpoint's validation rules.
Add a successful response and the important error responses. Keep status codes and JSON fields consistent with the actual API. Use placeholder credentials such as YOUR_TOKEN; never include a live token in a public example.
Review generated examples
The block can present language-specific request examples and copying controls. Check the resulting URL, authentication header and body before publishing. An example generated from your block configuration is only as accurate as the information entered there.
Troubleshooting
If an imported block does not render, check its structure and required endpoint fields. Compare the reading view with the editor configuration. For portable exports, verify that the relevant request and response information is preserved.
API blocks document your endpoints. They do not create a backend route or change its authentication behavior. To use DocuWriter's own endpoints, start with the API quickstart.
Updated