The SharePoint integration stores captured leads — contact name, email, company, and service interest — as items in a SharePoint List via the Microsoft Graph API. When a visitor fills out a contact form in any sala of the virtual office, 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 authenticates as a service principal using the OAuth2 client credentials flow, then writes the data directly to the configured list. The full column schema and Graph API request structure are documented below.
Required List Schema
Create a SharePoint List with the following columns. The Internal Name values must match exactly — these are the field keys sent by the Graph API in thefields object.
| Internal Name | Type | Description |
|---|---|---|
Title | Single line of text | Contact full name (required, maps to the list’s built-in Title column) |
Email | Single line of text | Contact email address |
Empresa | Single line of text | Company name |
Telefono | Single line of text | Phone number (optional) |
Servicio | Choice | Service of interest (e.g. compliance, training, ejecutiva) |
Mensaje | Multiple lines of text | Additional message from the contact |
Origen | Single line of text | Source identifier (e.g. Oficina Virtual - Sala Ejecutiva) |
FechaCreacion | Date and Time | Timestamp of lead creation — set server-side in ISO 8601 format |
Creating the List
Add columns from the schema
For each row in the schema table above (except
Title, which already exists), click + Add column and select the matching column type. Set the Internal Name (or column name) exactly as shown — SharePoint uses this as the field key in the Graph API.Note the list ID
Copy the list ID from the URL while viewing the list settings, or retrieve it via the Microsoft Graph API as described in the Microsoft 365 setup guide.
Microsoft Graph API Flow
The/api/leads route performs a two-step sequence: first acquiring an access token using the OAuth2 client credentials grant, then POSTing the lead as a new list item.
expires_in boundary to reduce latency.
MSGraphConfig Interface
TheMSGraphConfig interface in lib/types.ts defines the shape of the configuration object used when constructing Microsoft Graph requests:
AZURE_AD_CLIENT_ID, AZURE_AD_TENANT_ID, AZURE_AD_CLIENT_SECRET, SHAREPOINT_SITE_ID, and SHAREPOINT_LIST_ID.