Request and Response Examples
Learn how to document APIs with RequestExample and ResponseExample components using a practical Acme support ticket workflow.
Use RequestExample and ResponseExample to show real API usage alongside your endpoint docs. The components support multiple languages, response statuses, and inline explanations.
Example: Retrieve a Support Ticket
This example documents a simple GET /tickets/{ticket_id} endpoint for the Acme Support API.
Request
Use parameter fields to describe what the endpoint expects. The code sample lives in the right sidebar.
ticket_idstringrequiredUnique ticket identifier returned when the ticket was created.
curl -X GET https://api.acme.com/v1/tickets/tkt_9S8L2 \
-H "Authorization: Bearer $ACME_TOKEN"Response
Use response fields to document the most important attributes returned by the API.
idstringrequiredUnique ticket identifier.
statusstringCurrent ticket status (open, pending, or resolved).
created_atstringISO 8601 timestamp for when the ticket was created.
{
"id": "tkt_9S8L2",
"customer_id": "cus_2X9W8",
"subject": "Export stuck on step 3",
"priority": "high",
"status": "open",
"created_at": "2026-02-04T16:12:00Z"
}Tips
- Include at least one success response and one error response.
- Use realistic identifiers and timestamps to make examples feel real.
- Keep payloads minimal so readers can scan quickly.
