Reference

Table Events


Description

Insert, update, delete and list datasets

Supported Operations

Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.
Method Supported Reference EndPoint
SELECT list_events
INSERT create_event
UPDATE update_event
UPSERT
DELETE delete_event
LOOKUP get_event

Examples

SSIS

Use Google Calendar Connector in API Source component to read data or in API Destination component to read/write data:

Read from Events table using API Source

API Source - Google Calendar
Read and write Google Calendar data effortlessly. Integrate, manage, and automate events, calendars, and availability — almost no coding required.
Google Calendar
Events
Required Parameters
Calendar ID (e.g. 'primary' or calendar ID) Fill-in the parameter...
SSIS API Source - Read from table or endpoint

Read/write to Events table using API Destination

API Destination - Google Calendar
Read and write Google Calendar data effortlessly. Integrate, manage, and automate events, calendars, and availability — almost no coding required.
Google Calendar
Events
Select
Required Parameters
Calendar ID (e.g. 'primary' or calendar ID) Fill-in the parameter...
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

List events

<p>This example lists events from a specified calendar. Supply the calendar ID to target a calendar; for a single event you can filter by event ID in the WHERE clause or use the EventId parameter.</p> <p><strong>Tip:</strong> Combine with time range parameters (<code>StartTime</code>, <code>EndTime</code>) for filtered results.</p>

SELECT * FROM Events
WITH (CalendarId='MyCalendarId')  -- Specify the calendar ID to list events from

--Get single event by Id
--SELECT * FROM Events WHERE Id='MyEventId'  -- Filter by event ID in WHERE clause
--SELECT * FROM Events WITH(EventId='MyEventId')  -- Use EventId parameter for direct lookup

List events with time range

<p>This example demonstrates how to list events within a specific date range using static timestamps. The <code>StartTime</code> and <code>EndTime</code> parameters filter events to only include those starting after the minimum time and ending before the maximum time. This is useful for querying events in a particular month or week.</p> <p><strong>Note:</strong> Timestamps must be in RFC3339 format (e.g., <code>2026-01-01T00:00:00Z</code>).</p>

SELECT * 
FROM Events
WITH (CalendarId='primary',
      StartTime='2026-01-01T00:00:00Z',
      EndTime='2026-01-31T23:59:59Z')

--OR-- From all accessible calendars (EventsAll table)

--SELECT * 
--FROM EventsAll
--WITH (StartTime='2026-01-01T00:00:00-05:00',  
--      EndTime='2026-01-31T23:59:59-05:00')

List events ordered by start time

<p>Use this query to retrieve events ordered by their start time. The <code>OrderBy</code> parameter sorts the results chronologically based on the event's start date and time. This is ideal for displaying upcoming events in sequence.</p> <p><strong>Tip:</strong> Combine with <code>StartTime</code> to focus on future events.</p>

SELECT * 
FROM Events
WITH (CalendarId='primary',
      OrderBy='startTime')

List events including deleted ones

<p>This example shows how to include deleted events in the results by setting <code>ShowDeleted='true'</code>. Deleted events are typically hidden, but this parameter allows you to view them for auditing or recovery purposes.</p> <p><strong>Warning:</strong> Deleted events may have limited data available.</p>

SELECT * 
FROM Events
WITH (CalendarId='primary',
      ShowDeleted='true')

List events with max results and single events

<p>Limit the number of events returned with <code>MaxResults</code> and expand recurring events into individual instances using <code>SingleEvents='true'</code>. This prevents pagination issues and ensures each occurrence of a recurring event is listed separately.</p> <p><strong>Example use case:</strong> Fetch the next 10 upcoming event instances.</p>

SELECT * FROM Events

WITH (CalendarId='primary',
      MaxResults=10,
      SingleEvents='true')

List events for next week using dynamic dates

<p>This query uses dynamic date functions to list events for the next week. <code><<today,FUN_TO_DATETIME>></code> represents today's date in datetime format, and <code><<today+7d,FUN_TO_DATETIME>></code> adds 7 days. This allows for automated queries that always fetch the upcoming week's events without hardcoding dates.</p> <p><strong>Dynamic Placeholders:</strong> Supported functions include <code>FUN_TO_DATE</code> for dates and <code>FUN_TO_DATETIME</code> for timestamps.</p>

SELECT * FROM Events
--FROM EventsAll --(Get from All Calendars)
WITH (CalendarId='primary',
--//e.g. append -05:00 for EST (New York Time Zone) to convert local time to UTC -OR- just appends "Z" for UTC time (2026-01-01T05:00:00Z which is same as 2026-01-01T00:00:00-05:00 ).
      StartTime='<<today,FUN_TO_DATETIME>>-05:00',   
      EndTime='<<today+7d,FUN_TO_DATETIME>>-05:00')

List events ordered by updated time

<p>Retrieve events sorted by their last updated time using <code>OrderBy='updated'</code>. This is useful for tracking recent changes or modifications to events in the calendar.</p> <p><strong>Combine with Filters:</strong> Add <code>StartTime</code> to focus on recently updated events.</p>

SELECT * FROM Events
--FROM EventsAll --(Get from All Calendars)
WITH (CalendarId='primary',
      OrderBy='updated')

List events for today and tomorrow with dynamic placeholders

<p>Use dynamic placeholders to query events starting from today and ending tomorrow. <code><<today,FUN_TO_DATETIME>></code> is today's start, and <code><<today+1d,FUN_TO_DATETIME>></code> is tomorrow's start. This example combines static time ranges with dynamic dates for precise filtering.</p> <p><strong>Advanced Tip:</strong> Adjust the offsets (e.g., +1d for tomorrow) to customize the range.</p>

SELECT * 
FROM Events
--FROM EventsAll --(Get from All Calendars)
WITH (CalendarId='primary',
      StartTime='<<today,FUN_TO_DATETIME>>-05:00',   
      EndTime='<<today+1d,FUN_TO_DATETIME>>-05:00')

Create event

<p>This example creates a new event in the specified calendar. Provide start and end times, time zones, summary, and optional details such as location and attendees. Supply the target calendar ID (e.g. <code>primary</code> or a custom calendar ID) in the WITH clause.</p> <p><strong>Note:</strong> Time zones are required for timed events. Attendees can be supplied as a JSON array.</p>

INSERT INTO Events(StartsAt, StartsInTimeZone, EndsAt, EndsInTimeZone, Summary,
  Attendees, Description, Location, Status, Transparency, Visibility)
VALUES ('2021-11-26T16:30:50', 'Europe/Vilnius', '2021-11-27T16:30:50','Europe/Vilnius', 'This is an event',
        null, 'My Description', 'Vilnius', 'confirmed', 'opaque', 'default')
--WITH (CalendarId='primary')		   -- Use 'primary' for the main calendar
--WITH (CalendarId='YourCalendarId')  -- Or specify a custom calendar ID

Update event

<p>This example updates an existing event by ID. You can change summary, description, times, location, attendees, reminders, and other fields. Use dynamic placeholders for relative times (e.g. <code><<today+1d+10h,FUN_TO_DATETIME>></code>).</p> <p><strong>Note:</strong> Always provide time zones for timed events. You can choose whether to notify attendees of the update.</p>

UPDATE Events
SET	 Summary = 'Project Kickoff Meeting'            -- Event title
    ,Description = 'Your meeting description in <strong>bold HTML</strong>'
    
    --For all day event - Example '2026-01-28'
    --,StartsOn = '2026-02-01'                        -- All-day event start date (YYYY-MM-DD)    
    --,EndsOn = '2026-02-01'                          -- All-day event end date (YYYY-MM-DD)
    
    --,StartsOn = '<<monthend+1d,FUN_TO_DATE>>'      -- Dynamic date example
    --,EndsOn   = '<<monthend+1d,FUN_TO_DATE>>'
    
    --OR--

    --For events which has start/end time : Example '2026-01-28T15:59:00'
    ,StartsAt = '<<today+1d+10h,FUN_TO_DATETIME>>' -- Set time from today + 1 day + 10 hours (10AM)
    ,EndsAt = '<<today+1d+11h,FUN_TO_DATETIME>>'   -- Set time from today + 1 day + 11 hours (11AM)
    ,StartsInTimeZone = 'America/New_York'
    ,EndsInTimeZone = 'America/New_York'
        
    ,Location = 'Conference Room 2B'                -- Event location
    ,Attendees = '[{"email":"user1@example.com"},{"email":"user2@example.com"}]' -- JSON array of attendees
	,RemindersUseDefault = false                    -- Use custom reminders
	,RemindersOverrides = '[{"method": "popup","minutes": 12},{"method": "popup","minutes": 11}]'  -- JSON array of reminder overrides
    ,Recurrence = '["RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20260131T045959Z;BYDAY=MO,WE"]'      -- Recurrence rule
    ,Status = 'confirmed'                           -- confirmed | tentative | cancelled
    ,Transparency = 'opaque'                        -- opaque | transparent
    ,Visibility = 'default'                         -- default | public | private | confidential
    ,ColorId = '5'                                  -- Color identifier
    ,GuestsCanInviteOthers = true                   -- Allow guests to invite others
    ,GuestsCanModify = false                        -- Allow guests to modify event
    ,GuestsCanSeeOtherGuests = true                 -- Allow guests to see other guests
    ,AnyoneCanAddSelf = false                       -- Anyone can add themselves as attendee
    ,PrivateCopy = false                            -- Private event copy
    ,ShowMeAs = 'busy'                              -- busy | free | tentative | workingElsewhere
    ,SourceTitle = 'Project Plan'                   -- Source title
    ,SourceUrl = 'https://example.com/project-plan' -- Source URL
WHERE Id = '5hr02mkhg09atao1clih4jco6e'  -- Event ID to update
WITH (
   CalendarId = 'primary' --or 'some-calendar-id'
 , SendUpdates='none' --'all' or 'externalOnly' to notify attendees
)

Delete event

<p>This example deletes an event by ID from the specified calendar. Supply the calendar ID and the event ID.</p> <p><strong>Warning:</strong> This action is irreversible.</p>

DELETE FROM Events  -- Deletes the specified event
WITH (CalendarId='MyCalendarId',  -- Calendar containing the event
      Id='MyEventId')              -- ID of the event to delete

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

List events

<p>This example lists events from a specified calendar. Supply the calendar ID to target a calendar; for a single event you can filter by event ID in the WHERE clause or use the EventId parameter.</p> <p><strong>Tip:</strong> Combine with time range parameters (<code>StartTime</code>, <code>EndTime</code>) for filtered results.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Events
WITH (CalendarId=''MyCalendarId'')  -- Specify the calendar ID to list events from

--Get single event by Id
--SELECT * FROM Events WHERE Id=''MyEventId''  -- Filter by event ID in WHERE clause
--SELECT * FROM Events WITH(EventId=''MyEventId'')  -- Use EventId parameter for direct lookup';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events with time range

<p>This example demonstrates how to list events within a specific date range using static timestamps. The <code>StartTime</code> and <code>EndTime</code> parameters filter events to only include those starting after the minimum time and ending before the maximum time. This is useful for querying events in a particular month or week.</p> <p><strong>Note:</strong> Timestamps must be in RFC3339 format (e.g., <code>2026-01-01T00:00:00Z</code>).</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * 
FROM Events
WITH (CalendarId=''primary'',
      StartTime=''2026-01-01T00:00:00Z'',
      EndTime=''2026-01-31T23:59:59Z'')

--OR-- From all accessible calendars (EventsAll table)

--SELECT * 
--FROM EventsAll
--WITH (StartTime=''2026-01-01T00:00:00-05:00'',  
--      EndTime=''2026-01-31T23:59:59-05:00'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events ordered by start time

<p>Use this query to retrieve events ordered by their start time. The <code>OrderBy</code> parameter sorts the results chronologically based on the event's start date and time. This is ideal for displaying upcoming events in sequence.</p> <p><strong>Tip:</strong> Combine with <code>StartTime</code> to focus on future events.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * 
FROM Events
WITH (CalendarId=''primary'',
      OrderBy=''startTime'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events including deleted ones

<p>This example shows how to include deleted events in the results by setting <code>ShowDeleted='true'</code>. Deleted events are typically hidden, but this parameter allows you to view them for auditing or recovery purposes.</p> <p><strong>Warning:</strong> Deleted events may have limited data available.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * 
FROM Events
WITH (CalendarId=''primary'',
      ShowDeleted=''true'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events with max results and single events

<p>Limit the number of events returned with <code>MaxResults</code> and expand recurring events into individual instances using <code>SingleEvents='true'</code>. This prevents pagination issues and ensures each occurrence of a recurring event is listed separately.</p> <p><strong>Example use case:</strong> Fetch the next 10 upcoming event instances.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Events

WITH (CalendarId=''primary'',
      MaxResults=10,
      SingleEvents=''true'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events for next week using dynamic dates

<p>This query uses dynamic date functions to list events for the next week. <code><<today,FUN_TO_DATETIME>></code> represents today's date in datetime format, and <code><<today+7d,FUN_TO_DATETIME>></code> adds 7 days. This allows for automated queries that always fetch the upcoming week's events without hardcoding dates.</p> <p><strong>Dynamic Placeholders:</strong> Supported functions include <code>FUN_TO_DATE</code> for dates and <code>FUN_TO_DATETIME</code> for timestamps.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Events
--FROM EventsAll --(Get from All Calendars)
WITH (CalendarId=''primary'',
--//e.g. append -05:00 for EST (New York Time Zone) to convert local time to UTC -OR- just appends "Z" for UTC time (2026-01-01T05:00:00Z which is same as 2026-01-01T00:00:00-05:00 ).
      StartTime=''<<today,FUN_TO_DATETIME>>-05:00'',   
      EndTime=''<<today+7d,FUN_TO_DATETIME>>-05:00'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events ordered by updated time

<p>Retrieve events sorted by their last updated time using <code>OrderBy='updated'</code>. This is useful for tracking recent changes or modifications to events in the calendar.</p> <p><strong>Combine with Filters:</strong> Add <code>StartTime</code> to focus on recently updated events.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Events
--FROM EventsAll --(Get from All Calendars)
WITH (CalendarId=''primary'',
      OrderBy=''updated'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

List events for today and tomorrow with dynamic placeholders

<p>Use dynamic placeholders to query events starting from today and ending tomorrow. <code><<today,FUN_TO_DATETIME>></code> is today's start, and <code><<today+1d,FUN_TO_DATETIME>></code> is tomorrow's start. This example combines static time ranges with dynamic dates for precise filtering.</p> <p><strong>Advanced Tip:</strong> Adjust the offsets (e.g., +1d for tomorrow) to customize the range.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * 
FROM Events
--FROM EventsAll --(Get from All Calendars)
WITH (CalendarId=''primary'',
      StartTime=''<<today,FUN_TO_DATETIME>>-05:00'',   
      EndTime=''<<today+1d,FUN_TO_DATETIME>>-05:00'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

Create event

<p>This example creates a new event in the specified calendar. Provide start and end times, time zones, summary, and optional details such as location and attendees. Supply the target calendar ID (e.g. <code>primary</code> or a custom calendar ID) in the WITH clause.</p> <p><strong>Note:</strong> Time zones are required for timed events. Attendees can be supplied as a JSON array.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Events(StartsAt, StartsInTimeZone, EndsAt, EndsInTimeZone, Summary,
  Attendees, Description, Location, Status, Transparency, Visibility)
VALUES (''2021-11-26T16:30:50'', ''Europe/Vilnius'', ''2021-11-27T16:30:50'',''Europe/Vilnius'', ''This is an event'',
        null, ''My Description'', ''Vilnius'', ''confirmed'', ''opaque'', ''default'')
--WITH (CalendarId=''primary'')		   -- Use ''primary'' for the main calendar
--WITH (CalendarId=''YourCalendarId'')  -- Or specify a custom calendar ID';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

Update event

<p>This example updates an existing event by ID. You can change summary, description, times, location, attendees, reminders, and other fields. Use dynamic placeholders for relative times (e.g. <code><<today+1d+10h,FUN_TO_DATETIME>></code>).</p> <p><strong>Note:</strong> Always provide time zones for timed events. You can choose whether to notify attendees of the update.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Events
SET	 Summary = ''Project Kickoff Meeting''            -- Event title
    ,Description = ''Your meeting description in <strong>bold HTML</strong>''
    
    --For all day event - Example ''2026-01-28''
    --,StartsOn = ''2026-02-01''                        -- All-day event start date (YYYY-MM-DD)    
    --,EndsOn = ''2026-02-01''                          -- All-day event end date (YYYY-MM-DD)
    
    --,StartsOn = ''<<monthend+1d,FUN_TO_DATE>>''      -- Dynamic date example
    --,EndsOn   = ''<<monthend+1d,FUN_TO_DATE>>''
    
    --OR--

    --For events which has start/end time : Example ''2026-01-28T15:59:00''
    ,StartsAt = ''<<today+1d+10h,FUN_TO_DATETIME>>'' -- Set time from today + 1 day + 10 hours (10AM)
    ,EndsAt = ''<<today+1d+11h,FUN_TO_DATETIME>>''   -- Set time from today + 1 day + 11 hours (11AM)
    ,StartsInTimeZone = ''America/New_York''
    ,EndsInTimeZone = ''America/New_York''
        
    ,Location = ''Conference Room 2B''                -- Event location
    ,Attendees = ''[{"email":"user1@example.com"},{"email":"user2@example.com"}]'' -- JSON array of attendees
	,RemindersUseDefault = false                    -- Use custom reminders
	,RemindersOverrides = ''[{"method": "popup","minutes": 12},{"method": "popup","minutes": 11}]''  -- JSON array of reminder overrides
    ,Recurrence = ''["RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20260131T045959Z;BYDAY=MO,WE"]''      -- Recurrence rule
    ,Status = ''confirmed''                           -- confirmed | tentative | cancelled
    ,Transparency = ''opaque''                        -- opaque | transparent
    ,Visibility = ''default''                         -- default | public | private | confidential
    ,ColorId = ''5''                                  -- Color identifier
    ,GuestsCanInviteOthers = true                   -- Allow guests to invite others
    ,GuestsCanModify = false                        -- Allow guests to modify event
    ,GuestsCanSeeOtherGuests = true                 -- Allow guests to see other guests
    ,AnyoneCanAddSelf = false                       -- Anyone can add themselves as attendee
    ,PrivateCopy = false                            -- Private event copy
    ,ShowMeAs = ''busy''                              -- busy | free | tentative | workingElsewhere
    ,SourceTitle = ''Project Plan''                   -- Source title
    ,SourceUrl = ''https://example.com/project-plan'' -- Source URL
WHERE Id = ''5hr02mkhg09atao1clih4jco6e''  -- Event ID to update
WITH (
   CalendarId = ''primary'' --or ''some-calendar-id''
 , SendUpdates=''none'' --''all'' or ''externalOnly'' to notify attendees
)';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];

Delete event

<p>This example deletes an event by ID from the specified calendar. Supply the calendar ID and the event ID.</p> <p><strong>Warning:</strong> This action is irreversible.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Events  -- Deletes the specified event
WITH (CalendarId=''MyCalendarId'',  -- Calendar containing the event
      Id=''MyEventId'')              -- ID of the event to delete';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_CALENDAR_IN_GATEWAY];