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

# List the per-device results of a script run

> Return the paginated executions of one script run — one per targeted device, each with its status, output, exit code and runtime. Use this to see which devices succeeded and read the script output.

For the run's summary counts, use `getScriptRun`. For everything that ran on one device across all runs, use `getDeviceScriptExecutions`.

Executions are reconciled with FleetDM by a background sweep that runs every 15 minutes, so a freshly created run reads back as `pending` until the next sweep. Poll no more often than that.

<span className="badge-read">Key: Read</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json get /script-runs/{runId}/executions
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /script-runs/{runId}/executions:
    get:
      tags:
        - Scripts
      summary: List the per-device results of a script run
      description: >-
        Return the paginated executions of one script run — one per targeted
        device, each with its status, output, exit code and runtime. Use this to
        see which devices succeeded and read the script output.


        For the run's summary counts, use `getScriptRun`. For everything that
        ran on one device across all runs, use `getDeviceScriptExecutions`.


        Executions are reconciled with FleetDM by a background sweep that runs
        every 15 minutes, so a freshly created run reads back as `pending` until
        the next sweep. Poll no more often than that.
      operationId: getScriptRunExecutions
      parameters:
        - name: runId
          required: true
          in: path
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            minimum: 1
            maximum: 9007199254740991
            default: 1
            type: number
        - name: perPage
          required: false
          in: query
          description: Number of items per page (max 100)
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: number
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetScriptRunExecutions_Output'
components:
  schemas:
    GetScriptRunExecutions_Output:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              runId:
                description: Identifier of the script run this execution belongs to.
                type: string
              deviceId:
                type: string
              device:
                description: Resolved device, null if it no longer exists.
                anyOf:
                  - type: object
                    properties:
                      id:
                        type: string
                      name:
                        anyOf:
                          - type: string
                          - type: 'null'
                      serialNumber:
                        anyOf:
                          - type: string
                          - type: 'null'
                      platform:
                        type: string
                    required:
                      - id
                      - name
                      - serialNumber
                      - platform
                    additionalProperties: false
                  - type: 'null'
              status:
                description: >-
                  Outcome on one device. `pending`: queued, the device may be
                  offline. `success`: ran with exit code 0. `failed`: ran with a
                  non-zero exit code, or the device was incompatible. `timeout`:
                  exceeded the execution limit. `cancelled`: cancelled before
                  running.
                type: string
                enum:
                  - pending
                  - success
                  - failed
                  - timeout
                  - cancelled
              output:
                description: >-
                  Combined stdout/stderr once the execution completes. Null
                  while pending.
                anyOf:
                  - type: string
                  - type: 'null'
              exitCode:
                description: >-
                  Process exit code once the execution completes. Null while
                  pending.
                anyOf:
                  - type: number
                  - type: 'null'
              runtime:
                description: >-
                  Duration in seconds once the execution completes. Null while
                  pending.
                anyOf:
                  - type: number
                  - type: 'null'
              createdAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              updatedAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            required:
              - id
              - runId
              - deviceId
              - device
              - status
              - output
              - exitCode
              - runtime
              - createdAt
              - updatedAt
            additionalProperties: false
        pagination:
          type: object
          properties:
            totalElements:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            totalPages:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            page:
              type: integer
              minimum: 1
              maximum: 9007199254740991
            perPage:
              type: integer
              minimum: 1
              maximum: 100
          required:
            - totalElements
            - totalPages
            - page
            - perPage
          additionalProperties: false
      required:
        - data
        - pagination
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````