> 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/api-rest/identity-api/identity-api-reference/onboarding/civil-registry/reniec.md).

# RENIEC

Permite obtener los datos asociados a un número de documento (CUI) consultando el registro civil **RENIEC** de Perú.

### Endpoint

```
GET /civil-registry/reniec/documents/{DOCUMENT_NUMBER}
```

### Autenticación

| Tipo    | Ubicación | Nombre        |
| ------- | --------- | ------------- |
| API Key | Header    | **x-api-key** |

### Parámetros de ruta

| Parámetro         | Tipo   | Requerido | Descripción                                 |
| ----------------- | ------ | --------- | ------------------------------------------- |
| `DOCUMENT_NUMBER` | string | **Sí**    | Número de documento de **8 dígitos** (CUI). |

### Ejemplo de solicitud

```bash
curl --location '{IDENTITY_API_BASE_URL}/civil-registry/reniec/documents/{DOCUMENT_NUMBER}' \
--header 'x-api-key: {API_KEY}'
```

### Respuestas

#### `200` Éxito

#### Ejemplo de respuesta

```json
{
    "addrContinent": "XXXXXXX",
    "addrCountry": "XXXX",
    "apellidoCasada": "",
    "apellidoMaterno": "XXXXXXX",
    "apellidoPaterno": "XXXXXXX",
    "blkDireccion": "",
    "civilStatus": "0",
    "departamentoNacimiento": "XXXXXXXXXXX",
    "direccion": "XXXXXXXXXXXXXXXXXXX",
    "distDomicilio": "XXXXXXXX",
    "distritoNacimiento": "XXXXXXXX",
    "dni": "00000000",
    "dptoDomicilio": "XXXXXXXXXXX",
    "dver": "0",
    "etapaDireccion": "",
    "fechaCaducidad": "00000000",
    "fechaExpedicion": "00000000",
    "fechaInscripcion": "00000000",
    "fechaNacimiento": "00000000",
    "intDireccion": "000",
    "lotDireccion": "",
    "mznDireccion": "",
    "nombres": "XXXXXXXXXXXX",
    "numDireccion": "000",
    "paisNacimiento": "XXXX",
    "picture": "",
    "preBlockChalet": "",
    "preDireccion": "00",
    "preDptoPisoInterior": "00",
    "preUrb": "00",
    "provDomicilio": "XXXXXXXX",
    "provinciaNacimiento": "XXXXXXXX",
    "sexo": "0",
    "sip_authenticator": null,
    "sip_host": null,
    "sip_port": null,
    "ubigeoContinent": "00",
    "ubigeoContinentNacimiento": "00",
    "ubigeoCountry": "00",
    "ubigeoCountryNacimiento": "00",
    "urbDireccion": "XXXXXXXXXXXXX"
}
```

#### `400` Bad Request

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

#### `401` Unauthorized

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

#### `403` Forbidden

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

#### `502` Bad Gateway

```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` Gateway Timeout

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