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

# Verify key



## OpenAPI

````yaml POST /keys/verify
openapi: 3.0.0
info:
  title: Datkey Dev
  version: 1.0.0
servers:
  - url: https://api.datkey.dev
security: []
tags:
  - name: keys
paths:
  /keys/verify:
    post:
      tags:
        - keys
      summary: Verify key
      parameters:
        - name: x-api-key
          in: header
          schema:
            type: string
          description: your workspace API key
          example: <api_key>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - api_id
              properties:
                api_id:
                  type: string
                  example: '{api_id}'
                  description: API ID from your dashboard
                key:
                  type: string
                  example: key_xxxxxxxxxxxxxxxx
                  description: The generated API key
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                    description: >-
                      Whether the key is valid or not.

                      A key could be invalid for a number of reasons, for
                      example if it has expired or has no more verifications
                      left
                    example: true
                  status:
                    type: string
                    enum:
                      - EXPIRED
                      - USAGE_EXCEEDED
                    description: >
                      If the key status is `false` this field will be set to the
                      reason why it is invalid.

                      Possible values are:

                      - USAGE_EXCEEDED: the key has exceeded its validation
                      limit

                      - EXPIRED: the key has expired,
                  api_id:
                    type: string
                    example: '{api_id}'
                    description: The ID of the API the key belongs to
                  name:
                    type: string
                    example: '{api_name}'
                    description: The name assigned to the key
                  prefix:
                    type: string
                    example: prefix
                    description: The prefix assigned to the key
                  length:
                    type: integer
                    minimum: 16
                    maximum: 255
                    default: 16
                    description: The length assigned to the key
                  meta:
                    type: object
                    additionalProperties:
                      nullable: true
                    example:
                      user_id: '123456'
                    description: extra details you passed via the meta attribute
                  expires_at:
                    type: integer
                    additionalProperties:
                      nullable: true
                    format: int64
                    description: >-
                      Unix timestamp of when the key expires, returns `null`
                      when not set
                  verification_limit:
                    type: integer
                    format: int64
                    additionalProperties:
                      nullable: true
                    description: >-
                      maximum verification allowed for this key, returns `null`
                      when not set
              example:
                valid: true
                key:
                  id: <id>
                  name: ACME INC
                  key: flox_sk_05ad2bf*********
                  prefix: flox_sk
                  length: 16
                  verifications: 5
                  verification_limit: 90
                  expires_at: 1733237153
                  meta: null
                  created_at: '2023-12-05T11:31:23.000000Z'
                  updated_at: '2023-12-05T13:03:24.000000Z'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                    description: >-
                      Whether the key is valid or not.

                      A key could be invalid for a number of reasons, for
                      example if it has expired or has no more verifications
                      left
                    example: true
              example:
                valid: false
                status: EXPIRED

````