API REST de Certifica TepZ

Certifica archivos digitalmente con sello de tiempo NOM-151 y anclaje en blockchain desde cualquier lenguaje. Todas las llamadas se autentican con tu API key personal.

Base URL: https://certificatepz.com
v1
JSON

1. Obtén tu API key

Inicia sesión y entra a Dashboard → API keys para generar una clave. Solo verás el valor completo una vez; guárdalo en un gestor de secretos.

Las claves comienzan con tepz_live_ y se envían en el header Authorization: Bearer.

2. Límites

  • Por defecto: 60 requests/minuto y 1,000 al mes por API key (configurable).
  • Tamaño máximo de archivo: 50 MB.
  • Respuestas 429 incluyen el motivo (rate_limit_exceeded o quota_exceeded).

3. Endpoints

POST
/api/public/v1/certificates

Sube un archivo y solicita su certificación NOM-151 + blockchain.

multipart/form-data

curl -X POST https://certificatepz.com/api/public/v1/certificates \
  -H "Authorization: Bearer $TEPZ_API_KEY" \
  -F "file=@./contrato.pdf" \
  -F "title=Contrato 2026" \
  -F "description=Versión final firmada" \
  -F "document_type=contrato"

application/json (base64)

curl -X POST https://certificatepz.com/api/public/v1/certificates \
  -H "Authorization: Bearer $TEPZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Contrato 2026",
    "file_name": "contrato.pdf",
    "file_mime": "application/pdf",
    "file_base64": "JVBERi0xLjQK..."
  }'
GET
/api/public/v1/certificates

Lista paginada de los certificados de la cuenta.

curl "https://certificatepz.com/api/public/v1/certificates?limit=20&offset=0" \
  -H "Authorization: Bearer $TEPZ_API_KEY"
GET
/api/public/v1/certificates/{id}

Detalle de un certificado por ID.

curl https://certificatepz.com/api/public/v1/certificates/CERT_ID \
  -H "Authorization: Bearer $TEPZ_API_KEY"
GET
/api/public/v1/certificates/{id}/proof

Descarga las pruebas: archivo original (URL firmada), datos NOM-151 o XML blockchain.

# Archivo original (URL firmada 5 min)
curl "https://certificatepz.com/api/public/v1/certificates/CERT_ID/proof?type=file" \
  -H "Authorization: Bearer $TEPZ_API_KEY"

# NOM-151 (TSR + ASN.1)
curl "https://certificatepz.com/api/public/v1/certificates/CERT_ID/proof?type=nom151" \
  -H "Authorization: Bearer $TEPZ_API_KEY"

# Prueba blockchain — XML directo
curl "https://certificatepz.com/api/public/v1/certificates/CERT_ID/proof?type=blockchain&format=raw" \
  -H "Authorization: Bearer $TEPZ_API_KEY" \
  -o blockchain.xml
GET
/api/public/v1/verify/{hash}

Comprueba si un SHA-256 ya fue certificado bajo tu cuenta.

curl https://certificatepz.com/api/public/v1/verify/abc123...64hex \
  -H "Authorization: Bearer $TEPZ_API_KEY"

4. Errores

Las respuestas de error usan códigos HTTP estándar y un cuerpo JSON { "error": "...", "message": "..." }.

  • 401 — API key faltante, inválida, revocada o expirada.
  • 403 — La API key no incluye el scope requerido.
  • 413 — Archivo mayor a 50 MB.
  • 429 — Excedido el rate limit por minuto o la cuota mensual.
  • 502 — Error del proveedor de sellado (Cincel).

5. Spec OpenAPI

Importa https://certificatepz.com/api/public/v1/openapi en Postman, Insomnia, Scalar o cualquier cliente compatible con OpenAPI 3.