Personas
curl --request POST \
--url https://api.verifica.id/v2/consulta/personas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dni": "<string>"
}
'import requests
url = "https://api.verifica.id/v2/consulta/personas"
payload = { "dni": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dni: '<string>'})
};
fetch('https://api.verifica.id/v2/consulta/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verifica.id/v2/consulta/personas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dni' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.verifica.id/v2/consulta/personas"
payload := strings.NewReader("{\n \"dni\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.verifica.id/v2/consulta/personas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dni\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verifica.id/v2/consulta/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dni\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"status": 123,
"message": "<string>",
"data": {
"dni": "<string>",
"nombres": "<string>",
"apellido_paterno": "<string>",
"apellido_materno": "<string>",
"caracter_verificacion": "<string>",
"caracter_verificacion_anterior": {}
}
}Validación de Datos
Personas
Valida los datos de una persona consultando su número de DNI
POST
/
v2
/
consulta
/
personas
Personas
curl --request POST \
--url https://api.verifica.id/v2/consulta/personas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dni": "<string>"
}
'import requests
url = "https://api.verifica.id/v2/consulta/personas"
payload = { "dni": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dni: '<string>'})
};
fetch('https://api.verifica.id/v2/consulta/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verifica.id/v2/consulta/personas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dni' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.verifica.id/v2/consulta/personas"
payload := strings.NewReader("{\n \"dni\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.verifica.id/v2/consulta/personas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dni\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verifica.id/v2/consulta/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dni\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"status": 123,
"message": "<string>",
"data": {
"dni": "<string>",
"nombres": "<string>",
"apellido_paterno": "<string>",
"apellido_materno": "<string>",
"caracter_verificacion": "<string>",
"caracter_verificacion_anterior": {}
}
}Autenticación
¿Todavía no tienes un API token? El campo
Authorization del panel Try it espera tu token Bearer. Revisa dónde obtener tu API token para conseguirlo.Authorization: Bearer YOUR_API_KEY
Atributos Requeridos
string
required
Número de DNI a validar
Respuesta
string
Tipo de respuesta (ej: “result”)
integer
Código de estado HTTP de la respuesta (ej: 200)
string
Mensaje descriptivo del resultado de la validación
object
Ejemplo de Solicitud
curl --request POST \
--url https://api.verifica.id/v2/consulta/personas \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {TU-API-KEY}' \
--header 'content-type: multipart/form-data' \
--form dni=45678912
Ejemplo de Respuesta Exitosa
{
"type": "result",
"status": 200,
"message": "Se ha validado la información correctamente.",
"data": {
"dni": "45678912",
"nombres": "JUANA MARIA",
"apellido_paterno": "TORRES",
"apellido_materno": "RAMIREZ",
"caracter_verificacion": "9",
"caracter_verificacion_anterior": null
}
}
Códigos de Error
| Código | Descripción |
|---|---|
| 400 | Solicitud inválida - el campo dni es requerido o tiene un formato incorrecto |
| 401 | Token de autenticación inválido o faltante |
| 429 | Demasiadas solicitudes - se ha excedido el límite de rate |
| 500 | Error interno del servidor |