--- title: "Creating API Tests" slug: "creating-api-tests" description: "Learn how to test API module configurations in Unqork, ensuring correct execution sequences and accurate responses with our comprehensive guide." updated: 2026-04-27T18:18:06Z published: 2026-04-27T18:18:06Z canonical: "docs.unqork.io/creating-api-tests" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.unqork.io/llms.txt > Use this file to discover all available pages before exploring further. # Creating API Tests This article covers the different ways to **test API** module configurations at Unqork. You can run a test to: - Confirm the execution sequence of your API call is correct. - Verify that the expected API response is correct. - Verify that specific data field responses match your criteria. To set up these tests, use [Unqork's Testing tool](/v1/docs/testing-tool). After configuration, the tests run automatically whenever the module is saved. You can also manually execute them, or use the tool to edit, delete, and monitor all your API module tests. > To learn more about API specifications, see [API Specification Snippet](/v1/docs/api-specification-snippet). ## What Is an API Test? API tests test your API modules. The following table describes the different types of tests: | API Test | Description | | --- | --- | | Execution Sequence | This test monitors the execution sequence of your module. A successful test confirms that all your components trigger in the correct order. After executing the test, an Event Log displays. It lists the components and their events at each step of the execution sequence. This resembles what you see on the Server Side Execution Testing page. > To learn more about the Server Side Execution Testing page, view our [Server Side Execution Testing](/v1/docs/how-to-use-the-server-side-execution-testing-page) article. | | Match Response | This test compares the JSON of the expected API response against the actual API response. Both match when the test passes. | | Validate Fields | This test lets you enter a specific data field to test. Set up criteria for that field and verify the response meets them. Validation types include: - **Exists**: Confirms the data field you entered exists somewhere in your API response. - **Size**: Confirms the size of the data field you entered. For example, if you expect your data field to be an array of 100 rows, enter 100 in the Size field. - **Value**: Confirms the expected value for your data field is correct. | You can only select modules that follow Unqork's API specifications. Once you find an API module, you can set up an API test. > [!WARNING] > You can only select modules that follow Unqork's API specifications. Once you find an API module, you can set up an API test. > To learn more about API specification, refer to [API Specification Snippet](/v1/docs/api-specification-snippet) article. ## Create API Tests for Multiple Modules If your application involves multiple API modules, set up API tests to ensure all those API calls work correctly. The Testing tool lets you create bulk Execution Sequence and Match Response API tests on all your API modules. These tests verify that responses are accurate and firing sequences are correct. To create API tests for multiple modules: 1. Open the Testing tool. 2. Click **Create Bulk API Tests**. The **Bulk API Test Creator** dashboard displays test options, filters, and a table of all your environment's API modules. By default, the table only displays API modules without tests. This makes it easier to find API modules that need tests. ### Navigating the Bulk API Test Creator Dashboard By default, the test name is **Created by Bulk Test Creator**. Click the **Test Name** field to rename the test. The **Execution Sequence** test is the default in **API Test Types to Create** and is recommended for all API modules. You can deselect it and select **Match Response** instead, or select both. ![Interface for creating bulk API tests with selected modules and execution options.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Testing_Bulk_Create_01.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) By default, every API module in the **Selected** **Module****s for Test Creation** table uses your selected test(s). To run tests on specific modules, use the dashboard's filters. ![Interface for creating bulk API tests with selected modules and execution options.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Testing_Bulk_Create_03.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) These are the available filter options: | Filter | Description | | --- | --- | | Workspaces | Use this drop-down to filter API modules from one or more workspaces. > [!NOTE] > If you clicked **Create Bulk API Tests** from the Testing Workspace Dashboard, this drop-down auto-populates with your workspace. | | Apps | Use this drop-down to filter API modules from one or more applications. > [!NOTE] > If you clicked **Create Bulk API Tests** from the Testing App Dashboard, this drop-down auto-populates with your Application. | | Modules | Use this drop-down to filter specific modules. | | Reset Filters | Click to reset the filters. | | Include Modules with Tests | Select this checkbox to see all environment API modules with tests. You'll also see the modules that don't have tests. > [!NOTE] > By default, this checkbox is clear, so you only see environment API modules without tests. | When you filter API modules, the matching modules populate the **Selected Modules for Test Creation** table. Tests only run on modules in this table. The table displays up to 10 modules by default. Click the pagination at the bottom to see more modules. ![Interface for creating bulk API tests with selected modules and execution options.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Testing_Bulk_Create_04.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) Here's the information in the table: | Attribute | Description | | --- | --- | | Workspace | The workspace where your selected module exists. | | App | The application where your selected module exists. | | Module Name | The selected module's name. | | Module ID | The selected module's unique identifier. | | Test Status | Displays whether the selected module has a test. Tested modules have a checkmark in this column. | | Module Dashboard Button | Click this button to view the selected module in the Testing Module Dashboard. | ### Creating an API Test If your API modules have service logs, the test(s) runs on the most recent one. To create a test: 1. In the **Test Name** field, enter a test name, or keep the default value. 2. From the **API Test Types to Create** options, select one or both of the tests. 3. Use the dashboard's filters to find and display only the API modules you want to test. 4. At the top right of the page, click **Create Tests**. ![Interface for creating bulk API tests with selected modules and execution options.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Testing_Bulk_Create_02.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) 5. Click **OK** to confirm you want to run your test(s) on those selected modules. 6. Click **OK** in the modal to return to the Bulk API Test Creator. > [!NOTE] > If an API module has service logs, a checkmark displays in the **Test Status** column. If no service logs exist, the **Test Status** displays `No Log Found`. To generate service logs, return to the module and execute it. Once service logs are available, you can create tests for the module. ## Create API Tests for a Single Module To create one or more API tests for a single module: 1. Open the Testing tool. 2. Click **Create Single API Test**. 3. From the **Module** drop-down, select an API module. > [!NOTE] > To view the module in the Module Builder, click the **View Module in Designer** link. #### Selecting Recent Service Log API Request Data If your module has recent service logs, these details populate automatically: - The most recent service log timestamp (Recent Service Logs). - The service log ID (Service Log ID). - The log's API request (Request). - The log's API response (Response). > [!TIP] > To view a different service log, select it from the **Recent Service Logs** drop-down. Then click **View Service Logs Dashboard** for more details. ![Creating a new API test with service log details and response data displayed.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Unit_Test_11.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) #### Manually Entering API Request Data If no service logs exist, you must enter your API request manually. After selecting a module to test: 1. Set **Enter JSON Manually** as the **Request / Response Data**. > [!NOTE] > This is the default setting if no service logs exist for this module. 2. In the **Request** field, enter your API request JSON. 3. Below the **Request** field, click **Response**. API response data displays in the Response field. ### Creating an API Test With an API module selected, you're ready to create an API test. 1. At the bottom of the page, click **Add Test**. 2. In the **Test Name** field, enter a unique test name. 3. Select a **Test Type**. Depending on the Test Type, different information displays on the page. Here are the fields you see for each test. | Test | Test Description | | --- | --- | | Execution Sequence | **Request**: The tested API request displays in the Request field. **Event Log**: This log displays the full sequence of your API call, including the components and events that occurred. | | Match Response | **Request**: The tested API request displays in the Request field. **Expected Response**: This field displays the expected API response for your API module. | | Validate Fields | **Request**: The tested API request displays in the Request field. **Test Details**: The field where you enter the data and the criteria to test. | Below is an example of the **Execution Sequence** Test Type. ![API test interface showing event log and response details for execution sequence.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Unit_Test_14.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) #### Using the Validate Fields Test Type Under Test Types, **Validate Fields** requires additional information. After selecting **Validate Fields**, the following options display: | Attribute | Description | | --- | --- | | Data Field | The data field you want to test. | | Validation Type | The type of validation you want to test. The options include Exists, Size, and Value. | | Exists | Confirms the data field you entered exists somewhere in your API response. | | Size | Confirms the size of the data field you entered. For example, if you expect your data field to be an array of 100 rows, enter 100 in the Size field. | | Value | Confirms the expected value for your data field is correct. | | Condition | This drop-down only displays if you select the **Size** or **Value** Validation Types. | | Equals | Checks if the Size or Value you entered equals the Data Field. | | Contains | Checks if the Size or Value you entered is part of the Data Field. | | Is Greater Than | Checks whether the Data Field is greater than the Size or Value entered. | | Is Less Than | Checks whether the Data Field is less than the Size or Value entered. | | Not Equal To | Checks if the Size or Value you entered doesn't equal the Data Field. | | Value | The size or value you want to test when you select the Size or Value Validation Type. | | + Add Button | Click this button to set up the API test. | Here's how to use the **Validate Fields** type: 1. In the **Test Name** field, enter a unique test name. 2. Select a **Test Type**. 3. In the **Data Field**, enter a specific data field. > [!NOTE] > Examples of data fields include `key` and `array.0.key`. 4. Select a **Validation Type**. If you select **Size**: If you select **Value**: ![API test configuration screen showing validation details for specific data fields.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Unit_Test_15.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) 1. From the **Condition** drop-down, select a condition. 2. In the **Size** field, enter the size of the array. 1. From the **Condition** drop-down, select a condition. 2. In the **Value** field, enter the response value for your data field. 5. Click **+ Add**. > [!NOTE] > Repeat these steps to add more validations. You can add as many validations as needed. 6. Click **Save**. The previous test page displays. Your new tests display at the bottom of the page. Click **Create Test** to run your tests. These tests also run every time you save your module. Below is an example of what you might see: ![Creating a new API test with details and recent service logs displayed.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Unit_Test_16.jpg?sv=2026-02-06&spr=https&st=2026-11-09T16%3A59%3A08Z&se=2026-11-09T17%3A59%3A08Z&sr=c&sp=r&sig=hANbqYivygB%2FSOd4P6r6m3VUvMriGem8Z0UCgmEw1PI%3D) APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. Triggers activate another component when certain requirements are met. Trigger types include Concurrent, Post, and Error. Some components do not have the ability to trigger others. DOM (Document Object Model) events are signals or notifications that something has occurred or is occurring within a web page, often triggered by user interactions or by the browser itself. These events allow JavaScript to react to changes and interactions on a web page, making it dynamic and interactive. DOM (Document Object Model) events are signals or notifications that something has occurred or is occurring within a web page, often triggered by user interactions or by the browser itself. These events allow JavaScript to react to changes and interactions on a web page, making it dynamic and interactive. JSON (JavaScript Object Notation) is an open standard file and data interchange format. Unqork uses JSON for submission (record) data. An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects. In Unqork an application is a program used to perform specific tasks. An application can be one of two types: workflow or module. A definition Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. In Unqork an application is a program used to perform specific tasks. An application can be one of two types: workflow or module. Pagination is the process of separating content into individual pages. A modal is a window that appears on top of the content you are currently viewing. A key-value pair is a fundamental data structure where a unique "key" is associated with a specific "value," used for organizing and retrieving data efficiently, like in dictionaries or databases.