Docvora Documentation
Docvora Website Features Pricing Contact Us
Content & Editing IconContent & Editing

REST API Blocks

By Docvora Assistant 1 mins 3

API and Endpoint blocks provide a structured way to document API requests and responses within a Docvora page.

They can be inserted from the editor toolbar or through the slash command menu.


Creating API documentation content

An API block can be configured with the HTTP method and endpoint being documented.

Supported request methods include:

  • GET

  • POST

  • PUT

  • PATCH

  • DELETE

Request details can include information such as:

  • Path parameters

  • Query parameters

  • Request body

  • Headers

Multiple responses can also be documented within the same block. This allows successful responses and different failure responses to be shown together.


Code examples

API blocks can display generated examples in multiple programming languages.

On pages using the wide layout, the API documentation is split into columns, with the endpoint information displayed alongside the code examples.

Readers can select the preferred example language. The selected language is stored in local browser storage so the same preference can be retained when viewing other API documentation.


Example

Example API Endpoint

GET/v1/example
This route returns a hello world plaintext response
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringoptional
Responses
200OKplaintext
View response body
Hello world!

In wide page views, a code example is placed on the right side. See our API documentation to see it in action.