To test an API as the primary system under test, create an API
application. Its dedicated agent can make
multiple requests, execute validation code, and produce an API-focused trace.
Use an API Key config for secret tokens, or Custom
Fields for
non-secret test data.
What Can You Do With API Calls?
- Fetch test data or credentials from your backend before testing UI workflows
- Authenticate via API to get tokens or sessions for protected pages
- Validate data by checking API responses match what you expect
Setup: Creating an API Call Config
API Calls are configured as Configs in your project settings. The URL and request details are stored in the config, so you can easily reuse them across multiple web or mobile tests.1
Open Config Settings
Navigate to Settings → Configs in your project dashboard, then click
Add config and select API Call Configuration.
2
Fill the Configuration Form
Complete the form fields:
Enter at least one of URL, Headers, or Body.
3
Save and Assign to Tests
Click Save to create the configuration. You can then assign this config
to a web or mobile test in its Settings → Configs panel.
The Headers field must contain valid JSON. The Body field accepts the
text payload required by the target API.
Configuration Examples
Example 1: GET Request with Authentication
This example shows how to fetch user data with an API key. Fill the form fields:
In the Headers textarea:
Example 2: POST Request with Body
This example shows how to send data to your API. Fill the form fields:
In the Headers textarea:
Viewing API Results
When a test runs, you can inspect the full details of every API call made by the agent.- Open the Run Details page for your test.
- In the Action Log (the trace view on the left), click on the step where the API call occurred.
- Select the network icon in the detail panel.
Available Details
The API Request view provides a comprehensive breakdown:- Summary: Method (color-coded), Status Code, and URL path.
- Copy as cURL: A button to copy a debugging command for the request. Sensitive header values may be masked.
- Request Details:
- Query Parameters: Parsed list of URL parameters.
- Headers: Full list of request headers.
- Body: The JSON or text body sent.
- Response Details:
- Headers: Response headers received from the server.
- Body: The full JSON or text response.
Overriding Config Values
You can instruct the agent to change a path, ID, method, or body at runtime. Treat this as a natural-language instruction, not a deterministic template substitution. Example:- Config:
Get Userwith URLhttps://api.example.com/users/1 - Test step: “Use the Get User config to request
/users/555from the same API host.”
Response Format for the Agent
The agent receives the API response in a structured format it can understand and use in subsequent steps:- Extract data: “Get the email from the API response and type it into the login form.”
- Verify success: “Check that the API returned status 200.”
Limitations
- No Variables: Headers and bodies are stored values unless the agent changes them from natural-language test instructions.
- Network Access: Without an SSH tunnel, the target must be publicly accessible or allow QA.tech IPs.