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

# RENIEC

Allows you to obtain the data associated with a document number (CUI) by querying the civil registry **RENIEC** of Peru.

### Endpoint

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

### Authentication

| Type    | Location | Name          |
| ------- | -------- | ------------- |
| API Key | Header   | **x-api-key** |

### Route parameters

| Parameter         | Type   | Required | Description                            |
| ----------------- | ------ | -------- | -------------------------------------- |
| `DOCUMENT_NUMBER` | string | **Yes**  | Document number of **8 digits** (CUI). |

### Request example

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

### Responses

#### `200` Success

#### Response example

```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"
}
```
