Skip to content
Open
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
26 changes: 26 additions & 0 deletions api-playground/multiple-responses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

If your API returns different responses based on input parameters, user context, or other conditions of the request, you can document multiple response examples with the `examples` property.

This property can be added to any response and has the following schema.

Check warning on line 9 in api-playground/multiple-responses.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/multiple-responses.mdx#L9

In general, use active voice instead of passive voice ('be added').

```yaml
responses:
Expand All @@ -30,3 +30,29 @@
currencyCode: "GBP"
taxRate: 0.20
```

## Audio response examples

For endpoints that return audio files, you can provide a URL to an audio file in the `examples` property. The API playground will render an interactive audio player instead of a code snippet.

Check warning on line 36 in api-playground/multiple-responses.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/multiple-responses.mdx#L36

Avoid using 'will'.

To configure audio response examples:

1. Set the content type to an `audio/*` media type (e.g., `audio/mpeg`, `audio/wav`, `audio/ogg`)

Check warning on line 40 in api-playground/multiple-responses.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/multiple-responses.mdx#L40

Use 'for example' instead of 'e.g.'.
2. Provide a valid URL to an audio file as the example value

```yaml
responses:
"200":
description: Audio file generated successfully
content:
audio/mpeg:
schema:
type: string
format: binary
examples:
sample:
summary: Sample audio output
value: "https://example.com/sample-audio.mp3"
```

The audio URL will be embedded in an HTML audio player, allowing users to play the example directly in the documentation.

Check warning on line 58 in api-playground/multiple-responses.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/multiple-responses.mdx#L58

Avoid using 'will'.

Check warning on line 58 in api-playground/multiple-responses.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/multiple-responses.mdx#L58

In general, use active voice instead of passive voice ('be embedded').