Manager e Inbox
Inbox inteligente con IA y análisis de documentos legales
curl https://app.getplea.com/api/manager/inbox \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID"
const inbox = await fetch('/api/manager/inbox', {
headers: {
'Authorization': 'Bearer TOKEN',
'x-organization-id': 'ORG_ID'
}
}).then(r => r.json());
{
"inboxEmail": "bufete-lopez@inbox.getplea.com",
"isActive": true,
"autoCreateCases": false,
"totalEmails": 47,
"pendingEmails": 3
}
curl "https://app.getplea.com/api/manager/emails?status=pending" \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID"
const emails = await fetch('/api/manager/emails?status=pending', {
headers: {
'Authorization': 'Bearer TOKEN',
'x-organization-id': 'ORG_ID'
}
}).then(r => r.json());
[
{
"id": "email-uuid-1",
"from": "cliente@email.com",
"fromName": "Roberto García",
"subject": "Consulta sobre reclamación de cantidad",
"receivedAt": "2026-03-07T08:30:00Z",
"status": "pending",
"aiAnalysis": {
"summary": "El remitente solicita asesoramiento para reclamar una deuda de 15.000€ a un proveedor que no ha pagado facturas.",
"suggestedCaseType": "civil",
"urgency": "medium",
"suggestedActions": [
"Crear expediente de reclamación de cantidad",
"Solicitar facturas impagadas al cliente"
]
},
"attachments": [
{
"name": "facturas_impagadas.pdf",
"size": 245000
}
]
}
]
curl https://app.getplea.com/api/manager/emails/email-uuid-1 \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID"
const email = await fetch('/api/manager/emails/email-uuid-1', {
headers: {
'Authorization': 'Bearer TOKEN',
'x-organization-id': 'ORG_ID'
}
}).then(r => r.json());
{
"id": "email-uuid-1",
"from": "cliente@email.com",
"fromName": "Roberto García",
"subject": "Consulta sobre reclamación de cantidad",
"body": "Buenos días, me gustaría consultar sobre una reclamación...",
"htmlBody": "<p>Buenos días, me gustaría consultar...</p>",
"receivedAt": "2026-03-07T08:30:00Z",
"status": "pending",
"aiAnalysis": {
"summary": "Solicita asesoramiento para reclamar deuda de 15.000€",
"suggestedCaseType": "civil",
"urgency": "medium",
"suggestedClient": {
"name": "Roberto García",
"email": "cliente@email.com"
},
"suggestedCaseData": {
"caseType": "civil",
"description": "Reclamación de cantidad por impago",
"opposingParty": "Proveedor (pendiente de identificar)"
},
"suggestedResponse": "Estimado Roberto, he recibido su consulta..."
}
}
curl -X POST https://app.getplea.com/api/manager/emails/email-uuid-1/approve \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-H "x-organization-id: ORG_ID" \
-d '{"createCase": true, "createClient": true}'
const result = await fetch('/api/manager/emails/email-uuid-1/approve', {
method: 'POST',
headers: {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json',
'x-organization-id': 'ORG_ID'
},
body: JSON.stringify({ createCase: true, createClient: true })
}).then(r => r.json());
{
"emailId": "email-uuid-1",
"status": "approved",
"createdCase": {
"id": "case-uuid-new",
"caseNumber": "2026/0101",
"caseType": "civil"
},
"createdClient": {
"id": "client-uuid-new",
"name": "Roberto García",
"email": "cliente@email.com"
}
}
curl -X POST https://app.getplea.com/api/manager/emails/email-uuid-1/reject \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-H "x-organization-id: ORG_ID" \
-d '{"reason": "Spam / correo no relevante"}'
await fetch('/api/manager/emails/email-uuid-1/reject', {
method: 'POST',
headers: {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json',
'x-organization-id': 'ORG_ID'
},
body: JSON.stringify({ reason: 'Spam / correo no relevante' })
});
{
"emailId": "email-uuid-1",
"status": "rejected"
}
curl -X POST https://app.getplea.com/api/manager/emails/email-uuid-1/reanalyze \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID"
await fetch('/api/manager/emails/email-uuid-1/reanalyze', {
method: 'POST',
headers: {
'Authorization': 'Bearer TOKEN',
'x-organization-id': 'ORG_ID'
}
});
{
"emailId": "email-uuid-1",
"status": "reanalyzing",
"message": "El análisis IA se ha iniciado. Puede tardar unos segundos."
}
curl https://app.getplea.com/api/doc-analysis/clients \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID"
const clients = await fetch('/api/doc-analysis/clients', {
headers: {
'Authorization': 'Bearer TOKEN',
'x-organization-id': 'ORG_ID'
}
}).then(r => r.json());
[
{
"id": "dac-uuid-1",
"name": "Aseguradora Nacional S.A.",
"documentsCount": 45,
"questionsCount": 8,
"lastAnalysis": "2026-03-06T14:00:00Z"
}
]
curl -X POST https://app.getplea.com/api/doc-analysis/clients \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-H "x-organization-id: ORG_ID" \
-d '{"name": "Mutua Profesional"}'
const client = await fetch('/api/doc-analysis/clients', {
method: 'POST',
headers: {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json',
'x-organization-id': 'ORG_ID'
},
body: JSON.stringify({ name: 'Mutua Profesional' })
}).then(r => r.json());
{
"id": "dac-uuid-new",
"name": "Mutua Profesional",
"documentsCount": 0,
"questionsCount": 0,
"createdAt": "2026-03-07T12:00:00Z"
}
curl -X POST https://app.getplea.com/api/doc-analysis/clients/dac-uuid-1/questions \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-H "x-organization-id: ORG_ID" \
-d '{
"questions": [
{"text": "¿Cuál es el importe de la indemnización?", "type": "number"},
{"text": "¿Qué fecha tiene la sentencia?", "type": "date"},
{"text": "¿Es favorable al demandante?", "type": "boolean"},
{"text": "Resumen del fallo", "type": "text"}
]
}'
await fetch('/api/doc-analysis/clients/dac-uuid-1/questions', {
method: 'POST',
headers: {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json',
'x-organization-id': 'ORG_ID'
},
body: JSON.stringify({
questions: [
{ text: '¿Cuál es el importe de la indemnización?', type: 'number' },
{ text: '¿Qué fecha tiene la sentencia?', type: 'date' },
{ text: '¿Es favorable al demandante?', type: 'boolean' },
{ text: 'Resumen del fallo', type: 'text' }
]
})
});
{
"clientId": "dac-uuid-1",
"questions": [
{"id": "q-1", "text": "¿Cuál es el importe de la indemnización?", "type": "number"},
{"id": "q-2", "text": "¿Qué fecha tiene la sentencia?", "type": "date"},
{"id": "q-3", "text": "¿Es favorable al demandante?", "type": "boolean"},
{"id": "q-4", "text": "Resumen del fallo", "type": "text"}
]
}
curl -X POST https://app.getplea.com/api/doc-analysis/clients/dac-uuid-1/documents \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID" \
-F "files=@sentencia_001.pdf" \
-F "files=@sentencia_002.pdf"
{
"uploaded": 2,
"documents": [
{
"id": "doc-a-uuid-1",
"filename": "sentencia_001.pdf",
"status": "analyzing",
"answers": []
},
{
"id": "doc-a-uuid-2",
"filename": "sentencia_002.pdf",
"status": "analyzing",
"answers": []
}
],
"message": "Análisis en curso. Los resultados estarán disponibles en unos minutos."
}
curl "https://app.getplea.com/api/doc-analysis/clients/dac-uuid-1/export" \
-H "Authorization: Bearer TOKEN" \
-H "x-organization-id: ORG_ID" \
-o analisis_resultados.csv
Content-Type: text/csv
Content-Disposition: attachment; filename="analisis-dac-uuid-1.csv"
documento,indemnizacion,fecha_sentencia,favorable,resumen
sentencia_001.pdf,15000.00,2026-01-15,Sí,"Sentencia favorable. Se condena al demandado..."
sentencia_002.pdf,8500.00,2026-02-20,No,"Sentencia desestimatoria. Se absuelve..."
Endpoints del módulo PLEA Manager: inbox inteligente para correos entrantes con análisis IA, y el analizador de documentos legales con preguntas personalizables.
Inbox inteligente
GET /api/manager/inbox
Obtiene la configuración del inbox y la dirección de email asignada.
GET /api/manager/emails
Lista los correos recibidos en el inbox.
Filtrar: pending, approved, rejected.
Máximo de resultados. Default: 50.
Desplazamiento.
GET /api/manager/emails/:id
Obtiene el detalle completo de un correo con su análisis IA.
UUID del correo.
POST /api/manager/emails/:id/approve
Aprueba un correo y crea automáticamente un expediente con los datos sugeridos por la IA.
UUID del correo.
Crear expediente automáticamente. Default: true.
Crear cliente automáticamente. Default: true.
POST /api/manager/emails/:id/reject
Rechaza un correo (no se crea expediente).
UUID del correo.
Motivo del rechazo.
POST /api/manager/emails/:id/reanalyze
Re-analiza un correo con la IA (útil si se han actualizado los prompts o hay nueva información).
UUID del correo.
Analizador de documentos
GET /api/doc-analysis/clients
Lista los clientes del módulo de análisis de documentos.
POST /api/doc-analysis/clients
Crea un nuevo cliente para análisis.
Nombre del cliente de análisis.
POST /api/doc-analysis/clients/:id/questions
Configura las preguntas que la IA responderá al analizar documentos.
UUID del cliente de análisis.
Array de preguntas con text y type (text, number, date, boolean, select).
POST /api/doc-analysis/clients/:id/documents
Sube documentos para análisis automático con IA.
UUID del cliente de análisis.
Archivos a analizar (PDF).
GET /api/doc-analysis/clients/:id/export
Exporta los resultados del análisis en formato CSV.
UUID del cliente de análisis.
Last updated today