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

# Validate Secret

> Validate if a secret is valid

<Info>
  **Quick Validation** - Fast and secure secret validation endpoint.
</Info>

## Validate a Secret

<Card title="Endpoint" icon="key">
  Validate if a secret is valid. Returns a boolean indicating the validation result.
</Card>

### Base URL

```bash
https://api.one.bithuman.io
```

### Request

<ParamField body="value" type="string" required>
  The secret to validate. A combined string containing encoded information and secret value.
</ParamField>

<RequestExample>
  ```bash Request
  curl -X POST 'https://api.one.bithuman.io/v1/authentication/validate-secret' \
    -H 'Content-Type: application/json' \
    -d '{
      "value": "OyOCkComrJSMrF1AzAnmvvJoVCxMmWqffjC"
    }'
  ```
</RequestExample>

### Response

<ResponseField name="status" type="string" required>
  The status of the request. Always `"success"`
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable title="Response Data">
    <ResponseField name="is_valid" type="boolean" required>
      Whether the secret is valid
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response
  {
    "status": "success",
    "data": {
      "is_valid": true
    }
  }
  ```
</ResponseExample>

## Examples

### Validate a Secret

<CodeGroup>
  ```javascript JavaScript
  const validateSecret = async (secret) => {
    const response = await fetch('https://api.one.bithuman.io/v1/authentication/validate-secret', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        value: secret
      })
    });
    
    const { data } = await response.json();
    return data.is_valid;
  };
  ```

  ```python Python
  import requests

  def validate_secret(secret):
      response = requests.post(
          'https://api.one.bithuman.io/v1/authentication/validate-secret',
          json={'value': secret}
      )
      return response.json()['data']['is_valid']
  ```
</CodeGroup>
