Zum Hauptinhalt springen

20 % Rabatt im ersten Jahr mit dem Code Pläne ansehen

Entwickler · Öffentliche API 1.9.0

Integrieren Sie Anonimatum in Ihre Systeme

REST-API mit stabilem Vertrag unter /api/public/**, herunterladbare OpenAPI-Referenz und MCP-Connector für KI-Assistenten. Dieselbe Engine wie in der App, in der Europäischen Union.

Schnellstart

Drei Schritte: API-Schlüssel erstellen, prüfen und Ihr erstes Dokument anonymisieren.

  1. Erstellen Sie einen API-Schlüssel in der App: Profil → API-Schlüssel → „API-Schlüssel generieren“. Kopieren Sie ihn sofort: Er wird nicht erneut angezeigt. Wenn Sie den Bereich nicht sehen, enthält Ihr Tarif keinen API-Zugang oder der Administrator Ihrer Gruppe verwaltet ihn.
  2. Speichern Sie ihn als Umgebungsvariable und prüfen Sie den Tarif Ihrer Gruppe mit GET /api/public/plan.
  3. Senden Sie das Dokument an POST /api/public/ai/anonymize mit den benötigten KI-Optionen. Die Antwort ist das anonymisierte Dokument im Originalformat.
export ANONIMATUM_API_KEY="tu_api_key"

# 1. Comprueba la clave: plan y cupo del grupo
curl -H "X-API-Key: $ANONIMATUM_API_KEY" \
  https://api.anonimatum.com/api/public/plan

# 2. Opciones de IA disponibles (rgpd, fechas, direcciones, qr…)
curl -H "X-API-Key: $ANONIMATUM_API_KEY" \
  https://api.anonimatum.com/api/public/ai/options

# 3. Primer anonimizado: PDF, Word, Excel o PowerPoint
curl -X POST https://api.anonimatum.com/api/public/ai/anonymize \
  -H "X-API-Key: $ANONIMATUM_API_KEY" \
  -F "file=@resolucion.pdf" \
  -F "aiOptions=rgpd,direcciones,qr" \
  -F "backgroundColor=black" \
  -F "textContent=none" \
  --output resolucion-anonimizada.pdf

Parameter von Multipart-Endpunkten werden als Formularfelder (-F) gesendet. Der Verbrauch wird vom Tarif der Gruppe abgezogen, zu der der Schlüssel gehört.

Authentifizierung

X-API-Key
Header für Machine-to-Machine-Integrationen. Jeder Schlüssel gehört zu einem Benutzer und einer Gruppe und nutzt deren Berechtigungen, Tarif und Kontingent.
Authorization: Bearer
Sitzungs-JWT des Benutzers, dasselbe, das die App verwendet. Nützlich, wenn Sie Anonimatum in eine Anwendung mit Politeia-Anmeldung einbetten.
Isolierung
Eine Ressource einer anderen Gruppe liefert 404, nie 403: Die API verrät nicht, ob sie existiert.
Widerruf
Widerrufen Sie einen Schlüssel unter Profil → API-Schlüssel; er funktioniert ab sofort nicht mehr. Legen Sie Schlüssel niemals im Code oder in Repositories ab.

Limits

Technische Limits in Version 1.9.0 (pro IP-Adresse oder pro Anfrage):

300 / minAnfragen an /api/public/** pro IP.
60 / minAnonymisierungen (anonymize-patterns, -zones, -complete, -whitelist) pro IP.
250 MBMaximale Dateigröße pro Anfrage.
20 MB · 100.000 Zeilen · 200 Spalten · 50 TabellenblätterTabellen nach Spalten (/api/public/sheets/**).

Jeder Vorgang zieht außerdem Seiten oder Dokumente vom Tarif der Gruppe ab. Prüfen Sie den Verbrauch mit GET /api/public/usage/current und /usage/remaining oder validieren Sie vorab mit POST /usage/validate-operation.

Fehler

Fehler verwenden das Standardformat { errorCode, message, status }. Die häufigsten:

400 INVALID_REQUESTFehlender oder fehlerhafter Parameter, leere Datei oder nicht unterstützter Typ.
401 UNAUTHORIZEDAPI-Schlüssel oder JWT fehlt oder der Schlüssel wurde widerrufen.
403 PLAN_EXPIREDDer Tarif der Gruppe ist abgelaufen. Jeder Vorgang, der Kontingent verbraucht, wird abgelehnt; das Herunterladen bereits erzeugter Ergebnisse und die De-Anonymisierung bleiben verfügbar. Nicht erneut versuchen.
403 INSUFFICIENT_PERMISSIONS / FORBIDDENDer Schlüssel darf diesen Vorgang nicht ausführen oder der Benutzer hat keinen aktiven Tarif.
404 NOT_FOUNDDie Ressource existiert nicht oder gehört zu einer anderen Gruppe.
409 CONFLICTKonflikt mit dem aktuellen Zustand (z. B. doppelter Name).
413 SHEET_LIMIT_EXCEEDEDDie Tabelle überschreitet die zulässige Größe oder Anzahl an Zeilen, Spalten oder Tabellenblättern.
415 SHEET_FORMAT_UNSUPPORTEDDie an /sheets/** gesendete Datei ist keine Tabelle (xlsx, xls, ods, csv).
429Monatliches oder jährliches Tarifkontingent ausgeschöpft (errorCode FORBIDDEN mit dem Limit in der Meldung) oder Anfragelimit pro Minute erreicht (Body { error, status }).
500 INTERNAL_ERRORUnerwarteter Fehler. Wenn er weiterhin auftritt, schreiben Sie uns mit Uhrzeit und Endpunkt.
HTTP/1.1 403
Content-Type: application/json

{
  "errorCode": "PLAN_EXPIRED",
  "message": "Tu plan ha expirado. Contacta con el equipo de Politeia para renovarlo o activar un plan.",
  "status": 403
}

Verzweigen Sie anhand von errorCode, nicht anhand des Meldungstexts, der sich ändern oder übersetzt werden kann.

OpenAPI-Referenz

Generiert aus dem Backend 1.9.0 (springdoc-Gruppe „public-api“), nur /api/public/**-Routen; keine internen oder Admin-Endpunkte.

85 Operationen auf 71 Routen · OpenAPI 3.1 herunterladen (JSON). Importieren Sie sie in Postman, Insomnia, Bruno oder Ihren OpenAPI-Client-Generator. Die Beschreibungen der Endpunkte stammen aus dem API-Quellcode und sind auf Spanisch.

Anonimización de Documentos

POST/api/public/documents/anonymize-by-idsAnonimizar PDF con Patrones y Wordsets por ID

Funcionalidad Principal:

Anonimiza documentos PDF utilizando patrones regex y wordsets existentes en la base de datos,

identificados por sus IDs, junto con palabras sueltas opcionales.

Ventajas de este Endpoint:

  • Reutiliza patrones y wordsets existentes
  • Mejor rendimiento al evitar recrear patrones
  • Gestión centralizada de patrones
  • Control de acceso basado en permisos de usuario

Casos de Uso:

  • Anonimización de contratos y documentos legales
  • Protección de datos médicos en informes
  • Ocultación de información comercial confidencial
  • Preparación de documentos para auditorías
  • Procesamiento automatizado con patrones predefinidos

Proceso de Anonimización:

  • El PDF se analiza página por página
  • Se cargan los patrones regex desde la base de datos usando los IDs
  • Se cargan las palabras de los wordsets usando los IDs
  • Se combinan con las palabras sueltas proporcionadas
  • Se aplican todos los patrones y palabras para detectar información sensible
  • Las coincidencias se marcan para anonimización
  • Se genera un PDF con las zonas sensibles ocultadas

Parameter

patternIdsquery · stringIDs de patrones regex existentes en formato JSON
wordSetIdsquery · stringIDs de wordsets existentes en formato JSON
additionalWordsquery · stringPalabras sueltas adicionales en formato JSON
backgroundColorquery · stringColor de fondo para anonimización
textContentquery · stringContenido de texto para zonas anonimizadas
highQualityquery · booleanProcesamiento de alta calidad

Body multipart/form-data

file*body · fileArchivo PDF a anonimizar

Antworten

  • 200 PDF anonimizado exitosamenteapplication/pdf
  • 400 Solicitud inválida - Verificar IDs de patrones/wordsetsapplication/json
  • 401 Token JWT o API Key inválidaapplication/json
  • 403 Sin permisos para acceder a los patrones/wordsets especificadosapplication/json
  • 404 Patrones o wordsets no encontradosapplication/json
POST/api/public/documents/anonymize-patternsAnonimizar PDF con Patrones Regex Directos

Funcionalidad Principal:

Anonimiza documentos PDF utilizando patrones regex personalizados para detectar y ocultar información sensible.

Casos de Uso:

  • Anonimización de contratos y documentos legales
  • Protección de datos médicos en informes
  • Ocultación de información comercial confidencial
  • Preparación de documentos para auditorías

Proceso de Anonimización:

  • El PDF se analiza página por página
  • Se aplican los patrones regex especificados
  • Las coincidencias se marcan para anonimización
  • Se genera un PDF con las zonas sensibles ocultadas

Patrones Regex Comunes:

  • DNI español: \d{8}[A-Z]
  • Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  • Teléfono: \+?[0-9]{9,15}
  • Tarjeta crédito: \d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}

Parameter

patternsquery · stringPatrones regex en formato JSON
wordSetIdsquery · stringIDs de wordsets a aplicar
backgroundColorquery · stringColor de fondo para anonimización
textContentquery · stringContenido de texto para zonas anonimizadas
highQualityquery · booleanProcesamiento de alta calidad

Body multipart/form-data

file*body · fileArchivo PDF a anonimizar

Antworten

  • 200 PDF anonimizado exitosamenteapplication/pdf
  • 400 Solicitud inválidaapplication/json
  • 401 Token JWT o API Key inválidaapplication/json

Documentos clásicos (API pública)

POST/api/public/documents/anonymizeAnonimizar (compatibilidad)

Parameter

patternsquery · string
redactionZonesquery · string
highQualityquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/pdf
POST/api/public/documents/anonymize-completeAnonimización completa (patrones + zonas)

Parameter

patternsquery · string
redactionZones*query · string
wordSetIdsquery · integer[]
wordSetMatchModequery · string
highQualityquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/pdf
POST/api/public/documents/anonymize-complete-inverseAnonimización completa inversa

Parameter

patternsquery · string
redactionZones*query · string
wordSetIdsquery · integer[]
wordSetMatchModequery · string
excludePatternsquery · string
excludeWordSetIdsquery · integer[]
excludeWordSetMatchModequery · string
highQualityquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/pdf
POST/api/public/documents/anonymize-specific-zonesAnonimizar zonas específicas (IA / coordenadas)

Parameter

zones*query · string
highQualityquery · boolean
backgroundColorquery · string
textContentquery · string
censorHeightPadPxquery · integer
aiOptionsquery · string
customWordsquery · string
patternsquery · string
wordSetIdsquery · string
wordSetMatchModequery · string
pageOrientationsquery · string
ocrPreprocessquery · boolean
autoOcrquery · boolean
excludePatternsquery · string
excludeWordSetIdsquery · integer[]
excludeWordSetMatchModequery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/pdf
POST/api/public/documents/anonymize-whitelistAnonimización por lista blanca

Parameter

redactionZones*query · string
whitelistPatternsquery · string
whitelistWordSetIdsquery · integer[]
whitelistWordSetMatchModequery · string
detectPatternquery · string
backgroundColorquery · string
textContentquery · string
highQualityquery · boolean
censorHeightPadPxquery · integer
whitelistSuppressionsquery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/pdf
POST/api/public/documents/anonymize-zonesAnonimizar solo zonas

Parameter

redactionZones*query · string
highQualityquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/pdf
POST/api/public/documents/previewPreview de anonimización

Parameter

patternsquery · string
redactionZonesquery · string
wordSetIdsquery · string
wordSetMatchModequery · string
excludePatternsquery · string
excludeWordSetIdsquery · integer[]
excludeWordSetMatchModequery · string
ocrPreprocessquery · boolean
autoOcrquery · boolean
highQualityquery · boolean
backgroundColorquery · string
textContentquery · string
censorHeightPadPxquery · integer

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/json
POST/api/public/documents/preview-inversePreview inversa (lista blanca)

Parameter

redactionZonesquery · string
whitelistPatternsquery · string
whitelistWordSetIdsquery · integer[]
whitelistWordSetMatchModequery · string
ocrPreprocessquery · boolean
autoOcrquery · boolean
highQualityquery · boolean
backgroundColorquery · string
textContentquery · string
censorHeightPadPxquery · integer

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/json
POST/api/public/documents/result/searchableResultado buscable (OCR sobre PDF anonimizado)

Body multipart/form-data

file*body · file

Antworten

  • 200 OK

Expedientes (API pública)

GET/api/public/casesListar los expedientes visibles para la clave

Del usuario de la clave o compartidos con su grupo, con recuentos por estado.

Antworten

  • 200 OK
GET/api/public/cases/{id}Estado de un expediente y de cada documento

UPLOADED, QUEUED, PROCESSING, DONE o FAILED por documento.

Parameter

id*path · integer

Antworten

  • 200 OK
GET/api/public/cases/{id}/downloadDescargar el expediente anonimizado en un ZIP

Documentos terminados e índice CSV/PDF sin datos personales; mapas pseudo solo como LEEME. 204 si no hay documentos terminados.

Parameter

id*path · integer

Antworten

  • 200 OK

Formatos (API pública)

POST/api/public/formats/email/analyzeAnalizar un correo (.eml/.msg)

Cabeceras, cuerpo y adjuntos. Sin cupo.

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/formats/email/anonymizeAnonimizar un correo (.eml/.msg) con sus adjuntos

ZIP (base64) con el correo en PDF, los adjuntos anonimizados y, con includeEml, el .eml.

Body multipart/form-data

file*body · file
optionsbody · FormatOptionsForm

Antworten

  • 200 OK
POST/api/public/formats/tiff/from-pdfPDF anonimizado → TIFF multipágina

Cupo de herramientas PDF.

Parameter

dpiquery · integer
colorModequery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/formats/word/editableWord editable (.docx/.odt)

Documento con los datos sustituidos en el propio texto, verificado contra fugas.

Body multipart/form-data

file*body · file
optionsbody · FormatOptionsForm

Antworten

  • 200 OK

Gestión de Patrones

GET/api/public/patternsObtener Todos los Patrones

Biblioteca Completa de Patrones:

Lista paginada de todos los patrones regex disponibles para el usuario.

Información Incluida:

  • 🆔 ID único del patrón
  • Nombre y descripción
  • Expresión regex
  • Estadísticas de uso
  • Estado activo/inactivo
  • Fecha de creación y modificación

Parameter

pagequery · integerNúmero de página (empezando en 1)
sizequery · integerElementos por página

Antworten

  • 200 OK
POST/api/public/patternsCrear Nuevo Patrón

Creación de Patrón Personalizado:

Permite crear un nuevo patrón regex personalizado para detección de información sensible.

Campos Requeridos:

  • Nombre descriptivo
  • Expresión regex válida
  • Descripción del propósito
  • Tipo/categoría del patrón

Body application/json · PatternRequestDTO

Antworten

  • 200 OK
GET/api/public/patterns/{id}Obtener Patrón por ID

Detalles Completos del Patrón:

Obtiene toda la información de un patrón específico incluyendo metadatos y estadísticas.

Parameter

id*path · integer🆔 ID único del patrón

Antworten

  • 200 OK
PUT/api/public/patterns/{id}Actualizar Patrón Existente

Modificación de Patrón:

Permite actualizar un patrón existente modificando cualquiera de sus propiedades.

Parameter

id*path · integer🆔 ID del patrón a actualizar

Body application/json · PatternRequestDTO

Antworten

  • 200 OK
DELETE/api/public/patterns/{id}Eliminar Patrón

Eliminación de Patrón:

Elimina permanentemente un patrón de la biblioteca del usuario.

Advertencia:Esta acción no se puede deshacer.

Parameter

id*path · integer🆔 ID del patrón a eliminar

Antworten

  • 200 OK

Gestión de Wordsets

GET/api/public/wordsetsObtener Todos los Wordsets

Biblioteca Completa de Wordsets:

Lista todos los diccionarios de palabras disponibles para el usuario.

Información Incluida:

  • 🆔 ID único del wordset
  • Nombre y descripción
  • Número de palabras
  • Categoría/tipo
  • Estado activo
  • Última actualización

Antworten

  • 200 OK
POST/api/public/wordsetsCrear Nuevo Wordset

Creación de Diccionario:

Permite crear un nuevo wordset personalizado con una lista de palabras.

Campos Requeridos:

  • Nombre descriptivo
  • Descripción del propósito
  • Lista inicial de palabras
  • Categoría del wordset

Body application/json · WordSetRequestDTO

Antworten

  • 200 OK
GET/api/public/wordsets/{id}Obtener Wordset por ID

Detalles Completos del Wordset:

Obtiene toda la información de un wordset incluyendo la lista completa de palabras.

Parameter

id*path · integer🆔 ID único del wordset

Antworten

  • 200 OK
PUT/api/public/wordsets/{id}Actualizar Wordset

Modificación de Wordset:

Permite actualizar un wordset existente incluyendo su lista de palabras.

Parameter

id*path · integer🆔 ID del wordset a actualizar

Body application/json · WordSetRequestDTO

Antworten

  • 200 OK
DELETE/api/public/wordsets/{id}Eliminar Wordset

Eliminación de Wordset:

Elimina permanentemente un wordset y todas sus palabras asociadas.

Advertencia:Esta acción no se puede deshacer.

Parameter

id*path · integer🆔 ID del wordset a eliminar

Antworten

  • 200 OK
GET/api/public/wordsets/{id}/wordsObtener Palabras de Wordset

Lista de Palabras:

Obtiene todas las palabras de un wordset específico con paginación.

Parameter

id*path · integer🆔 ID del wordset
pagequery · integerNúmero de página
sizequery · integerElementos por página
searchquery · stringBúsqueda por subcadena (opcional)

Antworten

  • 200 OK
POST/api/public/wordsets/{id}/wordsAgregar Palabra a Wordset

Gestión de Palabras Individual:

Agrega una nueva palabra a un wordset existente.

Parameter

id*path · integer🆔 ID del wordset
word*query · stringPalabra a agregar

Antworten

  • 200 OK
DELETE/api/public/wordsets/{id}/wordsEliminar Palabra de Wordset

Gestión de Palabras Individual:

Elimina una palabra específica de un wordset.

Parameter

id*path · integer🆔 ID del wordset
word*query · stringPalabra a eliminar

Antworten

  • 200 OK

Hojas de cálculo por columnas (API pública)

POST/api/public/sheets/analyzeAnalizar las columnas de una hoja de cálculo (xlsx, xls, ods, csv)

Cabecera, muestra y tipo sugerido por columna. Sin cupo.

Parameter

hasHeaderquery · boolean
sampleRowsquery · integer
useAiquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/sheets/previewVista previa del tratamiento por columnas

Sin cupo.

Body multipart/form-data

file*body · file
optionsbody · SheetOptionsForm

Antworten

  • 200 OK
POST/api/public/sheets/processTratar una hoja de cálculo por columnas

Mismo formato de salida; cupo: 1 página por cada 50 filas de datos.

Body multipart/form-data

file*body · file
optionsbody · SheetOptionsForm

Antworten

  • 200 OK

Inteligencia Artificial

POST/api/public/ai/anonymizeAnonimizar documento con IA

Mismos parámetros que /ai/anonymize. Valida y registra uso de IA del grupo.

Parameter

aiOptions*query · string
zonesquery · string
highQualityquery · boolean
backgroundColorquery · string
textContentquery · string
censorHeightPadPxquery · integer

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
GET/api/public/ai/optionsOpciones de anonimización con IA

Lista las opciones disponibles del motor de IA (mismas que /ai/options).

Antworten

  • 200 OK
POST/api/public/ai/previewPreview de anonimización con IA

Mismos parámetros que /ai/preview. Requiere X-API-Key o JWT.

Parameter

aiOptions*query · string
highQualityquery · boolean
backgroundColorquery · string
textContentquery · string
censorHeightPadPxquery · integer
customWordsquery · string
patternsquery · string
wordSetIdsquery · string
ocrPreprocessquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OK

Lotes (API pública)

GET/api/public/batch-jobsListar trabajos del usuario

Antworten

  • 200 OK
POST/api/public/batch-jobsEncolar lote de documentos

Parameter

config*query · string
configsquery · string
signatureHintsquery · string

Body multipart/form-data

files*body · file[]

Antworten

  • 200 OK
DELETE/api/public/batch-jobs/{id}Eliminar trabajo

Parameter

id*path · integer

Antworten

  • 200 OK
GET/api/public/batch-jobs/{id}/outputDescargar PDF de un trabajo

Parameter

id*path · integer

Antworten

  • 200 OK
GET/api/public/batch-jobs/{id}/output-bundleDescargar bundle ZIP de un trabajo pseudo

El mapa nunca va en claro: con la cabecera X-Map-Password se incluye cifrado (<documento>_pseudo-map.enc, mismo formato que /pseudo/export?format=enc); sin ella, solo LEEME-mapa.txt.

Parameter

id*path · integer
X-Map-Passwordheader · string

Antworten

  • 200 OK
GET/api/public/batch-jobs/download-completedDescargar ZIP de trabajos completados

X-Map-Password (opcional) cifra los mapas pseudo incluidos. Un trabajo cuyo mapa no está en la bóveda y llega sin contraseña se conserva en la cola para no perder el mapa.

Parameter

X-Map-Passwordheader · string

Antworten

  • 200 OK

Patrones de figura (API pública)

GET/api/public/figure-patternsListar patrones de figura del usuario

Antworten

  • 200 OK
POST/api/public/figure-patternsCrear patrón de figura

Body application/json · CreateFigurePatternDTO

Antworten

  • 200 OK
GET/api/public/figure-patterns/{id}Obtener patrón de figura por ID

Parameter

id*path · integer

Antworten

  • 200 OK
PUT/api/public/figure-patterns/{id}Actualizar patrón de figura

Parameter

id*path · integer

Body application/json · CreateFigurePatternDTO

Antworten

  • 200 OK
DELETE/api/public/figure-patterns/{id}Eliminar patrón de figura

Parameter

id*path · integer

Antworten

  • 200 OK
GET/api/public/figure-patterns/{id}/zonesZonas del patrón como RedactionZoneDTO

Parameter

id*path · integer

Antworten

  • 200 OK

PDF tools (API pública)

POST/api/public/pdf-tools/analyze-text-layerAnalizar capa de texto del PDF

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/json
POST/api/public/pdf-tools/compressComprimir un PDF

Recomprime las imágenes embebidas a JPEG y reduce su resolución efectiva sin tocar el texto vectorial. level: low (calidad 0.85, máx. 200 ppp), medium (0.7, 150 ppp, por defecto) o high (0.5, 100 ppp). Si el resultado no es más pequeño se devuelve el original. Cabeceras X-Original-Size y X-Compressed-Size en bytes.

Parameter

levelquery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pdf-tools/convert-to-pdfConvertir documento/imagen a PDF

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pdf-tools/images-to-pdfImágenes a PDF

Parameter

files*query · file[]

Antworten

  • 200 OK
POST/api/public/pdf-tools/mergeFusionar PDFs

Parameter

files*query · file[]

Antworten

  • 200 OK
POST/api/public/pdf-tools/metadataEditar los metadatos de un PDF

metadata: JSON con los campos de /metadata/read; un campo null o vacío se borra. custom null conserva los personalizados y un objeto los sustituye (un valor null o vacío no se escribe). removeAll=true borra antes Info, XMP y personalizados. El XMP se elimina siempre para que no contradiga los valores nuevos.

Parameter

metadataquery · string
removeAllquery · boolean

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pdf-tools/metadata/readLeer los metadatos de un PDF

Devuelve título, autor, asunto, palabras clave, creador, productor, fechas de creación y modificación (ISO-8601 o null) y los campos personalizados (custom). No consume cupo.

Body multipart/form-data

file*body · file

Antworten

  • 200 OKapplication/json
POST/api/public/pdf-tools/page-numbersNumerar las páginas de un PDF

position: bottom-center (por defecto), bottom-right, bottom-left, top-center, top-right o top-left, sobre la página tal como se ve (respeta el giro). format: plantilla con {n} (número de página + startNumber - 1) y {total} (páginas del documento), p. ej. "Página {n} de {total}"; por defecto {n}. startNumber: número que corresponde a la página 1 (1). fontSize: 6–48 (11). margin: distancia al borde en puntos (24). pages: páginas a numerar ("2-10"); vacía = todas.

Parameter

positionquery · string
formatquery · string
startNumberquery · integer
fontSizequery · integer
marginquery · number
pagesquery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pdf-tools/pdf-to-imagesConvertir páginas de un PDF a imágenes

format: jpg (por defecto) o png. dpi: 72–300 (por defecto 150). pages: expresión opcional ("1-3,5"); vacía = todas. Una sola página devuelve la imagen (pagina-N.jpg); varias, un ZIP paginas-imagenes.zip con pagina-001.jpg, pagina-002.jpg...

Parameter

formatquery · string
dpiquery · integer
pagesquery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pdf-tools/pdf-to-searchable-pdfPDF a PDF buscable (OCR)

Parameter

pagesquery · integer[]

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pdf-tools/splitExtraer páginas de un PDF

Parameter

pages*query · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK

Plan y uso

GET/api/public/dashboardDashboard del plan/uso del grupo

Antworten

  • 200 OK
GET/api/public/permissionsPermisos del grupo de la API key

Antworten

  • 200 OK
GET/api/public/planPlan del grupo asociado a la API key

Devuelve el plan/límites del grupo Anonimatum vinculado a la API key.

Antworten

  • 200 OK
GET/api/public/usage/currentUso del mes actual del grupo

Documentos/páginas consumidos en el mes en curso para el grupo de la API key.

Antworten

  • 200 OK
GET/api/public/usage/historyHistorial de uso del grupo

Antworten

  • 200 OK
GET/api/public/usage/remainingUso restante del mes

Antworten

  • 200 OK
POST/api/public/usage/validate-operationValidar si una operación está permitida

Parameter

operationType*query · string

Antworten

  • 200 OK

Pseudoanonimización (API pública)

POST/api/public/pseudo/anonymizePseudoanonimizar documento

outputMode: RASTER_TEXT (defecto) o VECTOR. Devuelve verification, vaultStored y contextId.

Parameter

profileIdquery · string
pseudoMethodquery · string
seedquery · string
projectIdquery · string
patternsquery · string
wordSetIdsquery · string
wordSetMatchModequery · string
aiOptionsquery · string
customWordsquery · string
excludePatternsquery · string
excludeWordSetIdsquery · string
excludeWordSetMatchModequery · string
exclusionWordsquery · string
excludeOfficeOccurrencesquery · string
highQualityquery · boolean
selectedOriginalsquery · string
replacementOverridesquery · string
redactionZonesquery · string
ocrPreprocessquery · boolean
autoOcrquery · boolean
outputModequery · string
methodsByTypequery · string
languagequery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
GET/api/public/pseudo/config/defaultsDefaults de configuración

Antworten

  • 200 OK
GET/api/public/pseudo/contextsContextos de la bóveda visibles para el usuario

Parameter

projectIdquery · string

Antworten

  • 200 OK
DELETE/api/public/pseudo/contexts/{contextId}Borrar un contexto de la bóveda

Parameter

contextId*path · string

Antworten

  • 200 OK
POST/api/public/pseudo/deanonymizeDesanonimizar con mapa o con contextId de la bóveda

Parameter

X-Map-Passwordheader · string
passwordquery · string
highQualityquery · boolean
contextIdquery · string

Body multipart/form-data

file*body · file
mapbody · file

Antworten

  • 200 OK
GET/api/public/pseudo/export/{contextId}Exportar mapa de contexto

Parameter

contextId*path · string
formatquery · string
X-Map-Passwordheader · string
passwordquery · string

Antworten

  • 200 OK
GET/api/public/pseudo/lookup/{contextId}Lookup valor original desde pseudo

Parameter

contextId*path · string
value*query · string

Antworten

  • 200 OK
POST/api/public/pseudo/previewPreview de pseudoanonimización

methodsByType: JSON {"<EntityType>":"<modo>"}; language: es|en|ca|gl|eu|ro.

Parameter

profileIdquery · string
pseudoMethodquery · string
seedquery · string
projectIdquery · string
patternsquery · string
wordSetIdsquery · string
wordSetMatchModequery · string
aiOptionsquery · string
customWordsquery · string
excludePatternsquery · string
excludeWordSetIdsquery · string
excludeWordSetMatchModequery · string
selectedOriginalsquery · string
replacementOverridesquery · string
redactionZonesquery · string
ocrPreprocessquery · boolean
autoOcrquery · boolean
outputModequery · string
methodsByTypequery · string
languagequery · string

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
POST/api/public/pseudo/preview-documentPrevisualizar una página pseudoanonimizada (application/pdf)

Mismos parámetros que /anonymize más page (1-based). Sin bóveda ni cuota. Solo PDF/imagen.

Parameter

profileIdquery · string
pseudoMethodquery · string
seedquery · string
projectIdquery · string
patternsquery · string
wordSetIdsquery · string
wordSetMatchModequery · string
aiOptionsquery · string
customWordsquery · string
excludePatternsquery · string
excludeWordSetIdsquery · string
excludeWordSetMatchModequery · string
highQualityquery · boolean
selectedOriginalsquery · string
replacementOverridesquery · string
redactionZonesquery · string
ocrPreprocessquery · boolean
autoOcrquery · boolean
outputModequery · string
methodsByTypequery · string
languagequery · string
pagequery · integer

Body multipart/form-data

file*body · file

Antworten

  • 200 OK
GET/api/public/pseudo/profilesListar perfiles de pseudoanonimización

Antworten

  • 200 OK
GET/api/public/pseudo/profiles/{id}Detalle de perfil

Parameter

id*path · string

Antworten

  • 200 OK

Webhooks (API pública)

GET/api/public/webhooksWebhooks de esta API key

Antworten

  • 200 OK
POST/api/public/webhooksCrear webhook

Eventos: batch.completed, batch.failed, publication.completed, publication.failed. Devuelve el secreto de firma una sola vez. Firma: X-Anonimatum-Signature t=<unix>,v1=<hex HMAC-SHA256(secreto, t.cuerpo)>; rechaza marcas de más de 5 minutos.

Body application/json · WebhookRequest

Antworten

  • 200 OK
PUT/api/public/webhooks/{id}Cambiar webhook

Parameter

id*path · integer

Body application/json · WebhookRequest

Antworten

  • 200 OK
DELETE/api/public/webhooks/{id}Borrar webhook

Parameter

id*path · integer

Antworten

  • 200 OK
GET/api/public/webhooks/{id}/deliveriesRegistro de entregas

Parameter

id*path · integer
limitquery · integer

Antworten

  • 200 OK
POST/api/public/webhooks/{id}/rotate-secretNuevo secreto de firma

Parameter

id*path · integer

Antworten

  • 200 OK
POST/api/public/webhooks/{id}/testEnviar prueba

Parameter

id*path · integer

Antworten

  • 200 OK

Webhooks

Ein Webhook benachrichtigt Ihr System per signiertem JSON-POST, wenn ein Batch aus der Warteschlange oder eine Veröffentlichung abgeschlossen ist. Die Benachrichtigung enthält niemals Dateinamen, Titel, Text oder E-Mail-Adressen: nur Kennungen, Status und bei Batches einen Download-Link, den Sie mit Ihrem API-Schlüssel verwenden.

Ereignisse

batch.completedEin Job aus der Warteschlange wird erfolgreich abgeschlossen: jobId, pages und download.url (GET mit X-API-Key).
batch.failedEin Job aus der Warteschlange schlägt fehl: jobId und errorCategory (PLAN_EXPIRED, QUOTA, PERMISSION oder PROCESSING), nie die Meldung.
publication.completedEine Veröffentlichung in einem Aktenverwaltungssystem oder Portal ist erfolgreich: publicationId, Ziel, HTTP-Status und SHA-256.
publication.failedEine Veröffentlichung schlägt fehl, mit denselben Feldern.
webhook.testNur wenn Sie auf „Test senden“ klicken oder /{id}/test aufrufen; es kann nicht abonniert werden.

Registrierung mit Ihrem API-Schlüssel

POST /api/public/webhooks gibt das Secret (whsec_…) nur einmal zurück; speichern Sie es als Umgebungsvariable. Ein mit einem API-Schlüssel erstellter Webhook erhält nur die Ereignisse des Benutzers dieses Schlüssels; der Gruppenadministrator kann gruppenweite Webhooks im App-Panel anlegen. Außerdem: GET, PUT und DELETE /{id}, POST /{id}/rotate-secret, POST /{id}/test und GET /{id}/deliveries. Bis zu 10 pro Gruppe; die URL muss https verwenden.

curl -X POST https://api.anonimatum.com/api/public/webhooks \
  -H "X-API-Key: $ANONIMATUM_API_KEY" -H "Content-Type: application/json" \
  -d '{"url":"https://erp.ejemplo.es/anonimatum/webhook","events":["batch.completed","batch.failed"]}'

Signatur prüfen

Jede Benachrichtigung enthält den Header X-Anonimatum-Signature: t=<unix>,v1=<hex>, wobei v1 ein HMAC-SHA256 mit dem vollständigen Secret (einschließlich des Präfixes whsec_) als Schlüssel über „t.body“ ist. Außerdem werden X-Anonimatum-Event, X-Anonimatum-Event-Id und X-Anonimatum-Delivery gesendet.

  1. Lesen Sie den Roh-Body, ohne das JSON zu parsen oder neu zu formatieren.
  2. Trennen Sie t und v1 aus dem Header und lehnen Sie die Benachrichtigung ab, wenn t mehr als 300 Sekunden von Ihrer Uhr abweicht.
  3. Berechnen Sie HMAC-SHA256(secret, t + "." + body) als Hex und vergleichen Sie es in konstanter Zeit mit v1.
  4. Deduplizieren Sie anhand von X-Anonimatum-Event-Id: Ein Wiederholungsversuch trägt dieselbe ID.
  5. Antworten Sie innerhalb von 5 Sekunden mit 2xx und verarbeiten Sie danach.

Node.js (Express)

import crypto from "node:crypto";
import express from "express";

const app = express();
const SECRET = process.env.ANONIMATUM_WEBHOOK_SECRET; // whsec_… completo

app.post("/anonimatum/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const parts = Object.fromEntries(
    (req.get("X-Anonimatum-Signature") ?? "").split(",").map((p) => p.split("=", 2))
  );
  const t = Number(parts.t);
  if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > 300) return res.sendStatus(400);
  const expected = crypto.createHmac("sha256", SECRET).update(t + ".").update(req.body).digest("hex");
  const given = Buffer.from(parts.v1 ?? "", "utf8");
  const ok = given.length === expected.length && crypto.timingSafeEqual(Buffer.from(expected, "utf8"), given);
  if (!ok) return res.sendStatus(401);
  // Deduplica por req.get("X-Anonimatum-Event-Id") y procesa después.
  res.sendStatus(204);
});

Python (Flask)

import hashlib, hmac, os, time
from flask import Flask, abort, request

app = Flask(__name__)
SECRET = os.environ["ANONIMATUM_WEBHOOK_SECRET"].encode()  # whsec_… completo

@app.post("/anonimatum/webhook")
def webhook():
    body = request.get_data()  # cuerpo crudo, sin parsear
    header = request.headers.get("X-Anonimatum-Signature", "")
    parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
    try:
        t = int(parts["t"])
    except (KeyError, ValueError):
        abort(400)
    if abs(time.time() - t) > 300:
        abort(400)
    expected = hmac.new(SECRET, f"{t}.".encode() + body, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, parts.get("v1", "")):
        abort(401)
    # Deduplica por request.headers["X-Anonimatum-Event-Id"] y procesa después.
    return "", 204

Jede Antwort außer 2xx (Weiterleitungen werden nicht verfolgt) oder eine Antwort, die länger als 5 Sekunden dauert, gilt als Fehlschlag. Nach dem ersten Versuch erfolgen Wiederholungen nach 1 Min., 5 Min., 30 Min., 2 Std. und 6 Std. (insgesamt 6 Versuche); das Zustellprotokoll zeigt Status, HTTP-Code und nächsten Versuch.

Wenn Sie keinen Endpunkt bereitstellen möchten, fragen Sie den Batch-Status mit GET /api/public/batch-jobs ab und laden Sie abgeschlossene Jobs mit GET /api/public/batch-jobs/{id}/output herunter.

MCP-Connector für KI-Assistenten

Anonimatum stellt dieselbe API als MCP-Server (Model Context Protocol) bereit. Der Assistent handelt als Ihr Benutzer und Ihre Gruppe, nachdem Sie ihn in der App autorisiert haben.

URL des MCP-Servers

https://gateway.politeiasoft.com/anonimatum/mcp

Claude
Fügen Sie unter claude.ai → Einstellungen → Connectors einen benutzerdefinierten Connector mit der MCP-URL hinzu und autorisieren Sie den Zugriff auf dem Zustimmungsbildschirm von Anonimatum.
ChatGPT
Fügen Sie unter chatgpt.com → Einstellungen → Connectors die MCP-URL hinzu und schließen Sie die OAuth-Autorisierung ab. Die Verfügbarkeit benutzerdefinierter Connectors hängt von Ihrem ChatGPT-Tarif ab.
Grok
Fügen Sie unter grok.com → Connectors die MCP-URL hinzu und autorisieren Sie den Zugriff.
Cursor, Claude Code und andere MCP-Clients
Unterstützt der Client OAuth mit lokaler Weiterleitung, genügt die URL. Andernfalls nutzen Sie die manuelle Freigabe in der App (Profil → Connectors): Sie erhalten ein Token und eine einfügefertige mcp.json.

Bereitgestellte Tools

  • listar_operaciones — Listet die für Ihren Benutzer verfügbaren Vorgänge auf (gleicher Katalog wie die Referenz, ohne Admin- oder interne Endpunkte).
  • describir_operacion — Methode, Pfad, Parameter und Art der Dateiübermittlung für einen Vorgang.
  • ejecutar_operacion — Führt einen Vorgang aus; binäre Antworten enthalten einen einmalig nutzbaren Download-Link.
  • iniciar_subida_fichero — Liefert eine einmalig nutzbare Upload-URL, empfohlen für große Dokumente (bis 250 MB).
  • subir_fichero — Lädt eine kleine Datei als Base64 in einem einzigen Aufruf hoch.
  • iniciar_subida_por_partes / subir_parte_fichero — Upload in Teilen für Clients, die keinen direkten POST ausführen können.

Irreversible Vorgänge (Löschen, De-Anonymisieren) erfordern die ausdrückliche Bestätigung des Benutzers im selben Schritt. Bei abgelaufenem Tarif erhält der Assistent PLAN_EXPIRED und muss die Meldung ohne erneuten Versuch weitergeben. Jede Verbindung können Sie unter Profil → Connectors widerrufen.

Beispiel für mcp.json (manuelle Freigabe)

{
  "mcpServers": {
    "anonimatum": {
      "url": "https://gateway.politeiasoft.com/anonimatum/mcp",
      "headers": { "Authorization": "Bearer <token de la concesión manual>" }
    }
  }
}

SDK

Zugang auf Anfrage

Offizielle SDKs für Python (synchron und asyncio) und TypeScript/JavaScript (Node 18+), basierend auf genau dieser Referenz. Das Repository ist privat: Fordern Sie den Zugang bei Politeia über das Kontaktformular an. Sie können auch einen Client aus der OpenAPI-Datei generieren.

SDK-Repository (privat)

Brauchen Sie Hilfe bei Ihrer Integration?

Schildern Sie uns Ihren Fall (Dokumentenmanagementsystem, Volumen, Formate), und wir helfen Ihnen, den Ablauf zu gestalten.