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

# Validate API Key

> Validate an API key before a configuration test, SDK initialization, or deployment.

<span data-api-safety-label="read-only"><Badge color="gray" size="sm" shape="pill">Read only</Badge></span>

Validate an API key before a configuration test, SDK initialization, or deployment. The request checks credentials and returns key and workspace metadata without creating resources or placing calls.

## Before you begin

* Create a workspace [API key](/docs/api-access/api-keys).
* Use the complete `key_id:secret` value in the Bearer header. A dashboard cookie session is not accepted.

## Validate API Key Request

```bash theme={null}
curl https://api.dialnexa.com/v1/auth/validate \
  -H "Authorization: Bearer $DIALNEXA_API_KEY"
```

## Verify the result

A `200` response contains `data.valid: true`, `data.key`, `data.organization.id`, and `data.access_type: "private"`. Confirm the workspace ID matches your intended workspace. The key secret is never returned. The response uses `Cache-Control: no-store`.

## Errors and recovery

`401` means the credential is missing, malformed, unknown, expired, or revoked. Replace the credential or [regenerate the key](/docs/api-access/key-rotation), then repeat this read-only request. An invalid key produces an error, not a successful response with `valid: false`.

## Related endpoints

* [API keys](/docs/api-access/api-keys)
* [Create Agent](/docs/api-reference/v1/agents/create)


## OpenAPI

````yaml GET /v1/auth/validate
openapi: 3.0.0
info:
  title: DialNexa API
  description: Public `/v1` REST API for the DialNexa voice AI platform.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: Agents
  - name: Batch Calls
  - name: Calls
  - name: Knowledge Base
  - name: Languages
  - name: LLMs
  - name: Phone Numbers
  - name: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
paths:
  /v1/auth/validate:
    get:
      tags:
        - Authentication
      summary: Validate API Key
      description: >-
        Checks a Bearer API key and returns its key and workspace metadata
        without creating resources or placing calls. Dashboard cookie sessions
        are not accepted.
      operationId: validateApiKey
      parameters: []
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      valid:
                        type: boolean
                        enum:
                          - true
                      key:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          created_at:
                            type: string
                            format: date-time
                          expires_at:
                            type: string
                            format: date-time
                            nullable: true
                        required:
                          - id
                          - name
                          - created_at
                          - expires_at
                      organization:
                        type: object
                        properties:
                          id:
                            type: string
                        required:
                          - id
                      access_type:
                        type: string
                        enum:
                          - private
                    required:
                      - valid
                      - key
                      - organization
                      - access_type
                  timestamp:
                    type: string
                    format: date-time
                required:
                  - success
                  - error
                  - statusCode
                  - message
                  - data
                  - timestamp
              examples:
                success:
                  value:
                    success: true
                    error: false
                    statusCode: 200
                    message: Success
                    data:
                      valid: true
                      key:
                        id: k7x2m9q4wz1abc
                        name: CI Pipeline Key
                        created_at: '2026-01-10T08:30:00.000Z'
                        expires_at: null
                      organization:
                        id: org_2g7Xy3tY53gRlp
                      access_type: private
                    timestamp: '2026-09-07T06:00:00.000Z'
          headers:
            Cache-Control:
              schema:
                type: string
              description: Always no-store.
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    statusCode: 401
                    message: Missing or invalid API key.
                    error: Unauthorized
      security:
        - bearer: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: phone_number must be a valid E.164 phone number
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
        - error
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````