---
title: "Add a test result to a run | Proxy Mail QA"
description: "Developer docs for Proxy Mail QA: the MCP server for coding agents, the REST API for test suites, and the Chrome extension."
url: https://proxymail.qa/docs/reference/operations/addtestresult
---

# Add a test result to a run

POST

/v1/runs/{run}/tests

```js
const url = 'https://api.proxymail.qa/v1/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/tests';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"example","status":"passed","duration_ms":1,"error":"example"}'
};

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

```sh
curl --request POST \
  --url https://api.proxymail.qa/v1/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/tests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "name": "example", "status": "passed", "duration_ms": 1, "error": "example" }'
```

From a test runner’s reporter: a failed or flaky test (its `name`, `status`, `duration_ms` and the start of its `error`), or the suite’s `totals`. A failed test fails the run. Send failed and flaky tests one by one, then the totals; the report shows the totals at the top and each failed test with what its emails did.

## Authorizations

- **[apiKey](https://proxymail.qa/docs/reference.html#apikey)**

## Parameters

### Path Parameters

**run**

required

string format: uuid

## Request Bodyrequired

Media typeapplication/json

One of:

- [object](https://proxymail.qa/docs/reference/operations/addtestresult#tab-panel-0-0)
- [object](https://proxymail.qa/docs/reference/operations/addtestresult#tab-panel-0-1)

### object

**name**

required

string

<= 200 characters

**status**

required

string

Allowed values: passed failed flaky skipped

**duration\_ms**

number

**error**

Its first three lines are kept, up to 300 characters, without terminal colours.

string

### object

**totals**

required

### object

**passed**

integer

**failed**

integer

**skipped**

integer

**flaky**

integer

## Responses

### 204

Added

### 400

An error

Media typeapplication/json

### object

**error**

string

**message**

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

### 404

An error

Media typeapplication/json

### object

**error**

string

**message**

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

### 409

An error

Media typeapplication/json

### object

**error**

string

**message**

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

[Previous Add a line of your own to a run](https://proxymail.qa/docs/reference/operations/addrunnote.html) [Next Finish a run](https://proxymail.qa/docs/reference/operations/finishrun.html)
