> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-pt-br/api-rest/identity-api/identity-api-reference/onboarding/civil-registry/dha/validar-cliente.md).

# Validar cliente

Permite obter os dados associados a um número de identificação consultando o registro **DHA** da África do Sul 🇿🇦.

{% hint style="info" %}
A verificação será realizada sobre o número de identificação fornecido no Endpoint POST Criar cliente.
{% endhint %}

### Endpoint

```
GET /civil-registry/dha/validation/{ID_NUMBER}
```

### Autenticação

| Tipo    | Localização | Nome          |
| ------- | ----------- | ------------- |
| API Key | Cabeçalho   | **x-api-key** |

### Parâmetros de rota

| Parâmetro   | Tipo   | Obrigatório | Descrição                                  |
| ----------- | ------ | ----------- | ------------------------------------------ |
| `ID_NUMBER` | string | **Sim**     | Número de identificação de **13 dígitos**. |

### Exemplo de solicitação

```bash
curl --location '{IDENTITY_API_BASE_URL}/civil-registry/dha/validation/{ID_NUMBER}' \
--header 'x-api-key: {API_KEY}'
```

### Respostas

#### `200` Sucesso

#### Exemplo de resposta

```json
{
    "id": "d56c6eb9-0caf-4c36-ae3d-6be8841a10d4",
    "idNumber": "{{idNumber}}",
    "firstNames": "{{firstName}}",
    "surname": "{{lastName}}",
    "gender": "Female",
    "dateOfBirth": "1992-08-01T00:00:00",
    "status": "Active",
    "datePerformed": "2024-03-01T14:46:06.4871561+02:00",
    "birthPlaceCountryCode": "",
    "deadIndicator": false,
    "dateOfDeath": "",
    "maritalStatus": "",
    "dateOfMarriage": "",
    "idIssueDate": "20160831",
    "idSequenceNumber": "1",
    "onHANIS": true,
    "onNPR": true,
    "smartCardIssued": true,
    "idNumberBlocked": false,
    "photo": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDABA.....",
    "dataSource": "DHA SAFPS",
    "hasPhoto": true
}
```

#### `400` Requisição inválida

```json
{
  "status": 400,
  "title": "Bad Request",
  "detail": "Invalid request.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",
  "errors": []
}
```

#### `401` Não autorizado

```json
{
  "message": "Unauthorized"
}
```

#### `403` Proibido

```json
{
  "Message": "User is not authorized to access this resource with an explicit deny"
}
```

#### `502` Gateway inválido

```json
{
  "status": 502,
  "title": "Bad Gateway",
  "detail": "Server got an invalid response.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502"
}
```

#### `504` Tempo esgotado no gateway

```json
{
  "message": "Endpoint request timed out"
}
```
