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

# Retrieve an existing API key by ID

> Retrieve an existing API key by ID



## OpenAPI

````yaml /api/openapi.json get /api/auth/api-key/get
openapi: 3.1.0
info:
  description: HTTP API for the Rootprint log management platform.
  title: Rootprint API
  version: 0.3.4
servers:
  - description: Rootprint API
    url: https://example.com
security:
  - cookieAuth: []
paths:
  /api/auth/api-key/get:
    get:
      tags:
        - Personal API keys
      summary: Retrieve an existing API key by ID
      description: Retrieve an existing API key by ID
      parameters:
        - in: query
          name: configId
          schema:
            description: >-
              The configuration ID to use for the API key lookup. If not
              provided, the default configuration will be used.
            type:
              - string
              - 'null'
        - in: query
          name: id
          schema:
            description: The id of the Api Key
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  createdAt:
                    description: created at
                    format: date-time
                    type: string
                  enabled:
                    default: true
                    description: Sets if key is enabled or disabled
                    type: boolean
                  expiresAt:
                    description: Expiry date of a key
                    format: date-time
                    nullable: true
                    type: string
                  id:
                    description: ID
                    type: string
                  lastRefillAt:
                    description: The last refill date
                    format: date-time
                    nullable: true
                    type: string
                  lastRequest:
                    description: When last request occurred
                    format: date-time
                    nullable: true
                    type: string
                  metadata:
                    additionalProperties: true
                    description: Extra metadata about the apiKey
                    nullable: true
                    type: object
                  name:
                    description: The name of the key
                    nullable: true
                    type: string
                  permissions:
                    description: Permissions for the api key (stored as JSON string)
                    nullable: true
                    type: string
                  prefix:
                    description: The API Key prefix. Stored as plain text.
                    nullable: true
                    type: string
                  rateLimitEnabled:
                    description: Whether the key has rate limiting enabled
                    type: boolean
                  rateLimitMax:
                    description: Maximum amount of requests allowed within a window
                    nullable: true
                    type: number
                  rateLimitTimeWindow:
                    description: The duration in milliseconds
                    nullable: true
                    type: number
                  refillAmount:
                    description: The amount to refill
                    nullable: true
                    type: number
                  refillInterval:
                    description: >-
                      The interval in milliseconds between refills of the
                      `remaining` count. Example: 3600000 // refill every hour
                      (3600000ms = 1h)
                    nullable: true
                    type: number
                  remaining:
                    description: >-
                      Remaining requests (every time api key is used this should
                      updated and should be updated on refill as well)
                    nullable: true
                    type: number
                  requestCount:
                    description: >-
                      The number of requests made within the rate limit time
                      window
                    type: number
                  start:
                    description: >-
                      Shows the first few characters of the API key, including
                      the prefix. This allows you to show those few characters
                      in the UI to make it easier for users to identify the API
                      key.
                    nullable: true
                    type: string
                  updatedAt:
                    description: updated at
                    format: date-time
                    type: string
                  userId:
                    description: The owner of the user id
                    type: string
                required:
                  - id
                  - userId
                  - enabled
                  - rateLimitEnabled
                  - requestCount
                  - createdAt
                  - updatedAt
                type: object
          description: API key retrieved successfully
        '400':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: >-
            Bad Request. Usually due to missing parameters, or invalid
            parameters.
        '401':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: Unauthorized. Due to missing or invalid authentication.
        '403':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >-
            Forbidden. You do not have permission to access this resource or to
            perform this action.
        '404':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: Not Found. The requested resource was not found.
        '429':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >-
            Too Many Requests. You have exceeded the rate limit. Try again
            later.
        '500':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >-
            Internal Server Error. This is a problem with the server that you
            cannot fix.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    cookieAuth:
      in: cookie
      name: better-auth.session_token
      type: apiKey
    bearerAuth:
      description: Bearer token authentication
      scheme: bearer
      type: http

````