> ## Documentation Index
> Fetch the complete documentation index at: https://checkly-422f444a-mintlify-f27640bd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve an environment variable

> Show details of a specific environment variable. Uses the "key" field for selection.



## OpenAPI

````yaml get /v1/variables/{key}
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/variables/{key}:
    get:
      tags:
        - Environment variables
      summary: Retrieve an environment variable
      description: >-
        Show details of a specific environment variable. Uses the "key" field
        for selection.
      operationId: getV1VariablesKey
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              The key of the environment variable (this value cannot be
              changed).
            example: API_KEY
          required: true
          description: The key of the environment variable (this value cannot be changed).
          name: key
          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/EnvironmentVariablesV1ReadResponse'
        '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:
    EnvironmentVariablesV1ReadResponse:
      type: object
      properties:
        key:
          type: string
          minLength: 1
          description: The key of the environment variable (this value cannot be changed).
          example: API_KEY
        value:
          type: string
          nullable: true
          description: >-
            The value of the environment variable. Secret values are always
            returned as null.
        locked:
          type: boolean
          description: Used only in the UI to hide the value like a password.
        secret:
          type: boolean
          description: Whether the environment variable is stored as a secret.
      required:
        - key
        - value
        - locked
        - secret
    ApiError:
      type: object
      properties:
        statusCode:
          type: number
        error:
          type: string
        message:
          type: string
      required:
        - statusCode
        - error
        - message
  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]"` 

````