OpenAPI 3.0 Specification
Download JSON{
"openapi": "3.0.3",
"info": {
"title": "AIKDATA_AI",
"description": "Native due-diligence API hosted on ms.aikdata. Generate verification tokens, manage approval workflows, and query tramite status — all processed locally.",
"version": "1.0"
},
"servers": [
{
"url": "https://ms.aikdata.com/api/gw/aikdata_ai"
}
],
"paths": {
"/generar-token": {
"post": {
"operationId": "postGenerarToken",
"summary": "Create a new tramite and receive a unique verification token",
"tags": [
"Trámites"
],
"description": "Creates a new due-diligence tramite in ms.aikdata and returns a unique token for tracking. The tramite starts in \"pendiente\" status.",
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"tipo_tramite": {
"type": "string",
"description": "Type of due-diligence process",
"example": "verificacion_identidad"
},
"solicitante": {
"type": "string",
"description": "Full name of the person being verified",
"example": "Juan Pérez García"
},
"documento": {
"type": "string",
"description": "Official document ID",
"example": "INE12345678"
},
"datos_adicionales": {
"type": "object",
"description": "Additional context data for the tramite",
"example": {
"direccion": "Calle 10 #123, CDMX",
"referencia": "CASO-2026-001"
}
},
"callback_url": {
"type": "string",
"description": "URL to receive status change notifications",
"example": "https://misitio.com/webhooks/rogbix-due"
}
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"example": {
"success": true,
"tramite_id": "trm_a1b2c3d4e5",
"token": "tkn_xyz789abc",
"status": "pendiente",
"tipo_tramite": "verificacion_identidad",
"created_at": "2026-03-19T10:00:00Z"
}
}
}
},
"400": {
"description": "Error response",
"content": {
"application/json": {
"example": {
"error": {
"code": "invalid_tipo_tramite",
"message": "The tramite type specified is not valid."
}
}
}
}
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/consultar-tramite/{token}": {
"get": {
"operationId": "getConsultarTrMite",
"summary": "Query the current status of a tramite by its token",
"tags": [
"Trámites"
],
"description": "Retrieves the full details and current status of a due-diligence tramite using the token returned by Generar Token.",
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Tramite token from Generar Token"
}
],
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"example": {
"success": true,
"tramite_id": "trm_a1b2c3d4e5",
"token": "tkn_xyz789abc",
"status": "aprobado",
"tipo_tramite": "verificacion_identidad",
"solicitante": "Juan Pérez García",
"resultado": {
"aprobado": true,
"score": 92,
"notas": "Identity verified successfully against official records."
},
"created_at": "2026-03-19T10:00:00Z",
"updated_at": "2026-03-19T10:30:00Z"
}
}
}
},
"400": {
"description": "Error response",
"content": {
"application/json": {
"example": {
"error": {
"code": "tramite_not_found",
"message": "No tramite found with the given token."
}
}
}
}
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/aprobar": {
"post": {
"operationId": "postAprobarTrMite",
"summary": "Approve or reject a pending tramite",
"tags": [
"Aprobación"
],
"description": "Updates the status of a tramite to approved or rejected. If a callback_url was provided during creation, a POST notification will be sent to the client.",
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"tramite_id": {
"type": "string",
"description": "Tramite ID from Generar Token",
"example": "trm_a1b2c3d4e5"
},
"accion": {
"type": "string",
"description": "Action to take",
"example": "aprobar"
},
"notas": {
"type": "string",
"description": "Reviewer notes",
"example": "Identity confirmed against INE database."
},
"score": {
"type": "integer",
"description": "Confidence score (0-100)",
"example": 92
}
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"example": {
"success": true,
"tramite_id": "trm_a1b2c3d4e5",
"status": "aprobado",
"callback_sent": true,
"updated_at": "2026-03-19T10:30:00Z"
}
}
}
},
"400": {
"description": "Error response",
"content": {
"application/json": {
"example": {
"error": {
"code": "invalid_action",
"message": "Action must be \"aprobar\" or \"rechazar\"."
}
}
}
}
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/analizar-kyc": {
"post": {
"operationId": "postAnalizarKyc",
"summary": "AI-powered analysis of a KYC/Due-Diligence document",
"tags": [
"Análisis"
],
"description": "Sends the text of a KYC document to ms.aikdata's internal AI engine (GPT-4.1-mini) for risk assessment. Optionally compares against expected applicant data to detect discrepancies. Returns risk level, professional opinion, and discrepancy flag.",
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"document_text": {
"type": "string",
"description": "Extracted text from the KYC/DD document (first 2 pages)",
"example": "INFORME DE DUE DILIGENCE Y KYC... Nombre: Juan Pérez, Nacionalidad: Panameña..."
},
"expected_data": {
"type": "object",
"description": "Optional: applicant data to compare against the document. If provided, the AI will detect identity discrepancies."
}
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"example": {
"opinion": "Debidamente autorizados... Nombre: Juan Pérez... Nivel de riesgo: Bajo... Justificación: Historial limpio...",
"risk_level": "Bajo",
"discrepancy": false,
"analyzed_at": "2026-03-19T10:15:00Z"
}
}
}
},
"400": {
"description": "Error response",
"content": {
"application/json": {
"example": {
"error": {
"code": "analysis_failed",
"message": "The AI analysis service is temporarily unavailable."
}
}
}
}
},
"401": {
"description": "Unauthorized"
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}