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

# List variables

> List the Agent Vault variables you can see: your own personal ones, and the global ones if you're an admin



## OpenAPI

````yaml GET /api/v1/agent-vault/variables
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/agent-vault/variables:
    get:
      tags:
        - Agent Vault Variables
      description: >-
        List the Agent Vault variables you can see: your own personal ones, and
        the global ones if you're an admin
      operationId: listAgentVaultVariables
      parameters:
        - schema:
            type: string
            enum:
              - global
              - personal
          in: query
          name: scope
          required: false
          description: >-
            Which variables to list: global, which needs the admin role, or
            personal for your own. Omit to list everything you can see: your own
            personal variables, plus the global ones if you're an admin. Nobody
            can list another member's personal variables.
        - schema:
            type: string
            enum:
              - key
              - serviceCount
            default: key
          in: query
          name: orderBy
          required: false
          description: >-
            What to sort variables by: key, or serviceCount for how many
            services use each one.
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          in: query
          name: orderDirection
          required: false
          description: 'Which way to sort: asc or desc.'
        - schema:
            allOf:
              - type: string
                maxLength: 6500
              - type: array
                items:
                  type: string
                  minLength: 1
                  maxLength: 64
                  pattern: ^[A-Z][A-Z0-9_]*$
                minItems: 1
                maxItems: 100
          in: query
          name: keys
          required: false
          description: >-
            Return only the variables with these exact keys, comma-separated.
            Every one that exists is returned unless limit is set. Requires
            scope, since a key can name both a global variable and one of your
            own.
        - schema:
            type: string
            maxLength: 255
            pattern: ^[^\x00-\x1f\x7f]*$
          in: query
          name: search
          required: false
          description: Match variables whose key contains this text.
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          in: query
          name: limit
          required: false
          description: >-
            The maximum number of variables to return. Defaults to 20, or to the
            number of keys when keys is given.
        - schema:
            type: integer
            minimum: 0
            maximum: 10000
            default: 0
          in: query
          name: offset
          required: false
          description: How many variables to skip.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  variables:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: The ID of the variable.
                        key:
                          type: string
                          description: >-
                            The name values use to refer to the variable, as
                            `{{KEY}}`. Starts with a letter and uses only upper
                            case letters, numbers and underscores.
                        scope:
                          type: string
                          enum:
                            - global
                            - personal
                          description: >-
                            global for a variable admins set up for services, or
                            personal for one of your own, which only your
                            personal values can use and only you can see.
                            Personal keys are unique among your own variables.
                        usedByServices:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                description: The ID of a service that uses this variable.
                              name:
                                type: string
                                description: The name of the service.
                              hostPattern:
                                type: string
                                description: The host pattern of the service.
                              accessBundleId:
                                type: string
                                format: uuid
                                description: >-
                                  The ID of the access bundle the service
                                  belongs to.
                              accessBundleName:
                                type: string
                                description: >-
                                  The name of the access bundle the service
                                  belongs to.
                            required:
                              - id
                              - name
                              - hostPattern
                              - accessBundleId
                              - accessBundleName
                            additionalProperties: false
                          description: >-
                            The services that use this variable, across every
                            access bundle, ordered by access bundle name and
                            then service name. For a personal variable, the
                            services whose personal values, as you set them, use
                            it. A variable in use can't be deleted.
                        createdAt:
                          type: string
                          format: date-time
                          description: When the variable was added.
                        updatedAt:
                          type: string
                          format: date-time
                          description: When the variable was last changed.
                      required:
                        - id
                        - key
                        - scope
                        - usedByServices
                        - createdAt
                        - updatedAt
                      additionalProperties: false
                  totalCount:
                    type: number
                    description: How many variables match the search, across every page.
                required:
                  - variables
                  - totalCount
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.