> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobileboost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get run status

> Get the status and per-test results of a run. Pass the `runId` that `POST /tests/execute` returned.

Poll until `status` is `completed` or `cancelled`. Each test is then in `succeededTests`, `failedTests` or `blockedTests`, unless it was cancelled. While the run is in progress, `runningTests` lists the tests that are on a device and `queuedTests` the ones waiting for one. A test that is being set up, or re-checked after a failure, is in none of the lists for that time, so the lists can add up to less than `totalTests`.

**When to start polling.** `POST /tests/execute` returns just before the run is saved. The run is usually saved within half a second, so wait 2 seconds before your first call. If it answers 404, retry every 2 seconds. A 404 that lasts longer than 30 seconds means the run was not created: check the `runId`, then start the run again.

While `status` is `initial`, tests are still being added to the run, so `totalTests` can still grow. This takes under a second for a run of a few tests, and up to about 10 seconds for a run of 100 tests. Once the run is `running`, polling every 15 to 30 seconds is enough.

The organisation is taken from your API key. A run that belongs to another organisation answers 404, the same as a run that does not exist.



## OpenAPI

````yaml /openapi.json get /runs/{runId}
openapi: 3.0.2
info:
  title: MobileBoost API
  version: 1.0.0
servers:
  - url: https://api.mobileboost.io
security:
  - BearerAuth: []
paths:
  /runs/{runId}:
    get:
      summary: Get run status
      description: >-
        Get the status and per-test results of a run. Pass the `runId` that
        `POST /tests/execute` returned.


        Poll until `status` is `completed` or `cancelled`. Each test is then in
        `succeededTests`, `failedTests` or `blockedTests`, unless it was
        cancelled. While the run is in progress, `runningTests` lists the tests
        that are on a device and `queuedTests` the ones waiting for one. A test
        that is being set up, or re-checked after a failure, is in none of the
        lists for that time, so the lists can add up to less than `totalTests`.


        **When to start polling.** `POST /tests/execute` returns just before the
        run is saved. The run is usually saved within half a second, so wait 2
        seconds before your first call. If it answers 404, retry every 2
        seconds. A 404 that lasts longer than 30 seconds means the run was not
        created: check the `runId`, then start the run again.


        While `status` is `initial`, tests are still being added to the run, so
        `totalTests` can still grow. This takes under a second for a run of a
        few tests, and up to about 10 seconds for a run of 100 tests. Once the
        run is `running`, polling every 15 to 30 seconds is enough.


        The organisation is taken from your API key. A run that belongs to
        another organisation answers 404, the same as a run that does not exist.
      operationId: get_run_status
      parameters:
        - required: true
          schema:
            title: Run ID
            type: string
          name: runId
          in: path
          description: The `runId` returned by `POST /tests/execute`.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  runId:
                    type: string
                    description: The ID of the run.
                  status:
                    type: string
                    description: >-
                      Overall status of the run: `initial` while it is being set
                      up, `running`, then `completed` or `cancelled` once every
                      test has finished. A completed run can still contain
                      failed tests: read the lists below for the results.
                  totalTests:
                    type: integer
                    description: Number of tests in the run.
                  runtimeSeconds:
                    type: integer
                    nullable: true
                    description: >-
                      The run's wall-clock time in seconds, counted from when
                      its first test reached a device. `null` until one has.
                  succeededTests:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestRunResult'
                    description: Tests that passed.
                  failedTests:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestRunResult'
                    description: Tests that failed.
                  blockedTests:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestRunResult'
                    description: >-
                      Tests that could not run to a result, for example because
                      no device became available. A blocked test says nothing
                      about your app.
                  runningTests:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestRunResult'
                    description: Tests that are running on a device now.
                  queuedTests:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestRunResult'
                    description: Tests waiting for a device.
                required:
                  - runId
                  - status
                  - totalTests
                  - succeededTests
                  - failedTests
                  - blockedTests
                  - runningTests
                  - queuedTests
              example:
                runId: b1111111df174791a93e560390ea7e65
                status: completed
                totalTests: 2
                runtimeSeconds: 212
                succeededTests:
                  - id: e4a1c7f09b2d4e56a8f3c1d2b7e90a11
                    title: test_login_flow.py
                    status: succeeded
                    runtimeSeconds: 94
                    recording: >-
                      https://platform.mobileboost.io/reports/b1111111df174791a93e560390ea7e65/e4a1c7f09b2d4e56a8f3c1d2b7e90a11
                failedTests:
                  - id: 7c2e9d10a4b84f3e9e5d6a7b8c9d0e12
                    title: test_checkout_flow.py
                    status: failed
                    runtimeSeconds: 118
                    recording: >-
                      https://platform.mobileboost.io/reports/b1111111df174791a93e560390ea7e65/7c2e9d10a4b84f3e9e5d6a7b8c9d0e12
                blockedTests: []
                runningTests: []
                queuedTests: []
        '401':
          description: The API key is missing or invalid.
        '404':
          description: >-
            No run with this ID in your organisation. Right after `POST
            /tests/execute`, the run may not be saved yet: retry every 2
            seconds. A 404 after 30 seconds means the run was not created.
components:
  schemas:
    TestRunResult:
      title: TestRunResult
      type: object
      properties:
        id:
          type: string
          description: >-
            The ID of this test's execution within the run. This is not the test
            ID.
        title:
          type: string
          description: The name of the test's automation file.
        status:
          type: string
          description: >-
            `succeeded`, `failed`, `blocked`, `running` or `queued`, matching
            the list the entry is in.
        runtimeSeconds:
          type: integer
          nullable: true
          description: >-
            Time this test spent on a device, in seconds. `null` until it
            reaches one.
        recording:
          type: string
          description: >-
            The test's report in the MobileBoost Platform, with its recording,
            steps and logs.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.