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

# Get Execution

> Read an execution, optionally waiting while it is still running.

`GET /api/tools/projects/{projectId}/executions/{executionId}` returns the execution resource. The response status is `200`.

`Prefer: wait=<seconds>` polls while `status` is `running`, up to 25 seconds. With no `Prefer` header the handler does not wait. A response that is still `running` includes `Retry-After: 1`.

An id this user does not own is `404` `EXECUTION_NOT_FOUND`.


## OpenAPI

````yaml agent-os/openapi/tools.json GET /api/tools/projects/{projectId}/executions/{executionId}
openapi: 3.1.0
info:
  title: Agent OS Tools API
  version: 1.0.0
  description: Enable your agent to take action in 130+ different apps with Agent OS Tools.
servers:
  - url: https://agentos.useparagon.com
    description: Production US Cloud
  - url: https://agentos.eu.paragon.so
    description: Production EU Cloud
security:
  - bearerAuth: []
paths:
  /api/tools/projects/{projectId}/executions/{executionId}:
    get:
      summary: Get Execution
      operationId: getExecution
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - name: executionId
          in: path
          required: true
          schema:
            type: string
        - name: Prefer
          in: header
          schema:
            type: string
          description: wait=<seconds>, capped at 25. Absent means do not wait.
      responses:
        '200':
          description: Current execution resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionResource'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    ExecutionResource:
      type: object
      required:
        - executionId
        - engine
        - status
        - startedAt
        - settledAt
        - durationMs
        - calls
      properties:
        executionId:
          type: string
        engine:
          type: string
          enum:
            - declarative
        status:
          type: string
          enum:
            - running
            - completed
            - failed
            - timeout
            - cancelled
        startedAt:
          type: string
          format: date-time
        settledAt:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
        durationMs:
          oneOf:
            - type: number
            - type: 'null'
        deadlineMs:
          type: number
        killed:
          type: boolean
        cancelledBy:
          type: string
          enum:
            - operator
        calls:
          type: array
          items:
            type: object
            required:
              - seq
              - kind
              - tool
              - integration
              - decision
              - upstreamStatus
            properties:
              seq:
                type: integer
              kind:
                type: string
                enum:
                  - run
              tool:
                type: string
              integration:
                type: string
              decision:
                type: string
                enum:
                  - allowed
                  - denied_scope
                  - denied_rate
                  - expired
              upstreamStatus:
                oneOf:
                  - type: integer
                  - type: 'null'
        output:
          type: object
          properties:
            inline: {}
            resultId:
              type: string
            stored:
              $ref: '#/components/schemas/StoredResult'
    StoredResult:
      type: object
      required:
        - resultId
        - executionId
        - tool
        - integration
        - byteSize
        - tokenEstimate
        - shape
        - expiresAt
        - tokenBudget
      properties:
        resultId:
          type: string
        executionId:
          type: string
        tool:
          type: string
        integration:
          type: string
        byteSize:
          type: integer
        tokenEstimate:
          type: integer
        shape:
          type: string
          enum:
            - records
            - text
        recordCount:
          oneOf:
            - type: integer
            - type: 'null'
        recordsPointer:
          oneOf:
            - type: string
            - type: 'null'
        totalChars:
          oneOf:
            - type: integer
            - type: 'null'
        schema: {}
        sample: {}
        expiresAt:
          type: string
          format: date-time
        tokenBudget:
          type: object
          required:
            - fullOutputTokens
            - returnedTokens
            - savedTokens
          properties:
            fullOutputTokens:
              type: integer
            returnedTokens:
              type: integer
            savedTokens:
              type: integer
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - hint
            - retryable
            - requestId
          properties:
            code:
              type: string
            message:
              type: string
            hint:
              type: string
            retryable:
              type: boolean
            retryAfterMs:
              type: integer
            requestId:
              type: string
            details:
              type: array
              items:
                type: object
                required:
                  - field
                  - issue
                properties:
                  field:
                    type: string
                  issue:
                    type: string
  responses:
    Error:
      description: Error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: REQUEST_INVALID
              message: The request payload failed validation.
              hint: Correct the fields named in details and retry.
              retryable: false
              requestId: req_01hxyz
              details:
                - field: query
                  issue: query should not be empty
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Your [Paragon User
        Token](/getting-started/installing-the-connect-sdk#setup) (JWT), which
        you can generate using your project's signing keys.

````