# Create a test result

`POST /api/v1/test-results`

Called by the mobilewright reporter once a test run completes. Returns the created record including its id, which is used for subsequent asset uploads. The result is filed under the organization the API key is bound to, or the X-Organization-Id header, otherwise the caller's default organization.

**Header parameters**

| Name                | Type    | Required | Description                                                                                                               |
| ------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| `X-Organization-Id` | integer | no       | Selects which of the caller's organizations the request acts on. When omitted, the caller's default organization is used. |

**Request body** (application/json)

| Field       | Type   | Required | Description                           |
| ----------- | ------ | -------- | ------------------------------------- |
| `name`      | string | yes      | Human-readable name for this test run |
| `userAgent` | string | yes      | Reporter name and version             |

**Example request**

```
curl https://api.mobilenexthq.com/api/v1/test-results \

  -X POST \

  -H 'Authorization: Bearer mob_...' \

  -H 'Content-Type: application/json' \

  -d '{"name":"Smoke suite","userAgent":"mobilewright/0.0.39"}'
```

**Responses**

**201** — Test result created

```
{

  "id": "string",

  "name": "Smoke suite",

  "userAgent": "mobilewright/0.0.39",

  "createdAt": "2026-01-01T00:00:00Z"

}
```

**400** — Invalid request body

```
{

  "error": {

    "code": "string",

    "message": "string"

  }

}
```

**401** — Missing or invalid Bearer token

```
{

  "error": {

    "code": "string",

    "message": "string"

  }

}
```
