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

# Validate an API key



## OpenAPI

````yaml https://api.qontext.ai/docs-json post /auth/validate-key
openapi: 3.0.0
info:
  title: Qontext API
  description: API to ingest and retrieve data to enable contextualised AI.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.qontext.ai
    description: Production
security: []
tags: []
paths:
  /auth/validate-key:
    post:
      tags:
        - Auth
      summary: Validate an API key
      operationId: AuthController_validateKey
      parameters: []
      responses:
        '200':
          description: API key valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateApiKeyResponseDto'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorDto'
      security:
        - X-API-Key:
            - X-API-Key
components:
  schemas:
    ValidateApiKeyResponseDto:
      type: object
      properties:
        message:
          type: string
          description: Confirmation message.
          example: API key confirmed
        workspace:
          description: The workspace associated with the validated API key.
          allOf:
            - $ref: '#/components/schemas/Workspace'
        knowledgeGraphId:
          type: string
          description: >-
            Optional ID of the knowledge graph (vault) this API key is scoped
            to. If absent, the key is workspace-scoped.
          example: kg_123e4567-e89b-12d3-a456-426614174000
      required:
        - message
        - workspace
    UnauthorizedDto:
      type: object
      properties:
        message:
          type: string
          description: String or array of strings with specific error message(s)
          example: <error message(s)>
        error:
          type: string
          description: Error Message
          example: Unauthorized
        statusCode:
          type: number
          description: Status Code
          example: 401
          default: 401
      required:
        - message
        - error
        - statusCode
    InternalServerErrorDto:
      type: object
      properties:
        error:
          type: string
          description: Error Message
          example: Internal Server Error
        statusCode:
          type: number
          description: Status Code
          example: 500
          default: 500
      required:
        - error
        - statusCode
    Workspace:
      type: object
      properties:
        id:
          type: object
          description: The ID of the workspace
          example: ws_123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: The name of the workspace
          example: My Workspace
        url:
          type: string
          description: The URL of the workspace
          example: https://myworkspace.com
        slackChannelLink:
          type: string
          description: The Slack channel link for the workspace
          example: https://qontext.slack.com/channels/workspace-support
        type:
          type: string
          description: The type of the workspace
          example: ai_tool
        createdAt:
          type: object
          description: The date and time the workspace was created
          example: '2021-01-01T00:00:00.000Z'
        updatedAt:
          type: object
          description: The date and time the workspace was last updated
          example: '2021-01-01T00:00:00.000Z'
      required:
        - id
        - name
        - url
        - slackChannelLink
        - type
        - createdAt
        - updatedAt
  securitySchemes:
    X-API-Key:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for the Qontext API

````