Skip to main content
OwnDocs

API Blocks

1 min readStableIntermediate

The ApiBlock component renders interactive REST API endpoint documentation with color-coded method badges, JSON highlighting, auth indicators, and auto-generated cURL examples.

Quick Start

A simple GET endpoint.

GET/api/v1/statusNo auth required

Check the service health status.

Request Example
curl -X GET "/api/v1/status"
Response200
{ "status": "healthy", "uptime": 99.97, "version": "1.0.0" }

Adding Options

A POST with a request body, status code, and rate limit.

POST/api/v1/tokensBearer Token

Generate an access token with a scope and expiration.

Rate limit: 60 requests / minute
Headers
Content-Typeapplication/json
Request Body
{ "scope": "read:docs", "expiresIn": "30d" }
Request Example
curl -X POST "/api/v1/tokens" \ -H "Content-Type: application/json" \ -d '{"scope":"read:docs","expiresIn":"30d"}'
Response200
{ "token": "eyJhbGciOi...", "expiresAt": "2026-04-23T12:00:00Z" }

Advanced

Multiple response tabs and deprecation marking.

DeprecatedGET/api/v1/docsBearer Token
Use GET /api/v1/documents instead.

Retrieve documents using the legacy endpoint.

Headers
AuthorizationBearer <token>
Request Example
curl -X GET "/api/v1/docs" \ -H "Authorization: Bearer <token>"
Response
{ "items": [] }

Options

methodstringrequired

GET, POST, PUT, PATCH, or DELETE.

endpointstringrequired

URL path.

descriptionstring

Text shown below the header explaining what the endpoint does.

headersJSON string

Request headers as a JSON object string.

bodyJSON string

Request body.

responseJSON string

Single response body.

statusCodenumberDefault: 200

HTTP status code for the single response.

responsesJSON string

JSON array of response items, each with statusCode, optional label, and body.

authstring

bearer, apiKey, basic, oauth2, or none.

authLabelstring

Custom label that overrides the default auth label.

deprecatedbooleanDefault: false

Marks the endpoint deprecated.

deprecationNotestring

Migration guidance shown in a warning box.

rateLimitstring/JSON

Rate limiting metadata as plain text or JSON.

baseUrlstring

Base URL prefix shown in muted text before the endpoint path.

codeExamplesJSON string

JSON array of extra examples, each with language, label, and code.

Was this page helpful?