Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"pages": [
"general/api-client/design-apis",
"general/api-client/api-collections",
"general/api-client/examples",
{
"group": "Import & Export APIs",
"pages": [
Expand Down
113 changes: 113 additions & 0 deletions general/api-client/examples.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: "Request Examples"
label: "Request Examples"
slug: "examples"
description: "Save, manage, and reuse request examples in Requestly. Create snapshots of your API requests with different configurations for quick reuse."
seoTitle: "Request Examples"
seoDescription: "Save, manage, and reuse request examples in Requestly. Create snapshots of your API requests with different configurations for quick reuse."

Check warning on line 7 in general/api-client/examples.mdx

View check run for this annotation

Mintlify / Mintlify Validation (requestly) - vale-spellcheck

general/api-client/examples.mdx#L7

Did you really mean 'Requestly'?
visibility: "PUBLIC"
---

Request Examples allow you to save reusable snapshots of an API request with specific configurations such as parameters, headers, and body payloads. This makes it easy to switch between different variations of the same request without modifying the original.

Examples are stored under their parent request and are accessible from the sidebar for quick navigation.

## Why Use Request Examples

- **Test multiple scenarios**\
Save different configurations like valid inputs, edge cases, and error states, and switch between them instantly.
- **Collaborate with your team**\
Examples are shared within your workspace so others can view and use the exact configurations.
- **Retain request and response data**\
Each example stores both the request and its response, making it easy to revisit past executions.

## Save a request as an example

You can create an example from any HTTP or GraphQL request that has been sent at least once.

<Steps>
<Step title="Open a request">
Navigate to an existing API request in your workspace or send a new request.
</Step>
<Step title="Save as example">
Click the **Save** dropdown in the request view and select **Save as Example**. \
This stores the current configuration including URL, method, headers, parameters, and body.

<Frame>
![Save Examplesinrequestly](/images/SaveExamplesinrequestly.png)
</Frame>
</Step>
<Step title="View the example">
The example opens in a new tab. The parent request in the sidebar expands to show the newly created example beneath it.

<Frame>
![View Examples](/images/ViewExamples.png)
</Frame>
</Step>
</Steps>

<Tip>
You can also save examples from the request's context menu in the sidebar by right-clicking the request and selecting the save option.
</Tip>

## Manage examples in the sidebar

Examples appear as collapsible children under their parent request in the sidebar. Click the expand arrow next to any request to reveal its examples.

### Open an example

Click on an example in the sidebar to open it in a new tab. The example loads with the saved request configuration and response data.

<Frame>
![Openanexample](/images/Openanexample.png)
</Frame>

### Rename an example

Right-click the example in the sidebar and select **Rename**, or double-click the example name. Type the new name and press **Enter** to save.

<Frame>
![Renameanexample](/images/Renameanexample.png)
</Frame>

### Duplicate an example

Right-click the example in the sidebar and select **Duplicate**. A copy of the example is created under the same parent request.

<Frame>
![Duplicateanexample](/images/Duplicateanexample.png)
</Frame>

### Delete an example

Right-click the example in the sidebar and select **Delete**. Confirm the action in the prompt that appears.

<Frame>
![Deleteanexample](/images/Deleteanexample.png)
</Frame>

<Warning>
Deleting an example is permanent and cannot be undone.
</Warning>

## Use an example as a template

When viewing an example, click **Use as Template** to load its configuration into a new draft request. This lets you start a new request based on an existing example without modifying the original.

<Frame>
![Useanexampleasatemplate](/images/Useanexampleasatemplate.png)
</Frame>

## What's next?

<CardGroup cols={3}>
<Card icon="folder" href="/general/api-client/api-collections" title="API Collections">
Organize your requests into collections and folders
</Card>
<Card icon="brackets-curly" href="/general/api-client/environments-and-variables" title="Variables">
Use variables to make requests reusable across environments
</Card>
<Card icon="code" href="/general/api-client/scripts" title="Scripts & Tests">
Add pre-request scripts and tests to automate your workflow
</Card>
</CardGroup>
Binary file added images/Deleteanexample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Duplicateanexample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Renameanexample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/SaveExamplesinrequestly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Useanexampleasatemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ViewExamples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.