API Reference
Test Environments
Manage test environments for your products.
Prerequisites: You need a product before creating test environments. See Products to get or create a product. For mobile app tests, you may need to upload a binary app first (see Binary Apps).
Large files: For mobile apps larger than typical upload limits, use the direct upload URL flow in Binary Apps and then reference the resulting
binary_app_idhere.
List test environments
Retrieve all test environments for a specific product.
Endpoint: GET /products/{product_id}/test_environments
Parameters:
product_id(number, required) - ID of the Product
Example Request:
1curl -X GET "https://api.test.io/customer/v2/products/1/test_environments" \
2 -H "Authorization: Token YOUR_API_TOKEN"Response: 200 OK
Returns an array of test environment objects.
Get test environment
Retrieve a specific test environment by ID.
Endpoint: GET /products/{product_id}/test_environments/{test_environment_id}
Parameters:
product_id(number, required) - ID of the Producttest_environment_id(number, required) - ID of the Test Environment
Example Request:
1curl -X GET "https://api.test.io/customer/v2/products/1/test_environments/42" \
2 -H "Authorization: Token YOUR_API_TOKEN"Response: 200 OK
Returns the test environment object.
Create test environment
Create a new test environment.
Endpoint: POST /products/{product_id}/test_environments
Parameters:
product_id(number, required) - ID of the Product
Request Body:
test_environment(TestEnvironment Create, required) - Test environment objecttitle(string, required) - Title of the test environmenturl(string, optional) - URL of the website or appusername(string, optional) - Username to access the test environmentpassword(string, optional) - Password to access the test environmentaccess(string, optional) - Additional access informationproxy(boolean, optional, default: false) - Set true to use test IO proxyallow_orders(boolean, optional, default: false) - Allowing testers to place orders and bookingsbinary_app_id(number, optional) - ID of the binary appfile_url(string, optional) - URL of the app build to be downloadedfile_base_64(string, optional) - App file APK, IPA for mobile app tests encoded in base 64file_name(string, optional) - Name the app file APK, IPA for mobile app tests, required when file_base_64 is providedenvironment_test_information(EnvironmentTestInformation Create, optional) - Environment test information
Example Request:
1curl -X POST "https://api.test.io/customer/v2/products/1/test_environments" \
2 -H "Authorization: Token YOUR_API_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "test_environment": {
6 "title": "Staging Environment",
7 "url": "https://staging.example.com",
8 "username": "tester",
9 "password": "secret",
10 "access": "VPN required",
11 "allow_orders": false
12 }
13 }'Response: 201 Created
Returns the created test environment object.
Update test environment
Update an existing test environment.
Endpoint: PUT /products/{product_id}/test_environments/{test_environment_id}
Parameters:
product_id(number, required) - ID of the Producttest_environment_id(number, required) - ID of the Test Environment
Request Body:
test_environment(TestEnvironment Create, required) - Test environment object (same structure as create)
Example Request:
1curl -X PUT "https://api.test.io/customer/v2/products/1/test_environments/42" \
2 -H "Authorization: Token YOUR_API_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "test_environment": {
6 "title": "Updated Staging Environment",
7 "url": "https://staging-updated.example.com"
8 }
9 }'Response: 200 OK
Returns the updated test environment object.
Delete test environment
Delete a test environment.
Endpoint: DELETE /products/{product_id}/test_environments/{test_environment_id}
Parameters:
product_id(number, required) - ID of the Producttest_environment_id(number, required) - ID of the Test Environment
Example Request:
1curl -X DELETE "https://api.test.io/customer/v2/products/1/test_environments/42" \
2 -H "Authorization: Token YOUR_API_TOKEN"Response: 200 OK
Returns the deleted test environment object.