Skip to navigation

Endpoint response snippet

View as Markdown

Use the <EndpointResponseSnippet> component to reference an endpoint response from your API Reference. When AI agents fetch the Markdown version of a page, Fern renders the response examples as fenced code blocks, so agents consuming your docs via .md URLs or llms.txt receive the full response payloads without parsing HTML.

Usage

Response
{
"turns": [
{
"role": "user",
"content": "string"
}
],
"citations": [
"string"
],
"sources": [
{
"url": "string",
"title": "string"
}
]
}
Markdown
<EndpointResponseSnippet endpoint="POST /chat/{domain}" />

Reference particular examples

1

Set the example name in your spec

openapi.yml
paths:
/pet/{petId}:
put:
summary: Get a pet
operationId: pets_get
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
examples:
ExampleWithMarkley:
summary: This is an example of a Pet
value:
name: Markley
id: 44
2

Directly reference the example

Markdown
<EndpointResponseSnippet
endpoint="GET /pet/{petId}"
example="ExampleWithMarkley"
/>

Properties

endpoint
stringRequired

The endpoint to display, in the format METHOD /path (e.g., POST /chat/{domain}). If your API uses namespaces, prefix with the namespace and :: (e.g., payments::POST /chat/{domain}).

example
string

The name of a specific example to display. If the example includes a summary or docs field, use that value.

highlight
number | number[]

Line numbers to highlight in the code snippet. Accepts a single number, an array of numbers, or ranges (e.g., {[1-3, 5]}).