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

# Database Validation

> Validate identity data against government and third-party databases.

Cross-reference extracted identity data (name, date of birth, document number) against government registries and third-party data sources.

## List Providers

```
GET /v1/database/providers
```

Returns available validation providers for your organization.

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "providers": [
      {
        "name": "mock",
        "countries": ["*"]
      }
    ]
  }
  ```
</ResponseExample>

<Info>
  The `mock` provider is available in sandbox mode for testing. Contact us to enable production providers for specific countries.
</Info>

***

## Validate Identity

<ParamField body="provider" type="string" required>
  Provider name (from `/database/providers`).
</ParamField>

<ParamField body="session_id" type="string">
  Link this validation to a verification session. Optional.
</ParamField>

<ParamField body="first_name" type="string" required>
  First name as it appears on the official document.
</ParamField>

<ParamField body="last_name" type="string" required>
  Last name as it appears on the official document.
</ParamField>

<ParamField body="date_of_birth" type="string">
  Date of birth in `YYYY-MM-DD` format.
</ParamField>

<ParamField body="document_number" type="string">
  Government-issued document number.
</ParamField>

<ParamField body="country" type="string">
  ISO 3166-1 alpha-2 country code.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
    "https://verilock.io/api/v1/database/validate" \
    -H "Authorization: Bearer qi_live_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "provider": "mock",
      "session_id": "ses_a1b2c3d4-...",
      "first_name": "Jean",
      "last_name": "Dupont",
      "date_of_birth": "1985-06-12",
      "country": "FR"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://verilock.io/api/v1/database/validate",
      headers={
          "Authorization": "Bearer qi_live_your_api_key_here",
          "Content-Type": "application/json",
      },
      json={
          "provider": "mock",
          "first_name": "Jean",
          "last_name": "Dupont",
          "date_of_birth": "1985-06-12",
          "country": "FR",
      },
  )
  ```

  ```javascript Node.js theme={null}
  const res = await fetch('https://verilock.io/api/v1/database/validate', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer qi_live_your_api_key_here',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      provider: 'mock',
      first_name: 'Jean',
      last_name: 'Dupont',
      date_of_birth: '1985-06-12',
      country: 'FR',
    }),
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "dbv_c3d4e5f6-a1b2-7890-fedc-ba0987654321",
    "status": "completed",
    "match_score": 92.50,
    "field_matches": {
      "first_name": true,
      "last_name": true,
      "date_of_birth": true,
      "address": false
    },
    "result_data": {
      "first_name": "Jean",
      "last_name": "Dupont",
      "date_of_birth": "1985-06-12",
      "address": "15 Rue de la Paix, Paris",
      "document_number": "MOCK-A3F2B1C8",
      "source": "mock_government_database"
    }
  }
  ```
</ResponseExample>

## Get Validation Result

```
GET /v1/database/validate/{id}
```

Retrieve the result of a previous validation.

## Status Values

| Status      | Description                          |
| ----------- | ------------------------------------ |
| `completed` | Validation successful, data returned |
| `not_found` | No matching record found             |
| `error`     | Provider returned an error           |
| `pending`   | Validation is still processing       |
