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

# Retrieve a test session

> Retrieves a test session. Note that the returned data may be incomplete if the test session is still in progress.



## OpenAPI

````yaml get /v1/test-sessions/{testSessionId}
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:
  /v1/test-sessions/{testSessionId}:
    get:
      tags:
        - Test sessions
      summary: Retrieve a test session
      description: >-
        Retrieves a test session. Note that the returned data may be incomplete
        if the test session is still in progress.
      operationId: getV1TestsessionsTestsessionid
      parameters:
        - schema:
            type: string
            format: uuid
            description: Test session ID.
          required: true
          description: Test session ID.
          name: testSessionId
          in: path
        - 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/FindOneTestSessionResponse'
        '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'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    FindOneTestSessionResponse:
      type: object
      properties:
        testSessionId:
          type: string
          format: uuid
        testSessionLink:
          type: string
          format: uri
        name:
          type: string
        status:
          type: string
          enum:
            - RUNNING
            - FAILED
            - PASSED
            - CANCELLED
        errorGroupIds:
          type: array
          items:
            type: string
            format: uuid
          description: IDs of the test-session error groups observed in this test session.
        startedAt:
          type: string
          nullable: false
          format: date-time
        stoppedAt:
          type: string
          nullable: true
          format: date-time
        timeElapsed:
          type: number
        metadata:
          $ref: '#/components/schemas/TestSessionMetadata'
        results:
          type: array
          items:
            $ref: '#/components/schemas/TestSessionResult'
      required:
        - testSessionId
        - testSessionLink
        - name
        - status
        - errorGroupIds
        - startedAt
        - timeElapsed
    ApiError:
      type: object
      properties:
        statusCode:
          type: number
        error:
          type: string
        message:
          type: string
      required:
        - statusCode
        - error
        - message
    TestSessionMetadata:
      type: object
      properties:
        environment:
          type: string
          minLength: 1
          description: A short description for the testing environment.
        repoUrl:
          type: string
          nullable: true
        commitId:
          type: string
          nullable: true
        commitOwner:
          type: string
          nullable: true
        commitMessage:
          type: string
          nullable: true
        branchName:
          type: string
          nullable: true
    TestSessionResult:
      type: object
      properties:
        testSessionResultId:
          type: string
          format: uuid
        testSessionResultLink:
          type: string
          format: uri
        checkId:
          type: string
          nullable: true
          format: uuid
        checkType:
          type: string
          enum:
            - AGENTIC
            - API
            - BROWSER
            - HEARTBEAT
            - ICMP
            - MULTI_STEP
            - TCP
            - PLAYWRIGHT
            - URL
            - DNS
            - SSL
            - GRPC
            - TRACEROUTE
        name:
          type: string
        runLocation:
          type: string
        errorGroupIds:
          type: array
          items:
            type: string
            format: uuid
          description: IDs of the test-session error groups associated with this result.
        resultType:
          type: string
          enum:
            - FINAL
            - ATTEMPT
            - PENDING
        status:
          type: string
          enum:
            - RUNNING
            - FAILED
            - PASSED
            - CANCELLED
        hasErrors:
          type: boolean
        hasFailures:
          type: boolean
        isDegraded:
          type: boolean
        aborted:
          type: boolean
        responseTime:
          type: number
          nullable: true
          description: >-
            Time the check spent producing its result, in milliseconds. For
            protocol checks this is the measured operation time (a subset of the
            run): request time for API and URL checks, connection time for TCP,
            resolution time for DNS, average latency for ICMP and TRACEROUTE,
            request timing for GRPC, and TLS handshake time for SSL. For
            browser, multi-step, Playwright and agentic checks it is the run
            wall-clock duration. Null until the check has finished. For the
            total wall-clock time a check run took, use `stoppedAt` -
            `startedAt`.
        startedAt:
          type: string
          nullable: true
          format: date-time
          description: When the check run started. Null until the check has started.
        stoppedAt:
          type: string
          nullable: true
          format: date-time
          description: >-
            When the check run finished. Subtract `startedAt` for the total
            wall-clock duration of the run. Null until the check has finished.
      required:
        - testSessionResultId
        - testSessionResultLink
        - checkType
        - errorGroupIds
        - status
        - hasErrors
        - hasFailures
        - isDegraded
        - aborted
  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]"` 

````