calendar
Classes
CalendarClient
CalendarClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Calendar endpoints.
- Code Reference client Classes OpenWebUI Attributes calendar
Source code in src/owui_client/client_base.py
Functions
get_calendars
get_calendars() -> List[CalendarModel]
List the authenticated user's calendars (owned + shared).
Includes a virtual "Scheduled Tasks" calendar when the automations feature is available to the user.
Returns:
| Type | Description |
|---|---|
List[CalendarModel]
|
List[CalendarModel]: All accessible calendars. |
Source code in src/owui_client/routers/calendar.py
create_calendar
create_calendar(
form_data: CalendarForm,
) -> Optional[CalendarModel]
Create a new user calendar.
Public access grants are filtered by the server based on the user's sharing permissions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
CalendarForm
|
Calendar definition with name, optional color, and optional access grants. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarModel]
|
Optional[CalendarModel]: The created calendar. |
Source code in src/owui_client/routers/calendar.py
get_calendar_by_id
get_calendar_by_id(
calendar_id: str,
) -> Optional[CalendarModel]
Get a single calendar by ID.
Requires read access to the calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The calendar ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarModel]
|
Optional[CalendarModel]: The calendar if found and accessible. |
Source code in src/owui_client/routers/calendar.py
update_calendar
update_calendar(
calendar_id: str, form_data: CalendarUpdateForm
) -> Optional[CalendarModel]
Update a calendar by ID.
Only the owner or admin can modify access grants. The data and
meta dicts are merged (new keys overwrite existing ones).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The calendar ID. |
required |
form_data
|
CalendarUpdateForm
|
Fields to update. Only set fields are applied. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarModel]
|
Optional[CalendarModel]: The updated calendar. |
Source code in src/owui_client/routers/calendar.py
delete_calendar
Delete a non-default, non-system calendar.
Cascades to events, attendees, and access grants. Only the owner or admin can delete. Default and system calendars cannot be deleted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The calendar ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if deletion succeeded. |
Source code in src/owui_client/routers/calendar.py
set_default_calendar
set_default_calendar(
calendar_id: str,
) -> Optional[CalendarModel]
Set a calendar as the user's default.
Clears the default flag from all other user calendars and sets it on the specified one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calendar_id
|
str
|
The calendar ID to make default. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarModel]
|
Optional[CalendarModel]: The updated calendar. |
Source code in src/owui_client/routers/calendar.py
get_events
get_events(
start: str,
end: str,
calendar_ids: Optional[List[str]] = None,
) -> List[CalendarEventUserResponse]
Get events in a date range, with recurring-event expansion.
Returns stored events from accessible calendars plus virtual "Scheduled Tasks" events from active automations. Recurring events are expanded into individual instances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
str
|
ISO 8601 datetime string for range start, e.g.
|
required |
end
|
str
|
ISO 8601 datetime string for range end, e.g.
|
required |
calendar_ids
|
Optional[List[str]]
|
Optional list of calendar IDs to filter by. |
None
|
Returns:
| Type | Description |
|---|---|
List[CalendarEventUserResponse]
|
List[CalendarEventUserResponse]: Expanded events in the range. |
Source code in src/owui_client/routers/calendar.py
create_event
create_event(
form_data: CalendarEventForm,
) -> Optional[CalendarEventModel]
Create a new calendar event.
Requires write access to the target calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
CalendarEventForm
|
Event definition with calendar_id, title, start_at, and optional fields. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarEventModel]
|
Optional[CalendarEventModel]: The created event with attendees. |
Source code in src/owui_client/routers/calendar.py
search_events
search_events(
query: Optional[str] = None,
skip: int = 0,
limit: int = 30,
) -> CalendarEventListResponse
Search calendar events by text.
Searches title, description, and location fields across all accessible calendars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
Optional[str]
|
Optional search string. |
None
|
skip
|
int
|
Number of results to skip. Defaults to 0. |
0
|
limit
|
int
|
Maximum results to return. Defaults to 30. |
30
|
Returns:
| Type | Description |
|---|---|
CalendarEventListResponse
|
|
Source code in src/owui_client/routers/calendar.py
get_event_by_id
get_event_by_id(
event_id: str,
) -> Optional[CalendarEventModel]
Get a single event by ID.
Requires read access to the event's calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
str
|
The event ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarEventModel]
|
Optional[CalendarEventModel]: The event if found and accessible. |
Source code in src/owui_client/routers/calendar.py
update_event
update_event(
event_id: str, form_data: CalendarEventUpdateForm
) -> Optional[CalendarEventModel]
Update an event by ID.
Requires write access to the event's calendar. The data and
meta dicts are merged (new keys overwrite existing ones).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
str
|
The event ID. |
required |
form_data
|
CalendarEventUpdateForm
|
Fields to update. Only set fields are applied. |
required |
Returns:
| Type | Description |
|---|---|
Optional[CalendarEventModel]
|
Optional[CalendarEventModel]: The updated event. |
Source code in src/owui_client/routers/calendar.py
delete_event
Delete an event and its attendees.
Requires write access to the event's calendar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
str
|
The event ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if deletion succeeded. |
Source code in src/owui_client/routers/calendar.py
rsvp_event
Update the authenticated user's RSVP status for an event.
The user must be an attendee of the event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
str
|
The event ID. |
required |
status
|
str
|
RSVP status: 'accepted', 'declined', 'tentative', or 'pending'. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
|