TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gcsconsultores/centros-estrategicos-gcs/llms.txt
Use this file to discover all available pages before exploring further.
/api/leads route captures prospect data submitted through the virtual office — whether via SallyChat’s conversational flow or the LeadFormModal component — and persists it to a SharePoint List through the Microsoft Graph API. Authentication against Graph uses an OAuth 2.0 client credentials grant scoped to the registered Azure AD application. In development environments where Microsoft 365 credentials are absent, the route logs the lead payload to stdout and still returns a 200 OK so the UI flow is never interrupted.
POST /api/leads
Request
| Property | Value |
|---|---|
| Method | POST |
| Path | /api/leads |
| Content-Type | application/json |
Body Parameters
Full name of the contact submitting the lead.
Email address of the contact. Validated server-side with the regex
/^[^\s@]+@[^\s@]+\.[^\s@]+$/ before any storage attempt.Company or organisation name associated with the lead.
Service or room ID representing the area of interest — e.g.
compliance, ejecutiva, sarlaft. Maps to the Servicio Choice column in SharePoint.Optional contact phone number. Stored as an empty string in SharePoint when not provided.
Optional free-text message or notes from the contact. Stored as an empty string in SharePoint when not provided.
Source identifier describing where the lead was captured — e.g.
"Oficina Virtual - Sala Ejecutiva". Used for attribution reporting in SharePoint.Response
GET /api/leads
TheGET handler is an admin info endpoint — it returns documentation metadata and does not expose stored lead data. Accessing real lead records requires authentication and direct SharePoint / Graph API access.
SharePoint Integration
The route follows a two-step Microsoft Graph flow on every authenticatedPOST:
Obtain OAuth2 token
A If any credential is missing or the request fails, the route falls back to development mode immediately.
client_credentials grant is posted to the Azure AD token endpoint:Required SharePoint List Columns
Create these columns in your SharePoint List before enabling production storage. Column names are case-sensitive and must match exactly.| Column Name | Type | Maps To |
|---|---|---|
Title | Text | nombre |
Email | Text | email |
Empresa | Text | empresa |
Telefono | Text | telefono |
Servicio | Choice | servicio |
Mensaje | Multiline Text | mensaje |
Origen | Text | origen |
FechaCreacion | Date | Auto-set to ISO 8601 timestamp at write time |
Validation
The route validates the request body before attempting any external call:- Required fields:
nombre,email,empresa,servicio— returns400with a descriptive message if any are absent. - Email format: validated with
/^[^\s@]+@[^\s@]+\.[^\s@]+$/— returns400if the format is invalid. - All other optional fields (
telefono,mensaje) are stored as empty strings in SharePoint when not provided.
Error Responses
| Status | Description |
|---|---|
400 | Missing one or more required fields (nombre, email, empresa, servicio) |
400 | Invalid email format |
500 | SharePoint API error or unexpected server error |