> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://tester.army/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://tester.army/_mcp/server.

# Create a test

POST https://tester.army/api/v1/tests
Content-Type: application/json

Create a structured test definition for a project.

Reference: https://tester.army/docs/api-reference/tester-army-api/tests/create-a-test

## Authentication

- `Authorization` header (bearer token, required) — API key authentication using Bearer token format

## Request

### Body (application/json)

- `title` (string, required)
- `steps` (list of object or object or object or object or object or object or object, required)
  - object
    - `title` (string, required)
    - `type` (enum, required)
      - Allowed values: `act`
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - object
    - `title` (string, required)
    - `type` (enum, required)
      - Allowed values: `assert`
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - object
    - `title` (string, required)
    - `type` (enum, required)
      - Allowed values: `login`
    - `credentialId` (string, optional)
    - `temporaryEmail` (boolean, optional)
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - object
    - `title` (string, required)
    - `type` (enum, required)
      - Allowed values: `files`
    - `fileIds` (list of string, required)
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - object
    - `type` (enum, required)
      - Allowed values: `screenshot`
    - `title` (string, optional)
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - object
    - `type` (enum, required)
      - Allowed values: `javascript`
    - `code` (string, required) — JavaScript run in the browser page. Runs as an awaited function body; passes if it completes without throwing (returns nothing or \{ success: true }) and fails if it returns \{ success: false, reason } or throws. Web tests only.
    - `title` (string, optional)
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - object
    - `type` (enum, required)
      - Allowed values: `microphone`
    - `fileId` (string, required) — Project file ID (UUID) of the audio file (e.g. MP3) to play through the microphone. Empty string marks an unconfigured draft that must have a file attached before the test runs.
    - `mode` (enum, required) — blocking: the agent waits for playback to finish before continuing. loop: playback repeats until the run ends and the agent continues immediately. Web tests only.
      - Allowed values: `blocking`, `loop`
    - `title` (string, optional)
    - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
- `projectId` (string, required)
- `description` (string, optional)
- `groupId` (string, optional, nullable)
- `platform` (enum, optional)
  - Allowed values: `web`, `mobile`
- `settings` (object, optional)
  - `executionMode` (enum, optional) — deep uses a higher-effort model for complex steps.
    - Allowed values: `fast`, `deep`
  - `browserRegion` (enum, optional, nullable) — Per-test proxy exit region. null falls back to the project's region.
    - Allowed values: `eu`, `us`
  - `simulatorRegion` (enum, optional) — Region the simulator or emulator runs in. Mobile tests only.
    - Allowed values: `eu-north1`, `us-west1`
  - `viewport` (enum, optional, nullable) — Browser viewport preset: desktop (1280x800), desktop-hd (1920x1080), mobile (390x844), tablet (768x1024). null restores the default. Web tests only.
    - Allowed values: `desktop`, `desktop-hd`, `mobile`, `tablet`
  - `webSearchEnabled` (boolean, optional) — Allow the test to use internet search for factual checks.
  - `prepGroupId` (string, optional, nullable) — Group whose preparation test a solo run of this test uses.
- `enabled` (boolean, optional)

## Response

### 201

Test created

- `test` (object, required)
  - `id` (string, required)
  - `title` (string, required)
  - `steps` (list of object or object or object or object or object or object or object, required)
    - object
      - `title` (string, required)
      - `type` (enum, required)
        - Allowed values: `act`
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
    - object
      - `title` (string, required)
      - `type` (enum, required)
        - Allowed values: `assert`
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
    - object
      - `title` (string, required)
      - `type` (enum, required)
        - Allowed values: `login`
      - `credentialId` (string, optional)
      - `temporaryEmail` (boolean, optional)
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
    - object
      - `title` (string, required)
      - `type` (enum, required)
        - Allowed values: `files`
      - `fileIds` (list of string, required)
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
    - object
      - `type` (enum, required)
        - Allowed values: `screenshot`
      - `title` (string, optional)
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
    - object
      - `type` (enum, required)
        - Allowed values: `javascript`
      - `code` (string, required) — JavaScript run in the browser page. Runs as an awaited function body; passes if it completes without throwing (returns nothing or \{ success: true }) and fails if it returns \{ success: false, reason } or throws. Web tests only.
      - `title` (string, optional)
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
    - object
      - `type` (enum, required)
        - Allowed values: `microphone`
      - `fileId` (string, required) — Project file ID (UUID) of the audio file (e.g. MP3) to play through the microphone. Empty string marks an unconfigured draft that must have a file attached before the test runs.
      - `mode` (enum, required) — blocking: the agent waits for playback to finish before continuing. loop: playback repeats until the run ends and the agent continues immediately. Web tests only.
        - Allowed values: `blocking`, `loop`
      - `title` (string, optional)
      - `disabled` (boolean, optional) — When true, the step stays saved on the test but is skipped during runs.
  - `description` (string, optional, nullable)
  - `enabled` (boolean, optional)
  - `platform` (enum, optional)
    - Allowed values: `web`, `mobile`
  - `settings` (object, optional)
    - `executionMode` (enum, optional) — deep uses a higher-effort model for complex steps.
      - Allowed values: `fast`, `deep`
    - `browserRegion` (enum, optional, nullable) — Per-test proxy exit region. null falls back to the project's region.
      - Allowed values: `eu`, `us`
    - `simulatorRegion` (enum, optional) — Region the simulator or emulator runs in. Mobile tests only.
      - Allowed values: `eu-north1`, `us-west1`
    - `viewport` (enum, optional, nullable) — Browser viewport preset: desktop (1280x800), desktop-hd (1920x1080), mobile (390x844), tablet (768x1024). null restores the default. Web tests only.
      - Allowed values: `desktop`, `desktop-hd`, `mobile`, `tablet`
    - `webSearchEnabled` (boolean, optional) — Allow the test to use internet search for factual checks.
    - `prepGroupId` (string, optional, nullable) — Group whose preparation test a solo run of this test uses.
  - `projectId` (string, optional)
  - `projectUrl` (string, optional, nullable)
  - `projectName` (string, optional)
  - `createdAt` (datetime, optional)
  - `updatedAt` (datetime, optional)

## Examples

**Request**

```json
{
  "title": "string",
  "steps": [
    {
      "title": "string",
      "type": "act"
    }
  ],
  "projectId": "string"
}
```

**Response**

```json
{
  "test": {
    "id": "string",
    "title": "string",
    "steps": [
      {
        "title": "string",
        "type": "act",
        "disabled": true
      }
    ],
    "description": "string",
    "enabled": true,
    "platform": "web",
    "settings": {
      "executionMode": "fast",
      "browserRegion": "eu",
      "simulatorRegion": "eu-north1",
      "viewport": "desktop",
      "webSearchEnabled": true,
      "prepGroupId": "string"
    },
    "projectId": "string",
    "projectUrl": "string",
    "projectName": "string",
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://tester.army/api/v1/tests"

payload = {
    "title": "string",
    "steps": [
        {
            "title": "string",
            "type": "act"
        }
    ],
    "projectId": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://tester.army/api/v1/tests';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"title":"string","steps":[{"title":"string","type":"act"}],"projectId":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tester.army/api/v1/tests"

	payload := strings.NewReader("{\n  \"title\": \"string\",\n  \"steps\": [\n    {\n      \"title\": \"string\",\n      \"type\": \"act\"\n    }\n  ],\n  \"projectId\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://tester.army/api/v1/tests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"title\": \"string\",\n  \"steps\": [\n    {\n      \"title\": \"string\",\n      \"type\": \"act\"\n    }\n  ],\n  \"projectId\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://tester.army/api/v1/tests")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"title\": \"string\",\n  \"steps\": [\n    {\n      \"title\": \"string\",\n      \"type\": \"act\"\n    }\n  ],\n  \"projectId\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tester.army/api/v1/tests', [
  'body' => '{
  "title": "string",
  "steps": [
    {
      "title": "string",
      "type": "act"
    }
  ],
  "projectId": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://tester.army/api/v1/tests");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"title\": \"string\",\n  \"steps\": [\n    {\n      \"title\": \"string\",\n      \"type\": \"act\"\n    }\n  ],\n  \"projectId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "title": "string",
  "steps": [
    [
      "title": "string",
      "type": "act"
    ]
  ],
  "projectId": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://tester.army/api/v1/tests")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```