Developers · Gutenberg

API Reference block for WordPress

Display API endpoint documentation with method badge, parameters table, and request/response code examples.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Display API endpoint documentation with method badge, parameters table, and request/response code examples.

Inspector panels on this block: Endpoint Settings, Code Examples, Parameters (' + a.params.length +, Header Colors, Method Colors. Those titles come from index.js, not from a shared template.

Behavior controls: “Location” options: Path, Query, Body, Header; “Type” options: string, integer, number, boolean, array; “Authentication Type” options: No Auth, Bearer Token, API Key, Basic Auth; “Request Language” options: cURL, JavaScript, Python, PHP, Go.

Where to find it

Gutenberg inserter → Developers → search “API Reference” (block name `blockenberg/api-reference` in block.json). Style it in the sidebar after insert.

How to use API Reference block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “API Reference”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Endpoint Settings. Set “Name”, “Location”, “Type”, “Required”.
  4. Check the published page. The view script reads HTML data attributes: data-opts, data-rendered, data-tab. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
NameText field in the inspector.
LocationSelect control; the chosen value is saved on the block. Options: Path; Query; Body; Header.
TypeSelect control; the chosen value is saved on the block. Options: string; integer; number; boolean; array; object.
RequiredOn/off toggle in the inspector.
DescriptionText field in the inspector.
ExampleText field in the inspector.
HTTP MethodSelect control; the chosen value is saved on the block. block.json default: GET. Saved as `method`.
Base URLText field in the inspector. block.json default: https://api.example.com. Saved as `baseUrl`.
Endpoint PathText field in the inspector. block.json default: /api/v1/users/{id}. Saved as `endpoint`.
Authentication TypeSelect control; the chosen value is saved on the block. Options: No Auth; Bearer Token; API Key; Basic Auth. block.json default: bearer. Saved as `authType`.
Show Base URLOn/off toggle in the inspector. On by default. Saved as `showBaseUrl`.
Show Auth BadgeOn/off toggle in the inspector. On by default. Saved as `showAuth`.
Show Copy ButtonOn/off toggle in the inspector. On by default. Saved as `showCopyButton`.
Request LanguageSelect control; the chosen value is saved on the block. Options: cURL; JavaScript; Python; PHP; Go. block.json default: curl. Saved as `requestLang`.
Code ThemeSelect control; the chosen value is saved on the block. Options: Dark; Light. block.json default: dark. Saved as `codeTheme`.
Border RadiusNumeric range control in the inspector. Range 0–20. block.json default: 8. Saved as `borderRadius`.
Header BackgroundColor control in the inspector. block.json default: #1e1e2e. Saved as `headerBg`.
Header TextColor control in the inspector. block.json default: #e2e8f0. Saved as `headerColor`.
Header Colors — BorderColor control in the inspector. block.json default: #e2e8f0. Saved as `borderColor`.
Table BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `tableBg`.
Table Alt RowColor control in the inspector. block.json default: #f8fafc. Saved as `tableAltBg`.
GETColor control in the inspector. block.json default: #22c55e. Saved as `getBg`.
POSTColor control in the inspector. block.json default: #3b82f6. Saved as `postBg`.
PUTColor control in the inspector. block.json default: #f59e0b. Saved as `putBg`.
PATCHColor control in the inspector. block.json default: #8b5cf6. Saved as `patchBg`.
DELETEColor control in the inspector. block.json default: #ef4444. Saved as `deleteBg`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the API Reference block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “API Reference”. It sits under Developers. After insert, open Endpoint Settings and set “Name”, “Location”, “Type”, “Required”.

What makes API Reference different from other Blockenberg blocks?

Display API endpoint documentation with method badge, parameters table, and request/response code examples. Inspector labels on this block include “Name”, “Location”, “Type”, “Required”.

Is the API Reference Gutenberg block free?

Yes. API Reference ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style API Reference to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Endpoint Settings, Code Examples, Parameters (' + a.params.length +, Header Colors).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert API Reference from the Gutenberg inserter.

Get Blockenberg