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
Access methods
A test environment must have exactly one access method. Pick the one that fits your case and provide only its fields — combining fields from different access methods will be rejected.
| Access method | When to use | Required field(s) |
|---|---|---|
| Web URL | Testing a website or web app | url |
| Existing binary app | Mobile app already uploaded via Binary Apps | binary_app_id |
| Remote binary download | Mobile app hosted at a URL we should fetch | file_url |
| Inline binary upload | Mobile app sent inline as base64 | file_base_64 + file_name |
Request body
test_environment(object, required)title(string, required) — Title of the test environment- One access method from the table above (see field details below)
username(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) — Settrueto route traffic through the test IO proxyallow_orders(boolean, optional, default:false) — Allow testers to place orders and bookingsenvironment_test_information(object, optional) — Per-environment test guidance. See Environment test information
Access method fields:
url(string) — URL of the website or web appbinary_app_id(number) — ID of a binary app previously uploaded via Binary Apps. Note: providingbinary_app_idalone is sufficient — do not also sendurl,file_url, orfile_base_64file_url(string) — URL we will download the app build from (APK, IPA, etc.)file_base_64(string) — App file (APK, IPA, …) encoded in base64. Must be sent together withfile_namefile_name(string) — File name for the base64 upload (e.g.app-release.apk)
Environment test information
Optional structured guidance attached to the environment. When provided, it must be an object with these fields:
data_type(string, required) — One ofcustom,access_claimspage_url(string, required) — Absolutehttp://orhttps://URLdescription(string, optional, max 255 chars) — Free-form description
Sending
environment_test_informationas a plain string will be rejected — it must be an object with at leastdata_typeandpage_url.
Example: Web URL
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 }'Example: Existing binary app
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": "Android build 47",
7 "binary_app_id": 47
8 }
9 }'Example: With environment test information
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 with login flow",
7 "url": "https://staging.example.com",
8 "environment_test_information": {
9 "data_type": "custom",
10 "page_url": "https://staging.example.com/login",
11 "description": "Use the seeded test accounts on this page"
12 }
13 }
14 }'Response: 201 Created — Returns the created test environment object.
Update test environment
Update an existing test environment. Partial updates are supported: send only the fields you want to change, and everything else is preserved.
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(object, required) — Any subset of the fields documented under Create test environment
Unlike create, no field is required on update. To rename an environment, send only
title. To rotate credentials, send onlyusername/password. You can also switch the access method (e.g. fromurltobinary_app_id) by sending the new access field.
Example: Rename only
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 }
8 }'Example: Update URL
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 "url": "https://staging-v2.example.com"
7 }
8 }'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.