> 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).

# 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** and select **Smart Recording**.
* Select **API** as the test type and configure the required settings. Ensure that the **Agent** is turned on.
* Enter the application URL and click **Connect**. The Live Screen opens, and the chat panel is enabled for recording the API workflow.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FoxZqlsLpCsrL0LlIb9D6%2FScreenshot%202026-08-12%20at%2012.12.16%E2%80%AFPM.png?alt=media&amp;token=5cd93447-8408-4a72-8df3-550d6935c3df" 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%2FCaCzQi9vSmpbDLeam7tm%2FScreenshot%202026-08-12%20at%2012.14.28%E2%80%AFPM.png?alt=media&amp;token=11bd9472-90ba-49ff-b856-d52bc59cbd9e" alt=""><figcaption></figcaption></figure>

* The AI agent processes the prompt, 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%2FTcekUI7bm4AqLY7DgTTP%2FScreenshot%202026-08-12%20at%2012.29.27%E2%80%AFPM.png?alt=media&amp;token=1a3da2c3-4c4d-4be7-9b42-a407c323c86b" 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, or cancel a step**.

<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**.](/test-and-quality-management/test-management/test-cases/manage-test-step.md)
{% endhint %}

* Once you have completed the required modifications, click **Disconnect** to end the recording session, and then click **Done**. Finally, click **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%2FTlkYG4o6ougCasiFjEAV%2FScreenshot%202026-08-12%20at%2012.30.34%E2%80%AFPM.png?alt=media&amp;token=4f0021e9-9889-4a89-ab23-69d322721670" alt=""><figcaption></figcaption></figure>
