# DNI

{% hint style="info" %} <mark style="color:blue;">**Búsqueda por número de Documento Nacional de Identidad**</mark>
{% endhint %}

{% code title="POST" %}

```url
https://api.consultasperu.com/api/v1/query
```

{% endcode %}

### *<mark style="color:blue;">Headers</mark>*

| Name         | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

### *<mark style="color:blue;">Body</mark>*

```json
{
    "token": "tu_token_aqui",
    "type_document":"dni",
    "document_number": "00000000"
}
```

### *<mark style="color:blue;">Response</mark>*

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "success": true,
    "message": "Successful response",
    "data": {
        "number": "00000000",
        "full_name": "Nombre completo",
        "name": "Solo el nombre",
        "surname": "Solo apellidos",
        "date_of_birth": "2005-03-31",
        "department": "Departamento",
        "province": "Provincia",
        "district": "Distrito",
        "address": "Dirección",
        "ubigeo": "000000"
    }
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
    "success": false,
    "message": "No data found",
    "data": null
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "success": false,
    "message": "Invalid Token",
    "data": null
}
</code></pre>

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.consultasperu.com/api-consultas/dni.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
