Skip to main content
CodivDocs

ApiMethod

Colored HTTP method badge for API endpoint pages and navigation.

Usage

Drop <ApiMethod> next to a URL to give the method a color-coded label. Readers can scan a list of endpoints and immediately spot which is GET, POST, PUT, etc.

<ApiMethod method="POST" /> `/v1/projects`

POST /v1/projects

All methods

The standard HTTP method colors follow the Mintlify / Stripe / Postman convention so readers don't need to learn a new palette.

<ApiMethod method="GET" />     `/v1/projects`
<ApiMethod method="POST" />    `/v1/projects`
<ApiMethod method="PUT" />     `/v1/projects/{id}`
<ApiMethod method="PATCH" />   `/v1/projects/{id}`
<ApiMethod method="DELETE" />  `/v1/projects/{id}`
<ApiMethod method="OPTIONS" /> `/v1/projects`
<ApiMethod method="HEAD" />    `/v1/projects/{id}`

GET /v1/projects

POST /v1/projects

PUT /v1/projects/{id}

PATCH /v1/projects/{id}

DELETE /v1/projects/{id}

OPTIONS /v1/projects

HEAD /v1/projects/{id}

Color reference

MethodColorTheme token
GETgreen--docs-success
POSTblue--docs-info
PUTyellow--docs-warning
PATCHprimary (purple-ish)--docs-primary
DELETEred--docs-danger
OPTIONSgray--docs-fg-muted
HEADgray--docs-fg-muted

The colors are not hardcoded — they're driven by your theme tokens. If you change --docs-success to teal in your custom theme, GET badges turn teal.

Endpoint headings

Pair with a code-formatted URL inside an h2 to get a clean endpoint header:

## <ApiMethod method="POST" /> `/v1/projects`

Case insensitive

Lowercase works too — common when authors copy from JavaScript fetch calls:

<ApiMethod method="get" />
<ApiMethod method="post" />

Auto-generation

In Phase 4, the OpenAPI parser automatically renders an <ApiMethod> next to each endpoint title in the auto-generated reference pages. You don't need to add it manually for endpoints that come from a spec — only for endpoints documented by hand.

Props

PropTypeRequiredDescription
method"GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" (case insensitive)YesThe HTTP method to display

Last updated April 12, 2026