Skip to content

API reference recipe

Rendered

matter
docs.mattermode.com / api / create-entity⌘K

Create entity

POST/v1/entities

Bring an entity into existence. Returns a `pending` entity immediately; terminal status arrives via webhook.

curl -X "POST" /v1/entities \
  -H "Authorization: Bearer sk_…" \
  -d '{"jurisdiction":"DE"}'

Goal

When a developer lands on an endpoint page, they need three things at once: (1) what the endpoint does, (2) what to send and what comes back, (3) a way to try it without leaving the page. The API-reference recipe puts all three in front of them without scrolling.

Layout breakdown

Two-column body inside a docs-shell topbar + sidebar. Region map:

┌─ Topbar (global) ──────────────────────────────────────────────┐
│  [Matter logo]   Docs   Brand   API   Changelog   [Try]  ⌘K   │
├─ Sidebar ─┬─ Operation column (8/12) ──┬─ TOC rail (4/12) ─────┤
│  Create   │  ◇ Eyebrow                 │  On this page         │
│  Manage   │  EndpointBadge + Path       │   • Request           │
│  Exit     │  Description (3 paragraphs) │   • Response          │
│  Tokens   │  CodeBlock w/ EndpointBadge │   • Errors            │
│  …        │   header — request          │   • SDK example       │
│           │  CodeBlock w/ EndpointBadge │   • Webhook           │
│           │   header — response (200)   │                       │
│           │  Tabs (Errors / Webhooks)   │                       │
│           │                             │                       │
└───────────┴─────────────────────────────┴───────────────────────┘

The operation column is 8/12 columns at desktop, full-width on mobile. The TOC rail collapses below the operation column at < 1024px.

Component manifest

RegionComponentWhy over alternatives
TopbarAppBreadcrumb + global navBreadcrumb anchors the user's place in the API tree; global nav stays sticky
SidebarFumadocs <DocsLayout sidebar>Native to the docs framework; preserves search + collapsible groups
Operation eyebrowEyebrowSection anchor — "Create" / "Manage" / "Exit" lifecycle phase
Endpoint headerEndpointBadgeMethod-color chip + path; reads at a glance
Code surfacesCodeBlock with header slotThe V2 canonical shape — header carries EndpointBadge + latency
Try-it-nowScalar playground (embedded iframe)Inline execution without leaving the page
TOC railFumadocs <DocsPage toc>Native; auto-derived from heading hierarchy

Responsive behaviour

BreakpointOperation columnTOC rail
< 768pxFull width; sidebar drawerHidden (TOC accessible via top button)
768–1023pxFull widthBelow operation column
≥ 1024px8/12 cols4/12 cols, sticky

States

StateTriggerBehaviour
DefaultPage loadOperation column hydrates first, playground iframe lazy-loads
Playground loadingScalar embed initialisingSkeleton placeholder; non-blocking
Try-it executedUser clicks RunResponse area updates with latency + body; CodeBlock header shows real status
ErrorScalar request failsInline error message in the response CodeBlock; preserve request body
Mobile< 768pxSidebar collapses to drawer; TOC moves to top-button menu

Implementation

Source: apps/docs/app/(docs)/[...slug]/page.tsx. The route handler reads the OpenAPI operation from apps/docs/api-reference/openapi.yaml, hydrates it through the generated MDX, and renders the operation column. The Scalar playground iframe lives in a sibling apps/docs/components/scalar-playground.tsx and is mounted as a next/dynamic import (no SSR).

Source

apps/docs/app/(docs)/[...slug]/page.tsx

On this page