Calendar API
- Base URL:
https://calendar.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/calendar
Usageโ
import { epilot } from '@epilot/sdk'
epilot.authorize(() => '<token>')
const { data } = await epilot.calendar.listUsersAbsence(...)
Tree-shakeable importโ
import { getClient, authorize } from '@epilot/sdk/calendar'
const calendarClient = getClient()
authorize(calendarClient, () => '<token>')
const { data } = await calendarClient.listUsersAbsence(...)
Operationsโ
Absence
listUsersAbsencesearchAbsencesearchNowAbsencelistAbsenceAdjustmentscreateAbsenceAdjustmentgetAbsenceAdjustmentpatchAbsenceAdjustmentdeleteAbsenceAdjustmentgetUserAbsence
Working Hours
Calendars
listCalendarscreateCalendaraddOutlookCalendarlistOutlookCalendarsdeleteOutlookCalendaroutlookWebhookgetCalendarupdateCalendardeleteCalendar
Calendar Events
Schemas
AbsenceIntervalAbsenceIntervalSourceErrorSearchAbsenceBodySearchNowAbsenceBodyAbsenceAdjustmentAbsenceStatusAbsenceTypeCreateAbsenceAdjustmentBodyPatchAbsenceAdjustmentBodyExternalCalendarWorkingHoursUpsertWorkingHoursBodyTimeWindowCalendarCalendarSourceProviderCalendarCreateBodyAddOutlookCalendarRequestAvailableOutlookCalendarCalendarPatchBodyCalendarEventEventTypeEventStatusSensitivityImportanceResponseStatusAttendeeEventSourceCalendarEventCreateBodyCalendarEventPatchBodyShareEventBody
listUsersAbsenceโ
List organization users with known absence metadata in the requested time window.
GET /v1/calendar/absence/users
const { data } = await client.listUsersAbsence({
from: 'example',
to: 'example',
include_busy: true,
working_hours_granularity: 'example',
query: 'example',
limit: 1,
offset: 1,
})
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"hits": 0,
"results": [
{
"absent": true,
"absence_intervals": [
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"original_from": "1970-01-01T00:00:00.000Z",
"original_to": "1970-01-01T00:00:00.000Z",
"absent": true,
"source": "calendar_event",
"calendar_event_id": "string",
"absence_adjustment_id": "string",
"reason": "string"
}
],
"user_id": "string",
"display_name": "string",
"email": "user@example.com",
"status": "string"
}
]
}
searchAbsenceโ
Search known absence for candidate users in the requested time window.
POST /v1/calendar/absence:search
const { data } = await client.searchAbsence(
null,
{
from: '1970-01-01T00:00:00.000Z',
to: '1970-01-01T00:00:00.000Z',
user_ids: ['string'],
include_busy: false,
working_hours_granularity: 'time'
},
)
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"users": {}
}
searchNowAbsenceโ
Search known absence for candidate users at the current server time.
POST /v1/calendar/absence:search-now
const { data } = await client.searchNowAbsence(
null,
{
user_ids: ['string'],
include_busy: false,
working_hours_granularity: 'time'
},
)
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"users": {}
}
listAbsenceAdjustmentsโ
List absence adjustments for a user in a time window.
GET /v1/calendar/absence/users/{user_id}/adjustments
const { data } = await client.listAbsenceAdjustments({
user_id: 'example',
from: 'example',
to: 'example',
})
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"results": [
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"absent": true,
"status": "oof",
"type": "string",
"reason": "string",
"adjustment_id": "string",
"user_id": "string",
"created_by": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
]
}
createAbsenceAdjustmentโ
Create a time-bound absence adjustment for a user in the caller organization.
POST /v1/calendar/absence/users/{user_id}/adjustments
const { data } = await client.createAbsenceAdjustment(
{
user_id: 'example',
},
{
from: '1970-01-01T00:00:00.000Z',
to: '1970-01-01T00:00:00.000Z',
absent: true,
status: 'oof',
type: 'string',
reason: 'string'
},
)
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"absent": true,
"status": "oof",
"type": "string",
"reason": "string",
"adjustment_id": "string",
"user_id": "string",
"created_by": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
getAbsenceAdjustmentโ
Get an absence adjustment by ID.
GET /v1/calendar/absence/users/{user_id}/adjustments/{adjustment_id}
const { data } = await client.getAbsenceAdjustment({
user_id: 'example',
adjustment_id: 'example',
})
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"absent": true,
"status": "oof",
"type": "string",
"reason": "string",
"adjustment_id": "string",
"user_id": "string",
"created_by": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
patchAbsenceAdjustmentโ
Update an absence adjustment in the caller organization.
PATCH /v1/calendar/absence/users/{user_id}/adjustments/{adjustment_id}
const { data } = await client.patchAbsenceAdjustment(
{
user_id: 'example',
adjustment_id: 'example',
},
{
from: '1970-01-01T00:00:00.000Z',
to: '1970-01-01T00:00:00.000Z',
absent: true,
status: 'oof',
type: 'string',
reason: 'string'
},
)
Response
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"absent": true,
"status": "oof",
"type": "string",
"reason": "string",
"adjustment_id": "string",
"user_id": "string",
"created_by": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
deleteAbsenceAdjustmentโ
Delete an absence adjustment.
DELETE /v1/calendar/absence/users/{user_id}/adjustments/{adjustment_id}
const { data } = await client.deleteAbsenceAdjustment({
user_id: 'example',
adjustment_id: 'example',
})
getUserAbsenceโ
Get known absence for a user in a time window. absent=false means no known absence, not guaranteed availability.
GET /v1/calendar/absence/users/{user_id}
const { data } = await client.getUserAbsence({
user_id: 'example',
from: 'example',
to: 'example',
include_busy: true,
working_hours_granularity: 'example',
})
Response
{
"absent": true,
"absence_intervals": [
{
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"original_from": "1970-01-01T00:00:00.000Z",
"original_to": "1970-01-01T00:00:00.000Z",
"absent": true,
"source": "calendar_event",
"calendar_event_id": "string",
"absence_adjustment_id": "string",
"reason": "string"
}
],
"from": "1970-01-01T00:00:00.000Z",
"to": "1970-01-01T00:00:00.000Z",
"user_id": "string",
"external_calendars": [
{
"provider": "outlook",
"last_synced_at": "1970-01-01T00:00:00.000Z"
}
]
}
getWorkingHoursโ
Get the recurring weekly working hours of a user. 404 means no record exists and the user is treated as always available.
GET /v1/calendar/working-hours/users/{user_id}
const { data } = await client.getWorkingHours({
user_id: 'example',
})
Response
{
"monday": [
{
"start": "string",
"end": "string"
}
],
"tuesday": [
{
"start": "string",
"end": "string"
}
],
"wednesday": [
{
"start": "string",
"end": "string"
}
],
"thursday": [
{
"start": "string",
"end": "string"
}
],
"friday": [
{
"start": "string",
"end": "string"
}
],
"saturday": [
{
"start": "string",
"end": "string"
}
],
"sunday": [
{
"start": "string",
"end": "string"
}
],
"timezone": "string",
"user_id": "string",
"updated_by": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
putWorkingHoursโ
Create or fully replace the working hours of a user in the caller organization. This is a full replace, not a merge.
PUT /v1/calendar/working-hours/users/{user_id}
const { data } = await client.putWorkingHours(
{
user_id: 'example',
},
{
monday: [
{
start: 'string',
end: 'string'
}
],
tuesday: [
{
start: 'string',
end: 'string'
}
],
wednesday: [
{
start: 'string',
end: 'string'
}
],
thursday: [
{
start: 'string',
end: 'string'
}
],
friday: [
{
start: 'string',
end: 'string'
}
],
saturday: [
{
start: 'string',
end: 'string'
}
],
sunday: [
{
start: 'string',
end: 'string'
}
],
timezone: 'Europe/Berlin'
},
)
Response
{
"monday": [
{
"start": "string",
"end": "string"
}
],
"tuesday": [
{
"start": "string",
"end": "string"
}
],
"wednesday": [
{
"start": "string",
"end": "string"
}
],
"thursday": [
{
"start": "string",
"end": "string"
}
],
"friday": [
{
"start": "string",
"end": "string"
}
],
"saturday": [
{
"start": "string",
"end": "string"
}
],
"sunday": [
{
"start": "string",
"end": "string"
}
],
"timezone": "string",
"user_id": "string",
"updated_by": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
deleteWorkingHoursโ
Delete the working hours of a user. The user is then treated as always available again.
DELETE /v1/calendar/working-hours/users/{user_id}
const { data } = await client.deleteWorkingHours({
user_id: 'example',
})
listCalendarsโ
List calendars visible to the caller.
GET /v1/calendar
const { data } = await client.listCalendars({
size: 1,
cursor: 'example',
})
Response
{
"results": [
{
"_id": "string",
"_schema": "calendar",
"_org": "string",
"_title": "string",
"name": "string",
"description": "string",
"color": "string",
"is_default": true,
"is_epilot_default": true,
"read_only": true,
"owner_email": "user@example.com",
"source": {
"type": "native",
"provider": "outlook",
"provider_calendar_id": "string",
"last_synced_at": "1970-01-01T00:00:00.000Z"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
],
"next_cursor": "string"
}
createCalendarโ
Create a native epilot calendar.
POST /v1/calendar
const { data } = await client.createCalendar(
null,
{
name: 'string',
description: 'string',
color: 'string'
},
)
Response
{
"_id": "string",
"_schema": "calendar",
"_org": "string",
"_title": "string",
"name": "string",
"description": "string",
"color": "string",
"is_default": true,
"is_epilot_default": true,
"read_only": true,
"owner_email": "user@example.com",
"source": {
"type": "native",
"provider": "outlook",
"provider_calendar_id": "string",
"last_synced_at": "1970-01-01T00:00:00.000Z"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
addOutlookCalendarโ
Registers one of the caller's Outlook calendars as an epilot calendar.
POST /v1/calendar/sources/outlook
const { data } = await client.addOutlookCalendar(
null,
{
provider_calendar_id: 'string',
name: 'string'
},
)
Response
{
"_id": "string",
"_schema": "calendar",
"_org": "string",
"_title": "string",
"name": "string",
"description": "string",
"color": "string",
"is_default": true,
"is_epilot_default": true,
"read_only": true,
"owner_email": "user@example.com",
"source": {
"type": "native",
"provider": "outlook",
"provider_calendar_id": "string",
"last_synced_at": "1970-01-01T00:00:00.000Z"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
listOutlookCalendarsโ
Lists the calling user's Outlook calendars available to import as epilot calendars.
GET /v1/calendar/sources/outlook/available
const { data } = await client.listOutlookCalendars()
Response
{
"calendars": [
{
"provider_calendar_id": "string",
"name": "string",
"color": "string",
"is_default": true,
"can_edit": true,
"owner": "string"
}
]
}
deleteOutlookCalendarโ
Disconnects a previously registered Outlook calendar.
DELETE /v1/calendar/sources/outlook/{calendar_id}
const { data } = await client.deleteOutlookCalendar({
calendar_id: 'example',
})
outlookWebhookโ
Public Microsoft Graph webhook receiver for per-user Outlook calendar
subscriptions. Unauthenticated by design (API Gateway Authorizer: NONE):
Graph calls it with no epilot token.
POST /v1/calendar/outlook/webhook
const { data } = await client.outlookWebhook({
validationToken: 'example',
})
getCalendarโ
Get a single calendar by its epilot ID.
GET /v1/calendar/{calendar_id}
const { data } = await client.getCalendar({
calendar_id: 'example',
})
Response
{
"_id": "string",
"_schema": "calendar",
"_org": "string",
"_title": "string",
"name": "string",
"description": "string",
"color": "string",
"is_default": true,
"is_epilot_default": true,
"read_only": true,
"owner_email": "user@example.com",
"source": {
"type": "native",
"provider": "outlook",
"provider_calendar_id": "string",
"last_synced_at": "1970-01-01T00:00:00.000Z"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
updateCalendarโ
Update local calendar details. Changes to synced calendars do not modify the provider calendar.
PATCH /v1/calendar/{calendar_id}
const { data } = await client.updateCalendar(
{
calendar_id: 'example',
},
{
name: 'string',
description: 'string',
color: 'string'
},
)
Response
{
"_id": "string",
"_schema": "calendar",
"_org": "string",
"_title": "string",
"name": "string",
"description": "string",
"color": "string",
"is_default": true,
"is_epilot_default": true,
"read_only": true,
"owner_email": "user@example.com",
"source": {
"type": "native",
"provider": "outlook",
"provider_calendar_id": "string",
"last_synced_at": "1970-01-01T00:00:00.000Z"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
deleteCalendarโ
Delete a native epilot calendar or disconnect a synced calendar, including its locally stored events.
DELETE /v1/calendar/{calendar_id}
const { data } = await client.deleteCalendar({
calendar_id: 'example',
})
listEventsโ
List events in a time window. Recurring events are returned as expanded occurrences โ each instance appears as its own event.
GET /v1/calendar/events
const { data } = await client.listEvents({
from: 'example',
to: 'example',
calendar_id: 'example',
size: 1,
cursor: 'example',
})
Response
{
"results": [
{
"_id": "string",
"_schema": "calendar_event",
"_org": "string",
"_title": "string",
"_tags": ["string"],
"calendar_id": "string",
"event_type": "singleInstance",
"description": "string",
"start_time": "1970-01-01T00:00:00.000Z",
"end_time": "1970-01-01T00:00:00.000Z",
"timezone": "string",
"is_all_day": true,
"location": "string",
"status": "free",
"busy": true,
"is_cancelled": true,
"is_draft": true,
"sensitivity": "normal",
"importance": "low",
"is_online_meeting": true,
"online_meeting_url": "https://example.com/path",
"web_link": "https://example.com/path",
"response_status": "none",
"organizer_email": "user@example.com",
"attendees": [
{
"email": "user@example.com",
"name": "string",
"response": "none",
"type": "required"
}
],
"metadata": {},
"is_recurring": true,
"series_master_id": "string",
"source": {
"type": "native",
"provider": "outlook",
"provider_event_id": "string",
"provider_event_url": "https://example.com/path",
"last_synced_at": "1970-01-01T00:00:00.000Z",
"etag": "string"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
],
"next_cursor": "string"
}
createEventโ
Create a native epilot calendar event. Omit calendar_id to use the callerโs epilot default calendar.
POST /v1/calendar/events
const { data } = await client.createEvent(
null,
{
calendar_id: 'string',
description: 'string',
start_time: '1970-01-01T00:00:00.000Z',
end_time: '1970-01-01T00:00:00.000Z',
timezone: 'string',
is_all_day: true,
location: 'string',
status: 'free',
sensitivity: 'normal',
metadata: {},
_title: 'string'
},
)
Response
{
"_id": "string",
"_schema": "calendar_event",
"_org": "string",
"_title": "string",
"_tags": ["string"],
"calendar_id": "string",
"event_type": "singleInstance",
"description": "string",
"start_time": "1970-01-01T00:00:00.000Z",
"end_time": "1970-01-01T00:00:00.000Z",
"timezone": "string",
"is_all_day": true,
"location": "string",
"status": "free",
"busy": true,
"is_cancelled": true,
"is_draft": true,
"sensitivity": "normal",
"importance": "low",
"is_online_meeting": true,
"online_meeting_url": "https://example.com/path",
"web_link": "https://example.com/path",
"response_status": "none",
"organizer_email": "user@example.com",
"attendees": [
{
"email": "user@example.com",
"name": "string",
"response": "none",
"type": "required"
}
],
"metadata": {},
"is_recurring": true,
"series_master_id": "string",
"source": {
"type": "native",
"provider": "outlook",
"provider_event_id": "string",
"provider_event_url": "https://example.com/path",
"last_synced_at": "1970-01-01T00:00:00.000Z",
"etag": "string"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
getEventโ
Get a single event by its epilot ID.
GET /v1/calendar/events/{event_id}
const { data } = await client.getEvent({
event_id: 'example',
})
Response
{
"_id": "string",
"_schema": "calendar_event",
"_org": "string",
"_title": "string",
"_tags": ["string"],
"calendar_id": "string",
"event_type": "singleInstance",
"description": "string",
"start_time": "1970-01-01T00:00:00.000Z",
"end_time": "1970-01-01T00:00:00.000Z",
"timezone": "string",
"is_all_day": true,
"location": "string",
"status": "free",
"busy": true,
"is_cancelled": true,
"is_draft": true,
"sensitivity": "normal",
"importance": "low",
"is_online_meeting": true,
"online_meeting_url": "https://example.com/path",
"web_link": "https://example.com/path",
"response_status": "none",
"organizer_email": "user@example.com",
"attendees": [
{
"email": "user@example.com",
"name": "string",
"response": "none",
"type": "required"
}
],
"metadata": {},
"is_recurring": true,
"series_master_id": "string",
"source": {
"type": "native",
"provider": "outlook",
"provider_event_id": "string",
"provider_event_url": "https://example.com/path",
"last_synced_at": "1970-01-01T00:00:00.000Z",
"etag": "string"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
updateEventโ
Update a native epilot calendar event.
PATCH /v1/calendar/events/{event_id}
const { data } = await client.updateEvent(
{
event_id: 'example',
},
{
description: 'string',
start_time: '1970-01-01T00:00:00.000Z',
end_time: '1970-01-01T00:00:00.000Z',
timezone: 'string',
is_all_day: true,
location: 'string',
status: 'free',
is_cancelled: true,
sensitivity: 'normal',
_title: 'string'
},
)
Response
{
"_id": "string",
"_schema": "calendar_event",
"_org": "string",
"_title": "string",
"_tags": ["string"],
"calendar_id": "string",
"event_type": "singleInstance",
"description": "string",
"start_time": "1970-01-01T00:00:00.000Z",
"end_time": "1970-01-01T00:00:00.000Z",
"timezone": "string",
"is_all_day": true,
"location": "string",
"status": "free",
"busy": true,
"is_cancelled": true,
"is_draft": true,
"sensitivity": "normal",
"importance": "low",
"is_online_meeting": true,
"online_meeting_url": "https://example.com/path",
"web_link": "https://example.com/path",
"response_status": "none",
"organizer_email": "user@example.com",
"attendees": [
{
"email": "user@example.com",
"name": "string",
"response": "none",
"type": "required"
}
],
"metadata": {},
"is_recurring": true,
"series_master_id": "string",
"source": {
"type": "native",
"provider": "outlook",
"provider_event_id": "string",
"provider_event_url": "https://example.com/path",
"last_synced_at": "1970-01-01T00:00:00.000Z",
"etag": "string"
},
"_created_at": "1970-01-01T00:00:00.000Z",
"_updated_at": "1970-01-01T00:00:00.000Z"
}
deleteEventโ
Delete a native epilot calendar event.
DELETE /v1/calendar/events/{event_id}
const { data } = await client.deleteEvent({
event_id: 'example',
})
shareEventโ
Share a calendar event with another user of the same organization, view-only. Owner-only: recipients of a share cannot re-share. Sharing an already-shared event is a no-op.
POST /v1/calendar/events/{event_id}/share
const { data } = await client.shareEvent(
{
event_id: 'example',
},
{
user_id: 'string'
},
)
unshareEventโ
Revoke a per-event share. The recipient loses access immediately. Owner-only.
DELETE /v1/calendar/events/{event_id}/share/{user_id}
const { data } = await client.unshareEvent({
event_id: 'example',
user_id: 'example',
})
Schemasโ
AbsenceIntervalโ
type AbsenceInterval = {
from: string // date-time
to: string // date-time
original_from: string // date-time
original_to: string // date-time
absent: boolean
source: "calendar_event" | "absence_adjustment" | "working_hours"
calendar_event_id?: string
absence_adjustment_id?: string
reason?: string
}
AbsenceIntervalSourceโ
type AbsenceIntervalSource = "calendar_event" | "absence_adjustment" | "working_hours"
Errorโ
type Error = {
status: number
error: string | unknown[]
}
SearchAbsenceBodyโ
type SearchAbsenceBody = {
from: string // date-time
to: string // date-time
user_ids: string[]
include_busy?: boolean
working_hours_granularity?: "time" | "day"
}
SearchNowAbsenceBodyโ
type SearchNowAbsenceBody = {
user_ids: string[]
include_busy?: boolean
working_hours_granularity?: "time" | "day"
}
AbsenceAdjustmentโ
type AbsenceAdjustment = {
from: string // date-time
to: string // date-time
absent: boolean
status: "oof" | "busy"
type?: string
reason?: string
adjustment_id: string
user_id: string
created_by: string
created_at: string // date-time
updated_at: string // date-time
}
AbsenceStatusโ
Calendar status targeted by the absence adjustment.
type AbsenceStatus = "oof" | "busy"
AbsenceTypeโ
Optional producer-defined reference stored with an absence adjustment.
type AbsenceType = string
CreateAbsenceAdjustmentBodyโ
type CreateAbsenceAdjustmentBody = {
from: string // date-time
to: string // date-time
absent: boolean
status: "oof" | "busy"
type?: string
reason?: string
}
PatchAbsenceAdjustmentBodyโ
type PatchAbsenceAdjustmentBody = {
from?: string // date-time
to?: string // date-time
absent?: boolean
status?: "oof" | "busy"
type?: string
reason?: string
}
ExternalCalendarโ
type ExternalCalendar = {
provider: "outlook" | "google"
last_synced_at: string // date-time
}
WorkingHoursโ
Recurring weekly working hours of a user. The absence of a record means the user is treated as always available.
type WorkingHours = {
monday: Array<{
start: string
end: string
}>
tuesday: Array<{
start: string
end: string
}>
wednesday: Array<{
start: string
end: string
}>
thursday: Array<{
start: string
end: string
}>
friday: Array<{
start: string
end: string
}>
saturday: Array<{
start: string
end: string
}>
sunday: Array<{
start: string
end: string
}>
timezone: string
user_id: string
updated_by: string
created_at: string // date-time
updated_at: string // date-time
}
UpsertWorkingHoursBodyโ
Full replacement of the working-hours record. All weekdays are required; an empty array means a day off. Users without a working-hours record are treated as always available.
type UpsertWorkingHoursBody = {
monday: Array<{
start: string
end: string
}>
tuesday: Array<{
start: string
end: string
}>
wednesday: Array<{
start: string
end: string
}>
thursday: Array<{
start: string
end: string
}>
friday: Array<{
start: string
end: string
}>
saturday: Array<{
start: string
end: string
}>
sunday: Array<{
start: string
end: string
}>
timezone?: string
}
TimeWindowโ
A wall-clock working window within a single day.
type TimeWindow = {
start: string
end: string
}
Calendarโ
type Calendar = {
_id: string
_schema: "calendar"
_org: string
_title?: string
name: string
description?: string
color?: string
is_default: boolean
is_epilot_default: boolean
read_only: boolean
owner_email?: string // email
source: {
type: "native" | "synced"
provider?: "outlook" | "google" | null
provider_calendar_id?: string
last_synced_at?: string // date-time
}
_created_at?: string // date-time
_updated_at?: string // date-time
}
CalendarSourceโ
type CalendarSource = {
type: "native" | "synced"
provider?: "outlook" | "google" | null
provider_calendar_id?: string
last_synced_at?: string // date-time
}
Providerโ
Null for native epilot calendars
type Provider = "outlook" | "google" | null
CalendarCreateBodyโ
type CalendarCreateBody = {
name: string
description?: string
color?: string
}
AddOutlookCalendarRequestโ
type AddOutlookCalendarRequest = {
provider_calendar_id: string
name?: string
}
AvailableOutlookCalendarโ
type AvailableOutlookCalendar = {
provider_calendar_id: string
name: string
color?: string
is_default?: boolean
can_edit?: boolean
owner?: string
}
CalendarPatchBodyโ
type CalendarPatchBody = {
name?: string
description?: string
color?: string
}
CalendarEventโ
type CalendarEvent = {
_id: string
_schema: "calendar_event"
_org: string
_title?: string
_tags?: string[]
calendar_id: string
event_type: "singleInstance" | "occurrence" | "exception" | "seriesMaster"
description?: string
start_time: string // date-time
end_time: string // date-time
timezone: string
is_all_day: boolean
location?: string
status: "free" | "tentative" | "busy" | "oof" | "workingElsewhere" | "unknown"
busy: boolean
is_cancelled: boolean
is_draft: boolean
sensitivity: "normal" | "personal" | "private" | "confidential"
importance: "low" | "normal" | "high"
is_online_meeting: boolean
online_meeting_url?: string // uri
web_link?: string // uri
response_status: "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
organizer_email?: string // email
attendees?: Array<{
email: string // email
name?: string
response: "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
type: "required" | "optional" | "resource"
}>
metadata?: Record<string, unknown>
is_recurring: boolean
series_master_id?: string
source: {
type: "native" | "synced"
provider?: "outlook" | "google" | null
provider_event_id?: string
provider_event_url?: string // uri
last_synced_at?: string // date-time
etag?: string
}
_created_at?: string // date-time
_updated_at?: string // date-time
}
EventTypeโ
type EventType = "singleInstance" | "occurrence" | "exception" | "seriesMaster"
EventStatusโ
Free/busy state derived from provider showAs
type EventStatus = "free" | "tentative" | "busy" | "oof" | "workingElsewhere" | "unknown"
Sensitivityโ
type Sensitivity = "normal" | "personal" | "private" | "confidential"
Importanceโ
type Importance = "low" | "normal" | "high"
ResponseStatusโ
Caller's response to the invite
type ResponseStatus = "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
Attendeeโ
type Attendee = {
email: string // email
name?: string
response: "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
type: "required" | "optional" | "resource"
}
EventSourceโ
type EventSource = {
type: "native" | "synced"
provider?: "outlook" | "google" | null
provider_event_id?: string
provider_event_url?: string // uri
last_synced_at?: string // date-time
etag?: string
}
CalendarEventCreateBodyโ
type CalendarEventCreateBody = {
calendar_id?: string
description?: string
start_time: string // date-time
end_time: string // date-time
timezone: string
is_all_day: boolean
location?: string
status: "free" | "tentative" | "busy" | "oof" | "workingElsewhere" | "unknown"
sensitivity: "normal" | "personal" | "private" | "confidential"
metadata?: Record<string, unknown>
_title: string
}
CalendarEventPatchBodyโ
type CalendarEventPatchBody = {
description?: string
start_time?: string // date-time
end_time?: string // date-time
timezone?: string
is_all_day?: boolean
location?: string
status?: "free" | "tentative" | "busy" | "oof" | "workingElsewhere" | "unknown"
is_cancelled?: boolean
sensitivity?: "normal" | "personal" | "private" | "confidential"
_title?: string
}
ShareEventBodyโ
type ShareEventBody = {
user_id: string
}