Response Field - Documentation.AI

Response Field

Reference for documenting API response fields with types, requirements, and status indicators.

Overview

The ResponseField component documents the fields returned by your API responses. It shows:

You can use ResponseField in two ways:

ResponseField is similar to ParamField but specifically designed for documenting API response bodies and returned data structures.

Using with Web Editor

Add a ResponseField block

  1. Place your cursor where you want to describe a response field.
  2. Type / to open the command menu and search for Response Field.
  3. Select Response Field to insert the component.

A new response field row appears with a default name and type plus a description placeholder.

ResponseField block in the Web Editor

Prefer writing in code?

You can switch to MDX view inside the Web Editor to write or edit this component using the same syntax as the Code Editor. This is useful if you want full control while staying in the Web Editor.

Edit field metadata

To change the label and status:

  1. Click the three-dot menu on the right side of the ResponseField block.
  2. In the Response Field settings panel, you can edit:

Click Save to apply your changes.

Edit the description

Using with Code Editor

Basic syntax

Use the <ResponseField> component to document API response fields with their type and status.

<ResponseField name="id" field-type="string" required="true">
  Unique identifier for the resource.
</ResponseField>

idstring

Required

Unique identifier for the resource.

Examples

Optional field

<ResponseField name="description" field-type="string">
  Optional description text for the resource.
</ResponseField>

descriptionstring

Optional description text for the resource.

Deprecated field

<ResponseField name="legacy_id" field-type="integer" deprecated="true">
  Deprecated legacy identifier. Use `id` instead.
</ResponseField>

legacy_idinteger

Deprecated

Deprecated legacy identifier. Use id instead.

Complex type

<ResponseField name="user" field-type="object" required="true">
  User object containing profile information and preferences.
</ResponseField>

userobject

Required

User object containing profile information and preferences.

Advanced options

Attributes

[path

namestring](/content/docs/components/responsefield#path-name/index.html)

Field name displayed in the response documentation (default: "response").

[path

field-typestring](/content/docs/components/responsefield#path-field-type/index.html)

Data type: string, integer, boolean, object, array, etc.

[path

requiredstring](/content/docs/components/responsefield#path-required/index.html)

Set to "true" for required fields (default: "false").

[path

deprecatedstring](/content/docs/components/responsefield#path-deprecated/index.html)

Set to "true" to mark as deprecated (default: "false").