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_id here.

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 Product
  • test_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 methodWhen to useRequired field(s)
Web URLTesting a website or web appurl
Existing binary appMobile app already uploaded via Binary Appsbinary_app_id
Remote binary downloadMobile app hosted at a URL we should fetchfile_url
Inline binary uploadMobile app sent inline as base64file_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 environment
    • password (string, optional) — Password to access the test environment
    • access (string, optional) — Additional access information
    • proxy (boolean, optional, default: false) — Set true to route traffic through the test IO proxy
    • allow_orders (boolean, optional, default: false) — Allow testers to place orders and bookings
    • environment_test_information (object, optional) — Per-environment test guidance. See Environment test information

Access method fields:

  • url (string) — URL of the website or web app
  • binary_app_id (number) — ID of a binary app previously uploaded via Binary Apps. Note: providing binary_app_id alone is sufficient — do not also send url, file_url, or file_base_64
  • file_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 with file_name
  • file_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 of custom, access_claims
  • page_url (string, required) — Absolute http:// or https:// URL
  • description (string, optional, max 255 chars) — Free-form description

Sending environment_test_information as a plain string will be rejected — it must be an object with at least data_type and page_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 Product
  • test_environment_id (number, required) - ID of the Test Environment

Request Body:

Unlike create, no field is required on update. To rename an environment, send only title. To rotate credentials, send only username/password. You can also switch the access method (e.g. from url to binary_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 Product
  • test_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.

Previous
User Story Version Executions