Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions api-playground/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

The playground is automatically generated from your OpenAPI specification or AsyncAPI schema so any updates to your API are automatically reflected in the playground. You can also manually create API reference pages after defining a base URL and authentication method in your `docs.json`.

The playground supports rich media responses including images, audio, and video content. When your API returns media content types, the playground automatically renders them inline for immediate preview.

We recommend generating your API playground from an OpenAPI specification. See [OpenAPI Setup](/api-playground/openapi-setup) for more information on creating your OpenAPI document.

Check warning on line 19 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L19

Try to avoid using first-person plural like 'We'.

## Getting started

Expand Down Expand Up @@ -78,7 +80,7 @@
<Expandable title="playground" defaultOpen="True">
<ResponseField name="display" type="&quot;interactive&quot; | &quot;simple&quot; | &quot;none&quot;">
The display mode of the API playground.
- `"interactive"`: Display the interactive playground.

Check warning on line 83 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L83

': D' should be in lowercase.
- `"simple"`: Display a copyable endpoint with no playground.
- `"none"`: Display nothing.

Expand Down Expand Up @@ -124,7 +126,7 @@
}
```

This example configures the API playground to be interactive with example code snippets for cURL, Python, and JavaScript. Only required parameters are shown in the code snippets, and the playground prefills the request body with example values.

Check warning on line 129 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L129

In general, use active voice instead of passive voice ('are shown').

Check warning on line 129 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L129

Did you really mean 'prefills'?

### Custom endpoint pages

Expand All @@ -136,12 +138,39 @@
- Add additional content like examples
- Control playground behavior per page

The `x-mint` extension is recommended so that all of your API documentation is automatically generated from your OpenAPI specification and maintained in one file.

Check warning on line 141 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L141

In general, use active voice instead of passive voice ('is recommended').

Individual `MDX` pages are recommended for small APIs or when you want to experiment with changes on a per-page basis.

Check warning on line 143 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L143

In general, use active voice instead of passive voice ('are recommended').

For more information, see [x-mint extension](/api-playground/openapi-setup#x-mint-extension) and [MDX Setup](/api-playground/mdx/configuration).

## Media responses

The API playground automatically detects and renders media content types in responses:

- **Images** (`image/*`) - Display inline with full resolution

Check warning on line 151 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L151

Use parentheses judiciously.
- **Audio** (`audio/*`) - Playable audio player with controls

Check warning on line 152 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L152

Use parentheses judiciously.
- **Video** (`video/*`) - Embedded video player with controls

Check warning on line 153 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L153

Use parentheses judiciously.

When your API returns a response with a media content type, the playground renders it directly in the response panel. This allows users to immediately preview generated images, audio files, or video content without downloading.

Check warning on line 155 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L155

Use 'media type' instead of 'content type'.

### Example

If your API endpoint returns a video, ensure your OpenAPI specification includes the appropriate content type:

Check warning on line 159 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L159

Use 'media type' instead of 'content type'.

```yaml
responses:
"200":
description: Generated video
content:
video/mp4:
schema:
type: string
format: binary
```

The playground will automatically render the video with playback controls when the endpoint is called.

Check warning on line 172 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L172

Avoid using 'will'.

Check warning on line 172 in api-playground/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/overview.mdx#L172

In general, use active voice instead of passive voice ('is called').

## Further reading

- [AsyncAPI Setup](/api-playground/asyncapi/setup) for more information on creating your AsyncAPI schema to generate WebSocket reference pages.