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

# Await the completion of a check session

> Call this endpoint to await the completion of a check session. A successful response will be returned once the check session reaches its final state (i.e. when it passes, fails, degrades, or is cancelled).

If the check session takes a long time to complete, the endpoint will return a timeout error code. You should keep calling the endpoint until you receive a successful response, or a non-timeout related error code. If using *curl*, its `--retry` option is suitable.

The successful response of this endpoint is equivalent to the `GET /v2/check-sessions/{checkSessionId}` endpoint's response for a completed check session.

The `status` field may return `CANCELLED` for sessions cancelled via `POST /v1/check-sessions/{checkSessionId}/cancel`, and each per-result object includes an `isCancelled` boolean.



## OpenAPI

````yaml get /v2/check-sessions/{checkSessionId}/completion
openapi: 3.0.0
info:
  title: Checkly Public API
  version: v1
  description: >-
    These are the docs for the newly released Checkly Public API. If you have
    any questions, please do not hesitate to get in touch with us.
servers:
  - url: https://api.checklyhq.com
security:
  - Bearer: []
tags: []
paths:
  /v2/check-sessions/{checkSessionId}/completion:
    get:
      tags:
        - Check sessions
      summary: Await the completion of a check session
      description: >-
        Call this endpoint to await the completion of a check session. A
        successful response will be returned once the check session reaches its
        final state (i.e. when it passes, fails, degrades, or is cancelled).


        If the check session takes a long time to complete, the endpoint will
        return a timeout error code. You should keep calling the endpoint until
        you receive a successful response, or a non-timeout related error code.
        If using *curl*, its `--retry` option is suitable.


        The successful response of this endpoint is equivalent to the `GET
        /v2/check-sessions/{checkSessionId}` endpoint's response for a completed
        check session.


        The `status` field may return `CANCELLED` for sessions cancelled via
        `POST /v1/check-sessions/{checkSessionId}/cancel`, and each per-result
        object includes an `isCancelled` boolean.
      operationId: getV2ChecksessionsChecksessionidCompletion
      parameters:
        - schema:
            type: string
            format: uuid
            description: Check session ID.
          required: true
          description: Check session ID.
          name: checkSessionId
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 30
            description: >-
              Maximum time to wait for completion before returning a retryable
              timeout response.
          required: false
          description: >-
            Maximum time to wait for completion before returning a retryable
            timeout response.
          name: maxWaitSeconds
          in: query
        - schema:
            type: string
            format: uuid
            description: >-
              Your Checkly account ID, you can find it at
              https://app.checklyhq.com/settings/account/general
          required: false
          description: >-
            Your Checkly account ID, you can find it at
            https://app.checklyhq.com/settings/account/general
          name: x-checkly-account
          in: header
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckSessionsV2CompletionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '408':
          description: Request Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    CheckSessionsV2CompletionResponse:
      type: object
      properties:
        checkSessionId:
          type: string
          format: uuid
        checkSessionLink:
          type: string
          format: uri
        checkId:
          type: string
          format: uuid
        checkType:
          type: string
          enum:
            - AGENTIC
            - API
            - BROWSER
            - HEARTBEAT
            - ICMP
            - MULTI_STEP
            - TCP
            - PLAYWRIGHT
            - URL
            - DNS
        name:
          type: string
        status:
          type: string
          enum:
            - PASSED
            - FAILED
            - DEGRADED
            - TIMED_OUT
            - CANCELLED
        startedAt:
          type: string
          nullable: false
          format: date-time
        stoppedAt:
          type: string
          nullable: false
          format: date-time
        timeElapsed:
          type: number
        runLocations:
          type: array
          items:
            type: string
        runSource:
          type: string
          nullable: true
          enum:
            - CLI_DEPLOY
            - DEPLOYMENT
            - DEPLOYMENT_CACHE_WARMER
            - EDITOR
            - GROUP_RUN_ALL
            - LEGACY_TRIGGER
            - SCHEDULER
            - SCHEDULE_NOW
            - TEST_NO_RECORD
            - TEST_RECORD
            - TRIGGER_NO_RECORD
            - TRIGGER_RECORD
            - TRIGGER_API
            - null
        results:
          type: array
          items:
            $ref: '#/components/schemas/CheckSessionsV2CheckResult'
      required:
        - checkSessionId
        - checkSessionLink
        - checkId
        - checkType
        - status
        - startedAt
        - stoppedAt
        - timeElapsed
        - runLocations
        - runSource
        - results
    ApiError:
      type: object
      properties:
        statusCode:
          type: number
        error:
          type: string
        message:
          type: string
      required:
        - statusCode
        - error
        - message
    CheckSessionsV2CheckResult:
      type: object
      properties:
        checkResultId:
          type: string
          format: uuid
        checkResultLink:
          type: string
          format: uri
        checkId:
          type: string
          format: uuid
        checkType:
          type: string
          enum:
            - AGENTIC
            - API
            - BROWSER
            - HEARTBEAT
            - ICMP
            - MULTI_STEP
            - TCP
            - PLAYWRIGHT
            - URL
            - DNS
        name:
          type: string
        runLocation:
          type: string
        resultType:
          type: string
          nullable: true
          enum:
            - FINAL
            - ATTEMPT
            - null
        hasErrors:
          type: boolean
        hasFailures:
          type: boolean
        isDegraded:
          type: boolean
        aborted:
          type: boolean
        isCancelled:
          type: boolean
      required:
        - checkResultId
        - checkResultLink
        - checkId
        - checkType
        - name
        - runLocation
        - resultType
        - hasErrors
        - hasFailures
        - isDegraded
        - aborted
        - isCancelled
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: Bearer
      description: >-
        The Checkly Public API uses API keys to authenticate requests. You can
        get the API Key
        [here](https://app.checklyhq.com/settings/user/api-keys). Your API key
        is like a password:  keep it secure!

        Authentication to the API is performed using the Bearer auth method in
        the Authorization header and using the account ID.

        For example, set **Authorization** header while using cURL: `curl -H
        "Authorization: Bearer [apiKey]" "X-Checkly-Account: [accountId]"` 

````