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

# Validate a cloud provider token

> Tests a cloud provider API token without storing it. Use before creating a credential to verify the token works.



## OpenAPI

````yaml /openapi.json post /v1/credentials/validate
openapi: 3.1.0
info:
  title: CNAP API
  version: 1.0.0
  description: >-
    Public API for managing CNAP workspaces, clusters, templates, products, and
    deployments.


    Authenticate with a Personal Access Token via the `Authorization: Bearer
    cnap_pat_...` header.


    Workspace-scoped endpoints require the `X-Workspace-Id` header.
servers:
  - url: https://api.cnap.tech
    description: Production
security: []
paths:
  /v1/credentials/validate:
    post:
      tags:
        - Credentials
      summary: Validate a cloud provider token
      description: >-
        Tests a cloud provider API token without storing it. Use before creating
        a credential to verify the token works.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  type: string
                  enum:
                    - hcloud
                api_token:
                  type: string
                  minLength: 1
              required:
                - provider
                - api_token
      responses:
        '200':
          description: Validation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateCredentialResult'
        '401':
          description: Unauthorized
      security:
        - BearerAuth: []
components:
  schemas:
    ValidateCredentialResult:
      type: object
      properties:
        valid:
          type: boolean
        error:
          type: string
      required:
        - valid
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal Access Token (cnap_pat_...) or OAuth2 JWT. Create tokens at
        https://cnap.tech/account/tokens

````