Logo

Getting Started

IntroductionInstallationQuick Start
Logo
DocumentationAPI ReferenceChangelog

Components

ResponseField

Document API response fields with type information and structure

Overview

The <ResponseField> component documents fields in API responses, showing their types, requirements, and nested structure. Similar to ParamField but designed specifically for response documentation.

Basic Usage

id
stringrequired

Unique identifier for the resource.

Complete API Response Example

Response Body

success
booleanrequired

Whether the request was successful.

data
objectrequired

Response data object.

data
id
stringrequired

Order identifier (UUID).

data
status
stringrequired

Order status: pending, processing, completed, cancelled

data
total
numberrequired

Total order amount in cents.

data
customer
objectrequired

Customer information.

datacustomer
email
stringrequired

Customer's email address.

datacustomer
name
stringrequired

Customer's full name.

data
items
arrayrequired

Array of ordered items.

dataitems[]
product_id
stringrequired

Product identifier.

dataitems[]
quantity
numberrequired

Number of units ordered.

dataitems[]
price
numberrequired

Price per unit in cents.

data
created_at
stringrequired

ISO 8601 timestamp of order creation.

data
updated_at
stringrequired

ISO 8601 timestamp of last update.

Pagination Response

Pagination Response

data
arrayrequired

Array of result items.

pagination
objectrequired

Pagination metadata.

pagination
page
numberrequired

Current page number (1-indexed).

pagination
per_page
numberrequired

Items per page.

pagination
total
numberrequired

Total number of items across all pages.

pagination
total_pages
numberrequired

Total number of pages.

pagination
has_next
booleanrequired

Whether there are more pages available.

pagination
has_prev
booleanrequired

Whether there are previous pages available.

Error Response

Error Response

success
booleanrequired

Always false for errors.

error
objectrequired

Error details object.

error
code
stringrequired

Machine-readable error code.

Examples: invalid_request, authentication_failed, rate_limited

error
message
stringrequired

Human-readable error message.

error
details
object

Additional error context (validation errors, field-specific issues).

Props

name
stringrequired

The field name in the response.

type
stringrequired

Data type: string, number, boolean, object, array, null

required
boolean

Whether field is always present in responses.

deprecated
boolean

Mark field as deprecated.

default
string

Default value if field is null/absent.

pre
array

Labels displayed before the field name for nested structures.

post
array

Labels displayed after the field name.

children
ReactNoderequired

Description of the field. Supports Markdown.


Next, learn about the CodeGroup Component for displaying code in multiple languages.

Built with Chakra UI

On this page
OverviewBasic UsageComplete API Response ExamplePagination ResponseError ResponseProps