Use fields to document API parameters and responses. There are two types of fields: parameter fields and response fields.

Parameter field

The <ParamField> component is used to define parameters for your APIs or SDKs. Adding a ParamField automatically adds an API Playground.

param
string
required

An example of a parameter field

<ParamField path="param" type="string" required>
  An example of a parameter field
</ParamField>

Properties

query, path, body, or header
string

Whether the parameter is a query, path, body, or header. Followed by the parameter name.

type
string

Expected type of the parameter’s value.

Supports number, string, boolean, object.

Arrays can be defined using the [] suffix. For example, string[].

required
boolean

Indicate whether the parameter is required.

deprecated
boolean

Indicate whether the parameter is deprecated.

default
string

Default value used by the server if the request does not provide a value.

initialValue
any

Value that will be used to initialize the playground.

placeholder
string

Placeholder text for the input in the playground.

children
string

Description of the parameter (Markdown-enabled).

Response field

The <ResponseField> component defines the return values of an API.

response
string
required

An example of a response field

<ResponseField name="response" type="string" required>
  A response field example
</ResponseField>

Properties

name
string
required

The name of the response value.

type
string
required

Expected type of the response value. This can be any arbitrary string.

default
string

The default value.

required
boolean

Indicate whether the response is required.

deprecated
boolean

Whether a field is deprecated.

pre
string[]

Labels that are shown before the name of the field.

post
string[]

Labels that are shown after the name of the field.