The Teams integration creates calendar events with embedded Teams meeting links via the Microsoft Graph API. When a client requests a meeting from the Sala Ejecutiva, 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/meetings route authenticates as a service principal, creates the event in the organizer’s Microsoft 365 calendar, and returns a joinUrl that the client can use to join the meeting — no Teams account required on the client’s side. The join link works in any modern browser via the Teams web app.
How It Works
Client submits a meeting request
The user selects a meeting type and fills out the contact form in the Sala Ejecutiva of the virtual office.
POST /api/meetings is called
The front end sends a
POST request to /api/meetings with the fields titulo, fecha (ISO 8601), duracionMinutos, sala, and an asistentes array containing nombre and email for each attendee.Azure AD authentication
The API route acquires an OAuth2 access token from Azure AD using the
client_credentials grant — the same flow used for SharePoint. No user interaction is required.Calendar event created via Graph API
A
POST request is sent to /v1.0/users/{organizerEmail}/events with isOnlineMeeting: true. Microsoft Graph automatically generates a Teams meeting link and attaches it to the event.joinUrl returned to the client
The Graph API response includes
onlineMeeting?.joinUrl. The API route extracts this URL and returns it to the client in the response body.Event Creation Body
The following object is sent to the Microsoft Graph API when creating a Teams meeting event. Dates are calculated from thefecha and duracionMinutos fields in the request body.
Required Permissions
TheCalendars.ReadWrite Application permission must be granted on your Azure AD App Registration to create calendar events on behalf of any user in the tenant.
See the Microsoft 365 setup guide for instructions on adding and granting this permission.
| Permission | Type | Purpose |
|---|---|---|
Calendars.ReadWrite | Application | Create and manage Teams meeting events in user calendars |
Organizer Account
The meeting is created under the calendar of the account specified byDEFAULT_ORGANIZER_EMAIL. This is the account that appears as the meeting organizer in Teams and in attendees’ calendar invites.
- The organizer account must be a licensed Microsoft 365 user — unlicensed accounts cannot hold calendar events.
- Set
DEFAULT_ORGANIZER_EMAILin.env.localto apply it globally as the fallback organizer. - To override the organizer for a specific meeting request, include the
organizadorEmailfield in thePOST /api/meetingsrequest body. If provided, it takes precedence over the environment variable.
Timezone
All meeting times are created in the
America/Bogota timezone (UTC-5), which corresponds to Colombian Standard Time. This timezone does not observe daylight saving time. If your consultants operate from a different region, update the timeZone field in both the start and end objects inside the createTeamsMeeting function in /app/api/meetings/route.ts.Attendees
Every email address in theasistentes array receives a calendar invite from Microsoft with the Teams join link embedded. Key details about attendee behavior:
- Attendees are added with
type: 'required'— they receive an invitation and their accept/decline response is tracked. - Attendees do not need a Teams account to join. The join URL opens the Teams web app in any modern browser.
- All attendees see
Oficina Virtual GCS - {sala}as the meeting location in their calendar invite.