> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testbrick.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Flow Testing

> Visual API flow testing — chain requests, map data, test email flows

# API Flow Testing

API flow testing lets you build multi-step API tests on a visual canvas. Connect blocks, pass data between requests, and see results in real-time.

## Why API flows?

Real API workflows aren't single requests. It's: create a user → verify email → get auth token → create data → verify it saved. Each request depends on the one before it.

TestBrick lets you build these flows visually — no code, no scripting.

## Core concepts

| Concept          | Description                                                                |
| ---------------- | -------------------------------------------------------------------------- |
| **Blocks**       | Individual steps in your flow — API requests, email blocks, or delays      |
| **Canvas**       | The visual workspace where you arrange and connect blocks                  |
| **Edges**        | Lines connecting blocks that show data flow                                |
| **Side panel**   | Click any block to configure it — set URL, headers, body, auth, assertions |
| **Environments** | Reusable variables (baseUrl, apiKey) that you switch between               |
| **Data mapping** | Reference data from previous blocks using `{{variables}}`                  |

## Block types

<CardGroup cols={3}>
  <Card title="API Request" icon="globe">
    Make HTTP requests — GET, POST, PUT, PATCH, DELETE. Configure headers, body, auth, and assertions.
  </Card>

  <Card title="Email" icon="envelope">
    Wait for emails, extract OTP codes or verification links, and assert email content. **Pro feature.**
  </Card>

  <Card title="Delay" icon="clock">
    Pause the flow for a specified number of seconds. Useful for rate-limited APIs.
  </Card>
</CardGroup>

## Example flow

A typical OTP verification flow:

```
[POST /auth/login]          → Send login request, triggers OTP email
        ↓
[Email Block]               → Wait for email, extract 6-digit OTP
        ↓
[POST /auth/verify-otp]     → Verify OTP using extracted code
        ↓
[GET /profile]              → Fetch profile using auth token
        ↓
[PATCH /profile]            → Update profile data
```

Each block passes data to the next — the OTP from the email block flows into the verify request, the auth token flows into profile requests.
