> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/core-features/intelligence-hub/generate-test-cases/smart-recording/ai-recording/api-test-case-creation.md). Agents can also search and read this documentation through its [MCP server](https://docs.walnutai.ai/~gitbook/mcp).

# API Test Case Creation

Creating an API test case in WalnutAI allows you to automate API workflows using **AI Recording**. Instead of capturing UI objects, XPaths, or other web elements, WalnutAI captures the **API requests and responses** generated during the workflow and converts them into automated test steps.

**Steps to Generate an API Test Case:**

* Navigate to the **Intelligence Hub**, select **Smart Recording**, and ensure the **Agent** is turned on.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FKv6HboeYjnA9aETgPMoR%2FScreenshot%202026-09-29%20at%206.17.43%E2%80%AFPM.png?alt=media&amp;token=4b6d30b7-b320-4a1c-8b3c-6745023a7148" alt=""><figcaption></figcaption></figure>

* Click the **AI Recording** button in the **bottom bar** and select the suitable **AI Recording** mode.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FcL4wZ6u26jMGNAkGovvY%2FScreenshot%202026-09-25%20at%201.09.09%E2%80%AFPM.png?alt=media&amp;token=dee7f980-ca4e-4a5a-b682-6b5a54c20fa2" alt=""><figcaption></figcaption></figure>

* Click the **Web** button in the bottom bar and select **API** as the test type.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2Fc1GypRclRlBb1vNwj8OS%2FScreenshot%202026-09-25%20at%201.42.58%E2%80%AFPM.png?alt=media&amp;token=9872f422-c095-43ca-b951-e67eee658069" alt=""><figcaption></figcaption></figure>

* Click the **Settings** icon in the bottom bar and configure the required [recording settings. ](#user-content-fn-1)[^1]

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FhR9s9hrgU1lrBrkCWI8v%2FScreenshot%202026-09-25%20at%201.51.45%E2%80%AFPM.png?alt=media&amp;token=93bc65e5-819c-4488-9916-2ad7ae06fe38" alt=""><figcaption></figcaption></figure>

* Enter the application URL and click **Connect**. Once connected, the application opens in the **Live Screen.**

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FMSKD9v9TkoIwaad007st%2FScreenshot%202026-09-25%20at%201.45.45%E2%80%AFPM.png?alt=media&amp;token=87c9f6ba-2c88-49b4-b1a1-e2273e39bee9" alt=""><figcaption></figcaption></figure>

* Describe the API workflow you want to automate in the chat panel. For example: *Log in to the application using valid credentials and retrieve the user details.*

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FTowug2TwjeQTqnCTatb9%2FScreenshot%202026-09-25%20at%201.47.48%E2%80%AFPM.png?alt=media&amp;token=53732a0b-f99a-4735-85f1-ae0ba035e6ae" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Use the **+** icon to add existing **test cases or custom methods** to the recording session. For more information, refer to [**Insert Test Cases and Custom Methods**.](https://docs.walnutai.ai/core-features/intelligence-hub/generate-test-cases/smart-recording/ai-recording/insert-test-cases-and-custom-methods.md)
{% endhint %}

* Click **Send**. The AI agent processes the instructions, performs the required workflow, and captures the **API requests and responses** involved in the flow. WalnutAI then generates the corresponding API test case with the required requests, parameters, headers, payloads, and validations.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FlDz91cIDmLj5EWjczX0g%2FScreenshot%202026-09-25%20at%201.48.12%E2%80%AFPM.png?alt=media&amp;token=13ca14c3-f4dd-4604-9528-34387726bfae" alt=""><figcaption></figcaption></figure>

* Click the **API Editor** icon to view and configure the API request details, including **headers, parameters, request body, response details, and assertions**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FbwLUeUHVtpUre6KPqQNS%2FScreenshot%202026-09-25%20at%208.55.06%E2%80%AFPM.png?alt=media&amp;token=d9e972ca-3ce0-40d6-b4c1-5cbf518413a0" alt=""><figcaption></figcaption></figure>

* Once the test case is generated, review and customize the API steps as required. You can **edit request details, modify parameters, skip a step, enable Continue on Failure, add a new step, add a nested test case, cancel a step, or** [**debug the test case**.](https://docs.walnutai.ai/core-features/intelligence-hub/generate-test-cases/smart-recording/debug-a-test-case-in-smart-recording.md)

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FFvqRGwshgvyeO9A3kclE%2FScreenshot%202026-08-12%20at%2012.30.07%E2%80%AFPM.png?alt=media&amp;token=e41ef560-7f81-4ded-95df-f4a83060576a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
For detailed information on modifying individual test steps, refer to  [**Manage a Test Step**.](https://docs.walnutai.ai/test-and-quality-management/test-management/test-cases/manage-test-step.md)
{% endhint %}

* On the Parameters tab, click **Chat with AI** to generate test data for the generated test case.
* You can execute test cases and heal failed test steps directly through the chat panel.
* Once you have completed the required modifications, click **Disconnect** to end the recording session. Then, click **Done** and **Save** to save the generated API test case.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FpHmjBxjl7euGXdfa4EHO%2FScreenshot%202026-09-25%20at%201.20.29%E2%80%AFPM.png?alt=media&amp;token=04c7961c-7fc2-49aa-88b6-4001f980cd8c" alt=""><figcaption></figcaption></figure>

[^1]: * **Live Screen:** Enable this to view the application interactions in real time while the AI agent performs the requested actions.
    * **Reuse Session:** Enable this to reuse an existing application session, including previously captured cookies, to avoid repeating authentication.
