---
title: "Complete test runs by specifying a list of key fields and values or a list of test run ids"
method: POST
path: "/atm-testrun/complete"
tags: ["AutomationTestRun"]
---

# Complete test runs by specifying a list of key fields and values or a list of test run ids

`POST /atm-testrun/complete`

## Request

- Base URL: `https://app.testiny.io/api/v1`
- URL: `https://app.testiny.io/api/v1/atm-testrun/complete`
- Auth: API key in header `X-Api-Key`
- TypeScript: <https://skmtc.dev/testiny/apis/testiny-api/docs/atm-testrun/complete/post.ts> (a function with typed inputs; its response is checked against the schema)

Given a list of key field/value pairs, all runs matching these key values will be completed, otherwise runs with specified run ids will be completed.

## Request body

- union
  - object
    - `from` 'runIds', required
    - `projectId` number, required: Project id of the runs
    - `runIds` integer[], required: List of run ids to complete
  - object
    - `from` 'fieldValues', required
    - `projectId` number, required: Project id of the runs
    - `runFieldNames` string[], required: List of test run field names
    - `runFieldValues` union[], required: List of test run field values
      - union
        - string
        - number
        - boolean
    - `source` string, required: The name of the automation source which contains the runs

## Response `200`

Returns 'AutomationRunCompleteResult'

- AutomationRunCompleteResult
  - `completedRunIds` integer[], required: List of run ids which where marked as completed (or were already completed)

## Other responses

- `4XX`: The request failed because invalid request parameters or data were supplied or access was denied.
- `5XX`: The request failed because an error occurred during processing of the request.

---

[API](https://skmtc.dev/testiny/apis/testiny-api.md) - [All operations](https://skmtc.dev/testiny/apis/testiny-api/llms.txt) - [OpenAPI document](https://skmtc.dev/testiny/apis/testiny-api/revisions/8f7643b2429d?raw)
