Skip to the documentation
Java

client.calendar()

Every method in this namespace: its signature, its parameters, what it returns and an example.

Methods

Calendar events found in mail or put on the calendar here, expanded into occurrences, with invitations, changes, cancellations and answers sent by email.

calendar().listEvents

List one page of event occurrences inside a time window

Scopescalendar:readPages through results
Signature
Page listEvents(RequestOptions options)

Expands your events into their occurrences between from and to and returns one page of them, sorted by start time and then by event id. A recurring series gives one row per instance in the window, with its excluded dates left out, and every row points back to its event through eventId. The window is required because a repeating series has no end to list up to. Follow nextCursor while hasMore is true, with the same from, to and timezone, to read every occurrence, or let listAllEvents and iterateEvents do that walk.

to must be after from and at most 366 days later. A missing from or to is a 422 invalid_parameter, while a value that does not parse, a reversed or overlong window, or an unknown zone is a 400 invalid_parameter naming the field. Both bounds take an Instant or an ISO 8601 string, and the SDK sends an Instant as an ISO 8601 instant in UTC.

timezone is an IANA zone and defaults to UTC on the server. It is used to expand any event stored without a zone of its own, which is what decides the day an all day event lands on.

Parameters

options.fromInstant or StringRequired

Start of the window.

options.toInstant or StringRequired

End of the window, after from and at most 366 days later.

options.timezoneString

IANA zone such as Europe/London, at most 64 characters. Defaults to UTC.

options.includeTeamboolean

true adds the events of the rest of the workspace, apart from the ones marked private. Only a key of the workspace owner sees more with it. Defaults to false.

options.qString

Words to look for in the title, the place and the organiser, at most 200 characters. Only events that hold every word come back, so pass a long window to find an event by name.

options.calendarIdsList<String>

Only the events in these calendars, by the ids listCalendars returns, sent as one comma-separated parameter. Events from calendar subscriptions are left out when you name calendars.

options.limitint

Occurrences per page, a whole number from 1 to 100. The server defaults to 25.

options.cursorString

The nextCursor of the previous page, sent with the same window. It is opaque, so never build one yourself.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A Page of occurrence maps with items, hasMore and nextCursor. Each item has eventId, uid, start, end, allDay, summary, location, status, transparency, isOrganizer, organizerEmail, recurring, myPartstat and attendeeCount.

Example

Page page = client.calendar().listEvents(RequestOptions.create()    .set("from", "2026-10-10T22:34:28.823Z")    .set("to", "2026-10-17T22:34:28.823Z")    .set("timezone", "Europe/London")    .limit(50)); for (Map<String, Object> occurrence : page) {    System.out.println(occurrence.get("start") + " " + occurrence.get("summary") + " " + occurrence.get("myPartstat"));} if (page.hasMore()) {    System.out.println("Next page: " + page.nextCursor());}

Notes

  • The list holds your own events: the ones you made and the ones an address of yours organises or attends. For the workspace owner and their keys, an address counts as theirs unless it was given to a teammate, and includeTeam set to true adds the rest of the workspace, apart from events somebody marked private. A member's app and a narrowed key always get their own view.

  • myPartstat is the response recorded for one of your own addresses, or for the addresses a narrowed key covers, and null when none of them is an attendee.

  • A narrowed key only sees occurrences whose organiser is one of the addresses it covers or where one of them is an attendee.

  • Cancelled events are not filtered out. Check status for CANCELLED.

  • Nothing in the window is dropped. A series repeats at most once a day, so one series gives at most one row per day of the window, and every one of them is reachable through the pages.

  • The cursor holds the start time and event id of the last row, so an event deleted or moved between pages never breaks the walk. A cursor this list did not hand out is a 400 invalid_cursor.

Also available in

API
GET /calendar/events
TypeScript
calendar.listEvents()
Python
calendar.list_events()
Ruby
calendar.list_events
PHP
calendar->listEvents
Go
Calendar.ListEvents
C#
Calendar.ListEventsAsync

calendar().listAllEvents

Collect every occurrence inside a time window into one list

Scopescalendar:readPages through results
Signature
List<Map<String, Object>> listAllEvents(RequestOptions options)

Walks every page of listEvents for one window and returns all of its occurrences, sorted by start time and then by event id. It follows nextCursor until hasMore is false, sending the same from, to and timezone with each request.

A window of up to 366 days of a busy calendar can hold thousands of occurrences, so prefer iterateEvents when you can stop early.

Parameters

options.fromInstant or StringRequired

Start of the window.

options.toInstant or StringRequired

End of the window, after from and at most 366 days later.

options.timezoneString

IANA zone such as Europe/London, at most 64 characters. Defaults to UTC.

options.includeTeamboolean

true adds the events of the rest of the workspace, apart from the ones marked private. Only a key of the workspace owner sees more with it. Defaults to false.

options.qString

Words to look for in the title, the place and the organiser, at most 200 characters. Only events that hold every word come back, so pass a long window to find an event by name.

options.calendarIdsList<String>

Only the events in these calendars, by the ids listCalendars returns, sent as one comma-separated parameter. Events from calendar subscriptions are left out when you name calendars.

options.limitint

Page size for each request, 1 to 100. The server defaults to 25.

options.cursorString

Starts the walk from this cursor instead of the start of the window.

options.apiKeyString

Overrides the client API key for every page of this walk.

Returns

A list of occurrence maps holding every occurrence in the window, earliest first.

Example

List<Map<String, Object>> occurrences = client.calendar().listAllEvents(RequestOptions.create()    .set("from", "2026-10-01T00:00:00Z")    .set("to", "2026-11-01T00:00:00Z")    .limit(100)); for (Map<String, Object> event : occurrences) {    System.out.println(event.get("status"));}

Notes

  • If any page fails the call throws and the occurrences already fetched are discarded.

Also available in

API
GET /calendar/events
TypeScript
calendar.listAllEvents()
Python
calendar.list_all_events()
Ruby
calendar.list_all_events
PHP
calendar->listAllEvents
Go
Calendar.ListAllEvents
C#
Calendar.ListAllEventsAsync

calendar().iterateEvents

Stream the occurrences inside a time window one at a time

Scopescalendar:readPages through results
Signature
PagedIterable iterateEvents(RequestOptions options)

Returns a PagedIterable over the occurrences in one window that yields them individually, earliest first, and fetches the next page only when the current one is drained. Nothing is requested until you consume it, and breaking out of the loop stops further requests, which makes it the way to find the next free slot or the next meeting without reading the whole window.

The walk ends when hasMore is false, when a page carries no nextCursor, or when the server repeats a cursor.

Parameters

options.fromInstant or StringRequired

Start of the window.

options.toInstant or StringRequired

End of the window, after from and at most 366 days later.

options.timezoneString

IANA zone such as Europe/London, at most 64 characters. Defaults to UTC.

options.includeTeamboolean

true adds the events of the rest of the workspace, apart from the ones marked private. Only a key of the workspace owner sees more with it. Defaults to false.

options.qString

Words to look for in the title, the place and the organiser, at most 200 characters. Only events that hold every word come back, so pass a long window to find an event by name.

options.calendarIdsList<String>

Only the events in these calendars, by the ids listCalendars returns, sent as one comma-separated parameter. Events from calendar subscriptions are left out when you name calendars.

options.limitint

Page size per request, 1 to 100. The server defaults to 25.

options.cursorString

Starts the walk from this cursor instead of the start of the window.

options.apiKeyString

Overrides the client API key for every page of this walk.

Returns

A PagedIterable that yields one occurrence map per step.

Example

for (Map<String, Object> occurrence : client.calendar().iterateEvents(RequestOptions.create()    .set("from", "2026-10-10T22:34:28.825Z")    .set("to", "2026-11-09T22:34:28.825Z"))) {    System.out.println(occurrence.get("myPartstat") + " " + occurrence.get("start") + " " + occurrence.get("summary"));}

Notes

  • A page request that fails throws out of the for loop, after every occurrence of the pages before it has been yielded.

Also available in

API
GET /calendar/events
TypeScript
calendar.iterateEvents()
Python
calendar.iterate_events()
Ruby
calendar.iterate_events
PHP
calendar->iterateEvents
Go
Calendar.IterateEvents
C#
Calendar.IterateEventsAsync

calendar().getEvent

Read an event with its attendees

Scopescalendar:read
Signature
Map<String, Object> getEvent(String id, RequestOptions options)

Returns a stored event with its attendees and their responses. What the server understood from the iCalendar data is structured here: recurrence holds the RRULE text, exdates the excluded instances, organizer the organiser and alarms the reminders, each a map with minutesBefore and action. The raw iCalendar source is not included, and getEventIcs serves the event as a document.

id is the event id, the eventId on an occurrence, and not the iCalendar uid. A recurring series is one event however many occurrences it has, so start and end describe its first instance. messageId and threadId link the event to mail in the mailbox when there is any.

Attendees come back in the order they were added, each with partstat, role, rsvp, cutype and respondedAt. A narrowed key gets a 404 unless one of the addresses it covers organises the event or is on the attendee list, and a key that holds a whole domain covers every address on it.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with id, uid, sequence, summary, description, location, url, start, end, allDay, timezone, recurrence, exdates, status, transparency, visibility, organizer, isOrganizer, source, messageId, threadId, alarms, attendees, createdAt and updatedAt.

Example

Page page = client.calendar().listEvents(RequestOptions.create().set("from", "2026-09-14T00:00:00Z").set("to", "2026-09-21T00:00:00Z")); Map<String, Object> event = client.calendar().getEvent((String) page.items().get(0).get("eventId")); System.out.println(event.get("summary") + " " + event.get("recurrence") + " " + event.get("attendees"));

Notes

  • status, transparency and visibility carry iCalendar values, and default to CONFIRMED, OPAQUE and PUBLIC.

  • An attendee's partstat defaults to NEEDS-ACTION and role to REQ-PARTICIPANT until a response is recorded.

Also available in

API
GET /calendar/events/{id}
TypeScript
calendar.getEvent()
Python
calendar.get_event()
Ruby
calendar.get_event
PHP
calendar->getEvent
Go
Calendar.GetEvent
C#
Calendar.GetEventAsync

calendar().getEventIcs

Download an event as an iCalendar document

Scopescalendar:read
Signature
String getEventIcs(String id, RequestOptions options)

Returns the event serialised as an .ics document, as a raw string rather than parsed JSON. The server sends it as text/calendar; charset=utf-8 with a download filename built from the event's uid, and the SDK requests that type and returns the body untouched.

The document declares METHOD:PUBLISH, and the content type carries no method parameter. That is deliberate: a REQUEST document makes a calendar client offer accept and decline and reply to the organiser, and this endpoint has no authority to invite anyone. Import it to show what the event currently is, not to send an invitation.

It holds one VEVENT with the attendees and their participation status, the recurrence rule, excluded dates and alarms. Lines end in CRLF and long lines are folded. DTSTAMP is the time of the request, so two downloads of an unchanged event differ on that line.

Parameters

idStringRequired

Event id, the eventId of an occurrence.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A string, the iCalendar text from BEGIN:VCALENDAR to END:VCALENDAR.

Example

String ics = client.calendar().getEventIcs("cal_8d3f0a2b9c4e41f7a6b5c2d1"); System.out.println(ics);

Notes

  • Errors still come back as JSON and throw ApiException, so a failure never comes back as a string.

  • Timed events are written in the zone they were created in, as local times with a TZID and a VTIMEZONE that carries the rules of that zone, and all day events as DATE values.

  • A narrowed key gets a 404 on the same terms as getEvent.

Also available in

API
GET /calendar/events/{id}/ics
TypeScript
calendar.getEventIcs()
Python
calendar.get_event_ics()
Ruby
calendar.get_event_ics
PHP
calendar->getEventIcs
Go
Calendar.GetEventIcs
C#
Calendar.GetEventIcsAsync

calendar().createEvent

Put an event on the calendar

Scopescalendar:write
Signature
Map<String, Object> createEvent(Map<String, Object> body, RequestOptions options)

Creates an event, as New event on the Calendar page of the app does. start and end take an Instant or ISO 8601 with a zone, and the SDK sends an Instant as a UTC instant. timezone is the IANA zone the event belongs to, which decides what an all-day event means.

With attendees, an invitation goes to each of them by email from from, which has to be an address the key may send as, so the call also needs emails:send. Send "sendInvites", false to keep it to your own calendar.

Parameters

body.summaryStringRequired

The title, 1 to 255 characters.

body.startInstant or StringRequired

When it starts, an Instant or ISO 8601 with a zone. An Instant is sent as an instant in UTC.

body.endInstant or StringRequired

When it ends, after start and at most two years later.

body.descriptionString

Notes about the event, up to 8,000 characters.

body.locationString

Where it is: a room, an address or a link.

body.urlString

A link that belongs to the event.

body.meetingUrlString

The link to the video call, such as a Zoom, Meet or Teams address. The invitation carries it, so guests get a Join button in their calendar too.

body.allDayboolean

Whether it fills whole days. start and end then mark the days.

body.timezoneString

The IANA zone the event belongs to, UTC unless you say.

body.recurrenceString

An RRULE such as FREQ=WEEKLY;BYDAY=MO when it repeats.

body.attendeesList<Map<String, Object>>

Up to 200 people to invite, each a map with email and, if you like, name and optional.

body.remindersList<Map<String, Object>>

Up to five reminders, each a map with minutesBefore and, if you like, action (DISPLAY, EMAIL or AUDIO, as in sh.nextmail.constants.CalendarReminderActions).

body.transparencyString

OPAQUE shows you busy and TRANSPARENT free, as in sh.nextmail.constants.CalendarTransparencies.

body.visibilityString

PUBLIC, PRIVATE or CONFIDENTIAL, as in sh.nextmail.constants.CalendarVisibilities.

body.sendInvitesboolean

False keeps the change to your own calendar, and sends nothing.

body.fromString

The address the invitations come from. It has to be one the key may send as.

body.calendarIdString

The calendar to put it in: one you keep, or one you are a member of with write access. Your default calendar unless you say.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the new event, shaped like the one calendar().getEvent returns, with its attendees and their responses.

Example

Map<String, Object> event = client.calendar().createEvent(Body.of(    "summary", "Planning",    "start", "2026-10-12T09:00:00Z",    "end", "2026-10-12T09:30:00Z",    "attendees", List.of(Body.of("email", "[email protected]")),    "from", "[email protected]")); System.out.println(event.get("id") + " " + event.get("attendees"));

Notes

  • The SDK does not retry it, because a second call makes a second event and invites everybody again.

  • A key that may not send as from is refused with 403 from_address_forbidden, and an event with attendees and no from with 422 invalid_parameter. Invitations without emails:send are a 403 insufficient_scope.

Also available in

API
POST /calendar/events
TypeScript
calendar.createEvent()
Python
calendar.create_event()
Ruby
calendar.create_event
PHP
calendar->createEvent
Go
Calendar.CreateEvent
C#
Calendar.CreateEventAsync

calendar().updateEvent

Change an event

Scopescalendar:write
Signature
Map<String, Object> updateEvent(String id, Map<String, Object> patch, RequestOptions options)

Changes an event you organise. A field you leave out keeps its value, and attendees replaces the whole list. Everyone invited gets the updated invitation by email from from, so a change to an event with attendees needs emails:send too, unless sendInvites is false.

For a repeating event, scope says which dates change, as the app asks when you edit one date: occurrence changes only the date that starts at occurrenceStart, following that date and every one after it, and series all of them. With following the later dates become a new series with its own id, which is what comes back, and the old one ends the day before.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

patch.summaryString

The title, 1 to 255 characters.

patch.startInstant or String

When it starts, an Instant or ISO 8601 with a zone. An Instant is sent as an instant in UTC.

patch.endInstant or String

When it ends, after start and at most two years later.

patch.descriptionString

Notes about the event, up to 8,000 characters.

patch.locationString

Where it is: a room, an address or a link.

patch.urlString

A link that belongs to the event.

patch.meetingUrlString

The link to the video call. An empty string takes it off.

patch.allDayboolean

Whether it fills whole days. start and end then mark the days.

patch.timezoneString

The IANA zone the event belongs to, UTC unless you say.

patch.recurrenceString

An RRULE such as FREQ=WEEKLY;BYDAY=MO when it repeats.

patch.attendeesList<Map<String, Object>>

Up to 200 people to invite, each a map with email and, if you like, name and optional. It replaces the whole list.

patch.remindersList<Map<String, Object>>

Up to five reminders, each a map with minutesBefore and, if you like, action (DISPLAY, EMAIL or AUDIO, as in sh.nextmail.constants.CalendarReminderActions).

patch.transparencyString

OPAQUE shows you busy and TRANSPARENT free, as in sh.nextmail.constants.CalendarTransparencies.

patch.visibilityString

PUBLIC, PRIVATE or CONFIDENTIAL, as in sh.nextmail.constants.CalendarVisibilities.

patch.sendInvitesboolean

False keeps the change to your own calendar, and sends nothing.

patch.fromString

The address the invitations come from. It has to be one the key may send as.

patch.calendarIdString

Moves the event, with every date of a repeating one, to this calendar: one you keep, or one you are a member of with write access. A move on its own tells nobody.

patch.scopeString

occurrence, following or series: which dates of a repeating event change. Left out, the change reaches the event or date the id names.

patch.occurrenceStartInstant or String

The start of the date you mean, as listEvents gives it. Needed with occurrence and following.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the event as it stands after the change, shaped like the one calendar().getEvent returns, with sequence one higher.

Example

Map<String, Object> event = client.calendar().updateEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("start", "2026-10-12T10:00:00Z", "end", "2026-10-12T10:30:00Z")); System.out.println(event.get("start") + " " + event.get("sequence"));

Notes

  • The SDK does not retry it, because a retry after a lost response sends the update to everybody again.

  • An event organised by somebody else is refused with 403 not_organizer: answer it with respondToEvent instead. An event the key does not reach is a 404.

Also available in

API
PATCH /calendar/events/{id}
TypeScript
calendar.updateEvent()
Python
calendar.update_event()
Ruby
calendar.update_event
PHP
calendar->updateEvent
Go
Calendar.UpdateEvent
C#
Calendar.UpdateEventAsync

calendar().deleteEvent

Remove an event from the calendar

Scopescalendar:write
Signature
Map<String, Object> deleteEvent(String id, RequestOptions options)

Removes an event for good, as Remove does in the app. Nobody else is told, so call off a meeting with others in it with cancelEvent instead. For a repeating event, scope occurrence with occurrenceStart removes one date, and following that date and every one after it.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

options.scopeString

occurrence, following or series: which dates of a repeating event go.

options.occurrenceStartInstant or String

The start of the date you mean, as listEvents gives it. Needed with occurrence and following.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object, id and deleted set to true.

Example

Map<String, Object> result = client.calendar().deleteEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", RequestOptions.create()    .set("scope", "occurrence")    .set("occurrenceStart", "2026-10-19T09:00:00Z")); System.out.println(result.get("id"));

Notes

  • An event organised by somebody else is refused with 403 not_organizer, and an event that is gone or that the key does not reach is a 404. An event you may not remove can still be taken off your own calendar with hideEvent.

Also available in

API
DELETE /calendar/events/{id}
TypeScript
calendar.deleteEvent()
Python
calendar.delete_event()
Ruby
calendar.delete_event
PHP
calendar->deleteEvent
Go
Calendar.DeleteEvent
C#
Calendar.DeleteEventAsync

calendar().cancelEvent

Call off a meeting

Scopescalendar:write
Signature
Map<String, Object> cancelEvent(String id, Map<String, Object> body, RequestOptions options)

Cancels a meeting you organise, as Cancel meeting does in the app. It stays on the calendar with status CANCELLED, and everyone invited is told it is off by email from from, so a meeting with attendees also needs emails:send.

For a repeating meeting, scope occurrence with occurrenceStart calls off one date, and following that date and every one after it. Guests get the matching update.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

body.fromString

The address the cancellation comes from. It has to be one the key may send as.

body.scopeString

occurrence, following or series: which dates of a repeating meeting are called off.

body.occurrenceStartInstant or String

The start of the date you mean, as listEvents gives it. Needed with occurrence and following.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the event, shaped like the one calendar().getEvent returns, with status set to CANCELLED.

Example

Map<String, Object> event = client.calendar().cancelEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("from", "[email protected]")); System.out.println(event.get("status"));

Notes

  • The SDK does not retry it, because a retry sends the cancellation again.

  • An event organised by somebody else is refused with 403 not_organizer.

Also available in

API
POST /calendar/events/{id}/cancel
TypeScript
calendar.cancelEvent()
Python
calendar.cancel_event()
Ruby
calendar.cancel_event
PHP
calendar->cancelEvent
Go
Calendar.CancelEvent
C#
Calendar.CancelEventAsync

calendar().respondToEvent

Answer an invitation

Scopescalendar:writeemails:send
Signature
Map<String, Object> respondToEvent(String id, Map<String, Object> body, RequestOptions options)

Accepts, declines or tentatively accepts an invitation, as the buttons of an invitation do in the app. The answer goes to the organiser by email from the invited address the key may send as, or from respondingAs when the invitation went to more than one of yours, so it needs emails:send as well.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

body.responseStringRequired

ACCEPTED, DECLINED or TENTATIVE, as in sh.nextmail.constants.CalendarResponses.

body.respondingAsString

Which of your invited addresses answers, when there is more than one.

body.proposedStartInstant or String

A new start to propose with your answer, an Instant or ISO 8601 with a zone, sent together with proposedEnd. An Instant is sent as an instant in UTC.

body.proposedEndInstant or String

The end of the proposed time.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the event, shaped like the one calendar().getEvent returns, with your answer on your attendee row.

Example

Map<String, Object> event = client.calendar().respondToEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("response", "ACCEPTED")); System.out.println(event.get("attendees"));

Notes

  • An event that invited none of the addresses the key may send as is refused with 403 not_invited, and a cancelled meeting with 409 event_cancelled.

  • When the organiser cannot be reached, nothing changes and the call is a 409 reply_not_sent.

  • With proposedStart and proposedEnd the organiser gets a counter-proposal, as Propose a new time sends from Google Calendar and Outlook, and decides whether to move the meeting.

Also available in

API
POST /calendar/events/{id}/respond
TypeScript
calendar.respondToEvent()
Python
calendar.respond_to_event()
Ruby
calendar.respond_to_event
PHP
calendar->respondToEvent
Go
Calendar.RespondToEvent
C#
Calendar.RespondToEventAsync

calendar().declineProposal

Decline a proposed time

Scopescalendar:writeemails:send
Signature
Map<String, Object> declineProposal(String id, Map<String, Object> body, RequestOptions options)

Keeps the original time of a meeting you organise after a guest proposed another one, as Keep the original does on the event in the app. The guest is told by email from from, or from the organising address, so it needs emails:send as well. To take the proposed time instead, change the event with calendar().updateEvent.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

body.attendeeStringRequired

The guest whose proposal you decline, by email address.

body.fromString

The address the answer is sent from, when it is not the organising address.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the event, shaped like the one calendar().getEvent returns, with the guest's proposedStart and proposedEnd cleared.

Example

Map<String, Object> event = client.calendar().declineProposal("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("attendee", "[email protected]")); System.out.println(event.get("summary") + " keeps its time");

Notes

Also available in

API
POST /calendar/events/{id}/decline-proposal
TypeScript
calendar.declineProposal()
Python
calendar.decline_proposal()
Ruby
calendar.decline_proposal
PHP
calendar->declineProposal
Go
Calendar.DeclineProposal
C#
Calendar.DeclineProposalAsync

calendar().hideEvent

Hide an event from your calendar

Scopescalendar:write
Signature
Map<String, Object> hideEvent(String id, RequestOptions options)

Takes an event off your own calendar and leaves it for everyone else, as Hide from my calendar does in the app. Use it for an invitation that reached you through a shared address, or an event you may not remove. It hides every date of a repeating event, and stops its reminders for you. unhideEvent brings it back.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object, id, uid and hidden set to true.

Example

Map<String, Object> hidden = client.calendar().hideEvent("cal_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(hidden.get("id") + " " + hidden.get("hidden"));

Notes

  • Hiding an event that is already hidden changes nothing, so it is safe to repeat. An event the key does not reach is a 404.

  • It hides the event for the person the key or app acts for, and nobody else. listEvents leaves it out from then on, and getEvent still finds it, with hidden true.

Also available in

API
POST /calendar/events/{id}/hide
TypeScript
calendar.hideEvent()
Python
calendar.hide_event()
Ruby
calendar.hide_event
PHP
calendar->hideEvent
Go
Calendar.HideEvent
C#
Calendar.HideEventAsync

calendar().unhideEvent

Show a hidden event again

Scopescalendar:write
Signature
Map<String, Object> unhideEvent(String id, RequestOptions options)

Puts an event you hid back on your calendar, as Show on my calendar does on the invitation in the app.

Parameters

idStringRequired

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object, id, uid and hidden set to false.

Example

Map<String, Object> shown = client.calendar().unhideEvent("cal_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(shown.get("id") + " " + shown.get("hidden"));

Notes

  • An event that was not hidden stays as it was, so it is safe to repeat.

Also available in

API
POST /calendar/events/{id}/unhide
TypeScript
calendar.unhideEvent()
Python
calendar.unhide_event()
Ruby
calendar.unhide_event
PHP
calendar->unhideEvent
Go
Calendar.UnhideEvent
C#
Calendar.UnhideEventAsync

calendar().freeBusy

Free and busy times

Scopescalendar:read
Signature
Map<String, Object> freeBusy(RequestOptions options)

When the people you name are busy, as Find a time in the event editor of the app shows it. An address of the workspace shows the busy times of the person who holds it, from their events, the invitations they have not declined, their subscribed calendars and their bookings, without any detail. Any other address comes back with known false.

With durationMinutes, suggestions lists up to five times when everyone known is free, on weekdays between 09:00 and 17:00 in timezone. from and to take an Instant or an ISO 8601 string and may be at most 31 days apart.

Parameters

options.emailsList<String>Required

The addresses to look up, at most 20.

options.fromInstant or StringRequired

The start of the window.

options.toInstant or StringRequired

The end of the window, at most 31 days after from.

options.timezoneString

The IANA zone the suggested times keep to working hours in, UTC unless you say.

options.durationMinutesint

The length of the meeting, 5 to 480 minutes. Send it to get suggestions.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with people, each with email, known and busy, its busy times as maps with start and end, and suggestions in the same shape.

Example

Map<String, Object> times = client.calendar().freeBusy(RequestOptions.create()    .set("emails", List.of("[email protected]", "[email protected]"))    .set("from", "2026-10-19T00:00:00Z")    .set("to", "2026-10-26T00:00:00Z")    .set("timezone", "Europe/London")    .set("durationMinutes", 30)); System.out.println(times.get("people") + " " + times.get("suggestions"));

Notes

  • A key or an app limited to particular addresses or domains is refused with 422 capability_unsupported, because the answer reads whole calendars.

  • It reads the calendars as they are now and holds nothing, so a suggested time can be gone a moment later.

Also available in

API
GET /calendar/free-busy
TypeScript
calendar.freeBusy()
Python
calendar.free_busy()
Ruby
calendar.free_busy
PHP
calendar->freeBusy
Go
Calendar.FreeBusy
C#
Calendar.FreeBusyAsync

calendar().listCalendars

List your calendars

Scopescalendar:read
Signature
List<Map<String, Object>> listCalendars(RequestOptions options)

Every calendar you keep, your default one among them, then the calendars other members of the workspace gave you access to, as the calendar list beside the Calendar page shows them. Each event is in one calendar, new events and invitations go to your default calendar, and calendar apps that sync over CalDAV show each calendar as one of its own. Your to-do lists are calendars too: kind set to todos lists them instead.

Parameters

options.kindString

events for your calendars of events, or todos for your to-do lists, as in sh.nextmail.constants.CalendarKinds. events unless you say.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A list of calendar maps, the ones you keep first, each with id, kind, name, color, description, isDefault, position, access, owner, members, createdAt and updatedAt. A calendar you keep lists its members, and one you are a member of has members set to null and the access its keeper gave you. access is one of sh.nextmail.constants.CollectionRights.

Example

List<Map<String, Object>> calendars = client.calendar().listCalendars(); for (Map<String, Object> calendar : calendars) {    String marker = Boolean.TRUE.equals(calendar.get("isDefault")) ? " (default)" : "";     System.out.println(calendar.get("name") + " " + calendar.get("access") + marker);}

Notes

  • A key or app limited to some addresses is refused with 422 capability_unsupported, because calendars belong to a person, not to an address.

  • An API key lists the calendars of the workspace owner, and an app those of the person who connected it.

Also available in

API
GET /calendar/calendars
TypeScript
calendar.listCalendars()
Python
calendar.list_calendars()
Ruby
calendar.list_calendars
PHP
calendar->listCalendars
Go
Calendar.ListCalendars
C#
Calendar.ListCalendarsAsync

calendar().getCalendar

Get one calendar

Scopescalendar:read
Signature
Map<String, Object> getCalendar(String id, RequestOptions options)

One calendar you keep or are a member of, with its members when you keep it.

Parameters

idStringRequired

The calendar id, cln_ followed by 24 hex characters, as listCalendars returns it.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A calendar map with id, kind, name, color, description, isDefault, position, access, owner, members, createdAt and updatedAt. On a calendar you keep, members lists each member with memberId, name, email and access, and on one you are a member of it is null. access is one of sh.nextmail.constants.CollectionRights.

Example

Map<String, Object> calendar = client.calendar().getCalendar("cln_3f9a1c7e5b2d48a06c1e9f4b");int members = calendar.get("members") instanceof List<?> list ? list.size() : 0; System.out.println(calendar.get("name") + " " + members);

Notes

Also available in

API
GET /calendar/calendars/{id}
TypeScript
calendar.getCalendar()
Python
calendar.get_calendar()
Ruby
calendar.get_calendar
PHP
calendar->getCalendar
Go
Calendar.GetCalendar
C#
Calendar.GetCalendarAsync

calendar().createCalendar

Create a calendar

Scopescalendar:write
Signature
Map<String, Object> createCalendar(Map<String, Object> body, RequestOptions options)

Makes a new calendar of yours, such as Work or Family, as New calendar does in the app. Put events in it with calendarId on createEvent, or move them there with updateEvent. With kind set to todos it is a to-do list instead, for createTodo.

Parameters

body.nameStringRequired

The name the apps show, 1 to 100 characters.

body.kindString

events for a calendar of events, or todos for a to-do list, as in sh.nextmail.constants.CalendarKinds. events unless you say.

body.colorString

The colour its events are drawn in, as in sh.nextmail.constants.CalendarColors. Blue unless you say.

body.descriptionString or null

What the calendar is for, up to 1,000 characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the new calendar, which is never your default one.

Example

Map<String, Object> calendar = client.calendar().createCalendar(Body.of("name", "Family", "color", CalendarColors.GREEN)); Map<String, Object> event = client.calendar().createEvent(Body.of(    "summary", "School play",    "start", "2026-12-04T17:00:00Z",    "end", "2026-12-04T19:00:00Z",    "calendarId", calendar.get("id"))); System.out.println(calendar.get("id") + " " + event.get("id"));

Notes

  • One person may keep 50 calendars and 50 to-do lists. One more is refused with 409 calendar_limit.

  • Not retried automatically, because a second call makes a second calendar.

Also available in

API
POST /calendar/calendars
TypeScript
calendar.createCalendar()
Python
calendar.create_calendar()
Ruby
calendar.create_calendar
PHP
calendar->createCalendar
Go
Calendar.CreateCalendar
C#
Calendar.CreateCalendarAsync

calendar().updateCalendar

Change a calendar

Scopescalendar:write
Signature
Map<String, Object> updateCalendar(String id, Map<String, Object> patch, RequestOptions options)

Renames a calendar you keep, describes it, gives it another colour, moves it in your list or makes it your default. For a calendar you are a member of, color and position are your own and change only for you.

Parameters

idStringRequired

The calendar id, cln_ followed by 24 hex characters, as listCalendars returns it.

patch.nameString

The new name, 1 to 100 characters.

patch.colorString

The new colour, as in sh.nextmail.constants.CalendarColors.

patch.descriptionString or null

What the calendar is for, up to 1,000 characters. An explicit null clears it.

patch.positionint

Its place in your list, from 0 at the top. The calendars you keep and the ones you are a member of are ordered apart.

patch.isDefaultboolean

true makes it your default calendar, where new events and invitations go.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the calendar as it stands now.

Example

Map<String, Object> calendar = client.calendar().updateCalendar("cln_3f9a1c7e5b2d48a06c1e9f4b", Body.of(    "name", "Work",    "color", CalendarColors.PURPLE,    "isDefault", true)); System.out.println(calendar.get("name") + " " + calendar.get("isDefault"));

Notes

  • Renaming or describing a calendar you are a member of is a 403 calendar_not_owned.

  • Sending isDefault as false for your default calendar is a 409 calendar_is_default: make another calendar the default instead.

Also available in

API
PATCH /calendar/calendars/{id}
TypeScript
calendar.updateCalendar()
Python
calendar.update_calendar()
Ruby
calendar.update_calendar
PHP
calendar->updateCalendar
Go
Calendar.UpdateCalendar
C#
Calendar.UpdateCalendarAsync

calendar().deleteCalendar

Delete a calendar

Scopescalendar:write
Signature
Map<String, Object> deleteCalendar(String id, RequestOptions options)

Deletes a calendar you keep and the events in it, as Delete calendar does in the app. Everyone invited to an upcoming meeting you organised in it is sent a cancellation from the address that invited them, as cancelEvent does, unless notifyGuests is false. A meeting that came in through a calendar import is cancelled quietly unless notifyGuests is true. Its members lose it, and calendar links that publish it stop working. A to-do list goes with its to-dos. For a calendar you are a member of, you leave it, it stays with its keeper and nobody is told.

Parameters

idStringRequired

The calendar id, cln_ followed by 24 hex characters, as listCalendars returns it.

options.notifyGuestsboolean

false deletes it without telling anyone. Left out or true, the guests of its upcoming meetings are sent a cancellation, and true tells the guests of imported meetings too.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object set to calendar, id, deleted set to true and cancelledMeetings, how many meetings had their guests told.

Example

Map<String, Object> gone = client.calendar().deleteCalendar("cln_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(gone.get("cancelledMeetings") + " meetings cancelled");

Notes

  • Your default calendar cannot be deleted: that is a 409 calendar_is_default.

  • Sending the cancellations needs emails:send as well. A key without it sets notifyGuests to false.

  • There is no undo, and the SDK does not retry it after a network failure.

Also available in

API
DELETE /calendar/calendars/{id}
TypeScript
calendar.deleteCalendar()
Python
calendar.delete_calendar()
Ruby
calendar.delete_calendar
PHP
calendar->deleteCalendar
Go
Calendar.DeleteCalendar
C#
Calendar.DeleteCalendarAsync

calendar().setCalendarMember

Give a member access to a calendar

Scopescalendar:write
Signature
Map<String, Object> setCalendarMember(String id, String memberId, Map<String, Object> body, RequestOptions options)

Gives a member of the workspace access to a calendar you keep, or changes what they may do. With read they see its events beside their own calendars, and with write they also add, change, move and remove them. Their phones and computers show it as a calendar of its own over CalDAV. Events marked private stay out of their view.

Parameters

idStringRequired

The calendar id, cln_ followed by 24 hex characters, as listCalendars returns it.

memberIdStringRequired

The member id of the person, as members().list returns it.

body.accessStringRequired

read or write, as in sh.nextmail.constants.CollectionAccessLevels.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the member with the access they now have: object set to calendar_member, calendarId, memberId, name, email, access, createdAt and updatedAt.

Example

Map<String, Object> member = client.calendar().setCalendarMember("cln_3f9a1c7e5b2d48a06c1e9f4b", "q7Vd3kX9mT2pLw8RzN4bYc6HfJ1sGa5E", Body.of("access", CollectionAccessLevels.WRITE)); System.out.println(member.get("email") + " " + member.get("access"));

Notes

  • The SDK retries this call after a network failure, since setting the same access twice leaves the same member.

  • A calendar may have 100 members. One more is a 409 calendar_member_limit.

  • Someone outside the workspace is a 422 member_not_found, and yourself a 422 member_is_keeper.

Also available in

API
PUT /calendar/calendars/{id}/members/{memberId}
TypeScript
calendar.setCalendarMember()
Python
calendar.set_calendar_member()
Ruby
calendar.set_calendar_member
PHP
calendar->setCalendarMember
Go
Calendar.SetCalendarMember
C#
Calendar.SetCalendarMemberAsync

calendar().removeCalendarMember

Take away a member's access to a calendar

Scopescalendar:write
Signature
Map<String, Object> removeCalendarMember(String id, String memberId, RequestOptions options)

Takes away a member's access to a calendar you keep. Your own member id leaves a calendar you are a member of.

Parameters

idStringRequired

The calendar id, cln_ followed by 24 hex characters, as listCalendars returns it.

memberIdStringRequired

The member id of the person, as members().list returns it.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object set to calendar_member, calendarId, memberId and deleted set to true.

Example

Map<String, Object> result = client.calendar().removeCalendarMember("cln_3f9a1c7e5b2d48a06c1e9f4b", "q7Vd3kX9mT2pLw8RzN4bYc6HfJ1sGa5E"); System.out.println(result.get("memberId") + " " + result.get("deleted"));

Notes

Also available in

API
DELETE /calendar/calendars/{id}/members/{memberId}
TypeScript
calendar.removeCalendarMember()
Python
calendar.remove_calendar_member()
Ruby
calendar.remove_calendar_member
PHP
calendar->removeCalendarMember
Go
Calendar.RemoveCalendarMember
C#
Calendar.RemoveCalendarMemberAsync

calendar().listCalendarLogins

List calendar sign-ins

Scopesaccount:read
Signature
List<Map<String, Object>> listCalendarLogins(RequestOptions options)

The calendar sign-ins one person holds, newest first: their names, usernames, the last four letters of each password, who made each one and when a calendar or contacts app last used it. The passwords are never shown again.

A calendar sign-in belongs to a person, not to an address. Its username is cal- and ten letters and digits, never an address, so it can never take one, and it signs calendar and contacts apps in over CalDAV and CardDAV to that person's calendars, the calendars and address books other members gave them access to, and their contacts. IMAP, POP3 and SMTP refuse it, and nothing it does sends mail.

Parameters

options.memberString

The user id of a member, as members().list returns it, for the owner or someone whose role manages members. Leave it out for your own, which an API key makes for the workspace owner and an access token for the person who connected the app. Another member's takes members:write instead of account:read.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A list of maps, newest first, each with object set to calendar_login, id, name, username, last4, member, createdBy, createdAt, lastUsedAt, lastUsedProtocol and lastUsedClient. member, the person it signs in as, and createdBy are maps with id, name and email, and createdBy is null when who made it is not known. lastUsedProtocol is caldav or carddav, as in sh.nextmail.constants.MailAppProtocols, and null like lastUsedAt until an app signs in with it. Revoked sign-ins are left out.

Example

List<Map<String, Object>> logins = client.calendar().listCalendarLogins(); for (Map<String, Object> login : logins) {    Object lastUsed = login.get("lastUsedAt") == null ? "never used" : login.get("lastUsedAt");     System.out.println(login.get("name") + " " + login.get("username") + " " + lastUsed);}

Notes

  • A key or app limited to some addresses is refused with 422 capability_unsupported, because a sign-in covers the whole calendar and address book.

  • Someone outside the workspace is a 422 member_not_found, and another member's sign-ins without the authority to manage members a 403 insufficient_authority.

Also available in

API
GET /calendar/logins
TypeScript
calendar.listCalendarLogins()
Python
calendar.list_calendar_logins()
Ruby
calendar.list_calendar_logins
PHP
calendar->listCalendarLogins
Go
Calendar.ListCalendarLogins
C#
Calendar.ListCalendarLoginsAsync

calendar().createCalendarLogin

Create a calendar sign-in

Scopesaccount:write
Signature
Map<String, Object> createCalendarLogin(Map<String, Object> body, RequestOptions options)

Makes a calendar sign-in and returns its username, its password in password, the CalDAV and CardDAV servers in servers and an Apple configuration profile in appleProfile. That is the only time the password is shown, so hand it over or store it then.

A calendar sign-in belongs to a person, not to an address. Its username is cal- and ten letters and digits, never an address, so it can never take one, and it signs calendar and contacts apps in over CalDAV and CardDAV to that person's calendars, the calendars and address books other members gave them access to, and their contacts. IMAP, POP3 and SMTP refuse it, and nothing it does sends mail.

Besides account:write, or members:write for another member, the key or access token has to hold itself each of calendar:read, calendar:write, contacts:read and contacts:write that the person's role holds, because the sign-in carries them. Without one of them the call is refused with 403 insufficient_authority. It writes an entry in the workspace security log.

Parameters

body.nameStringRequired

What to call it, such as the device it is for, 1 to 64 characters. It is trimmed.

body.memberString

The user id of a member, as members().list returns it, for the owner or someone whose role manages members. Leave it out for your own, which an API key makes for the workspace owner and an access token for the person who connected the app. The owner's own sign-ins are made only by the owner.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map shaped like an entry of calendar().listCalendarLogins, plus password, shown this once, servers, a map with the username to enter and the caldav and carddav servers, each a map with url, principalUrl, host, port and security, or null when the person's role does not reach the calendar or contacts, and appleProfile, an Apple configuration profile with the password inside. Saved as a .mobileconfig file and opened on an iPhone, iPad or Mac, it adds the calendars to Calendar and the contacts to Contacts in one step, and no mail account. It holds the password, so keep it like one.

Example

Map<String, Object> created = client.calendar().createCalendarLogin(Body.of("name", "Kitchen iPad"));Map<?, ?> servers = (Map<?, ?>) created.get("servers");Object caldav = servers.get("caldav") instanceof Map<?, ?> server ? server.get("url") : "none"; System.out.println("Server " + caldav);System.out.println("Sign in as " + created.get("username") + " with " + created.get("password"));

Notes

  • One person holds at most 20 calendar sign-ins in a workspace, and the 21st is refused with 422 calendar_login_limit_reached, so revoke one with calendar().revokeCalendarLogin first. A role that reaches neither the calendar nor contacts is refused with 403 calendar_login_no_reach.

  • A key or an access token limited to particular addresses or domains is refused with 422 capability_unsupported.

  • An OAuth access token needs a verification code for this call, and is refused with 403 step_up_required until the app has verified one in the last 60 minutes. isStepUpRequired() on the error says so. An API key is never asked for a code.

  • Not retried automatically by the SDK, since a lost attempt may already have made a sign-in. The success status is 201.

Also available in

API
POST /calendar/logins
TypeScript
calendar.createCalendarLogin()
Python
calendar.create_calendar_login()
Ruby
calendar.create_calendar_login
PHP
calendar->createCalendarLogin
Go
Calendar.CreateCalendarLogin
C#
Calendar.CreateCalendarLoginAsync

calendar().revokeCalendarLogin

Revoke a calendar sign-in

Scopesaccount:write
Signature
Map<String, Object> revokeCalendarLogin(String id, RequestOptions options)

Revokes one calendar sign-in, so the calendar and contacts apps using it are signed out within minutes. The calendars and contacts stay. Your own takes account:write, and another member's takes members:write, held by the owner or someone whose role manages members. It writes an entry in the workspace security log.

Parameters

idStringRequired

The sign-in id, cdl_ followed by 24 hex characters, as calendar().listCalendarLogins returns it.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object set to calendar_login, id and deleted set to true.

Example

Map<String, Object> result = client.calendar().revokeCalendarLogin("cdl_6b1e0f9a3c7d48e25a0b9c14"); System.out.println(result.get("id") + " " + result.get("deleted"));

Notes

  • A sign-in you may not manage, or one already revoked, is a 404 calendar_login_not_found.

  • Not retried by the SDK. Repeating a revoke that succeeded is a 404.

Also available in

API
DELETE /calendar/logins/{id}
TypeScript
calendar.revokeCalendarLogin()
Python
calendar.revoke_calendar_login()
Ruby
calendar.revoke_calendar_login
PHP
calendar->revokeCalendarLogin
Go
Calendar.RevokeCalendarLogin
C#
Calendar.RevokeCalendarLoginAsync

calendar().listTodos

List to-dos

Scopescalendar:readPages through results
Signature
Page listTodos(RequestOptions options)

Returns one page of the to-dos in your to-do lists and in the ones other members of the workspace gave you access to, as the To-dos view of the Calendar page shows them. A to-do list is a calendar of kind todos, and calendar apps such as Reminders, Thunderbird and tasks.org sync each one over CalDAV.

Open to-dos come soonest due first, with the ones without a due date last. Done ones come most recently done first, and all lists the newest first. Paging is keyset. limit takes 1 to 500 and defaults to 100, and nextCursor goes back as cursor while hasMore is true. listAllTodos and iterateTodos do that walk for you.

Parameters

options.calendarIdsList<String>

Only the to-dos in these to-do lists, by the ids listCalendars returns with kind set to todos, sent as one comma-separated parameter. Every to-do list you keep or are a member of unless you say.

options.stateString

open for to-dos still to do, done for completed and cancelled ones, or all, as in sh.nextmail.constants.TodoStates. open unless you say.

options.dueBeforeInstant or String

Only to-dos due before this moment.

options.dueAfterInstant or String

Only to-dos due at or after this moment.

options.limitint

To-dos per page, a whole number from 1 to 500. The server defaults to 100.

options.cursorString

The nextCursor from the previous page. Never build one yourself.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A Page of to-do maps with items, hasMore and nextCursor. Each item has id, calendarId, uid, title, notes, status, start, due, allDay, timezone, completedAt, priority, percentComplete, categories, parentId, recurrence, createdAt and updatedAt, and status is one of sh.nextmail.constants.TodoStatuses.

Example

Page page = client.calendar().listTodos(RequestOptions.create().set("dueBefore", Instant.now().plus(Duration.ofDays(7)))); for (Map<String, Object> todo : page) {    Object due = todo.get("due");     System.out.println((due == null ? "someday" : due) + " " + todo.get("title"));} if (page.hasMore()) {    System.out.println("Next page: " + page.nextCursor());}

Notes

Also available in

API
GET /calendar/todos
TypeScript
calendar.listTodos()
Python
calendar.list_todos()
Ruby
calendar.list_todos
PHP
calendar->listTodos
Go
Calendar.ListTodos
C#
Calendar.ListTodosAsync

calendar().listAllTodos

Collect every to-do into one list

Scopescalendar:readPages through results
Signature
List<Map<String, Object>> listAllTodos(RequestOptions options)

Follows nextCursor from page to page and returns every to-do that matches, in the order listTodos gives them.

Everything is held in memory before the call returns. Prefer iterateTodos when you can stop early. limit sets the page size of each request, not the total.

Parameters

options.calendarIdsList<String>

Only the to-dos in these to-do lists, by the ids listCalendars returns with kind set to todos, sent as one comma-separated parameter. Every to-do list you keep or are a member of unless you say.

options.stateString

open for to-dos still to do, done for completed and cancelled ones, or all, as in sh.nextmail.constants.TodoStates. open unless you say.

options.dueBeforeInstant or String

Only to-dos due before this moment.

options.dueAfterInstant or String

Only to-dos due at or after this moment.

options.limitint

Page size per request, from 1 to 500, defaulting to 100 on the server.

options.cursorString

A cursor from an earlier page to start after.

options.apiKeyString

Overrides the client API key for every page of this walk.

Returns

A list of to-do maps holding every matching to-do across all pages.

Example

List<Map<String, Object>> done = client.calendar().listAllTodos(RequestOptions.create().set("state", TodoStates.DONE)); System.out.println(done.size() + " to-dos done");

Notes

  • A failure on any page fails the whole call, and the to-dos already fetched are discarded.

Also available in

API
GET /calendar/todos
TypeScript
calendar.listAllTodos()
Python
calendar.list_all_todos()
Ruby
calendar.list_all_todos
PHP
calendar->listAllTodos
Go
Calendar.ListAllTodos
C#
Calendar.ListAllTodosAsync

calendar().iterateTodos

Stream to-dos one at a time

Scopescalendar:readPages through results
Signature
PagedIterable iterateTodos(RequestOptions options)

Returns a PagedIterable that yields to-dos one by one, in the order listTodos gives them, and requests the next page only once the current one is drained. Nothing is fetched until you consume it, and breaking out of the loop stops the requests.

Parameters

options.calendarIdsList<String>

Only the to-dos in these to-do lists, by the ids listCalendars returns with kind set to todos, sent as one comma-separated parameter. Every to-do list you keep or are a member of unless you say.

options.stateString

open for to-dos still to do, done for completed and cancelled ones, or all, as in sh.nextmail.constants.TodoStates. open unless you say.

options.dueBeforeInstant or String

Only to-dos due before this moment.

options.dueAfterInstant or String

Only to-dos due at or after this moment.

options.limitint

Page size per request, from 1 to 500, defaulting to 100 on the server.

options.cursorString

A cursor from an earlier page to start after.

options.apiKeyString

Overrides the client API key for every page of this walk.

Returns

A PagedIterable of to-do maps yielding one to-do per step.

Example

for (Map<String, Object> todo : client.calendar().iterateTodos()) {    int priority = todo.get("priority") instanceof Number number ? number.intValue() : 0;     if (priority == 0 || priority > 4) {        continue;    }     System.out.println("urgent " + todo.get("title"));}

Notes

  • The iterable is lazy, so an abandoned loop costs only the pages you consumed.

Also available in

API
GET /calendar/todos
TypeScript
calendar.iterateTodos()
Python
calendar.iterate_todos()
Ruby
calendar.iterate_todos
PHP
calendar->iterateTodos
Go
Calendar.IterateTodos
C#
Calendar.IterateTodosAsync

calendar().getTodo

Get a to-do

Scopescalendar:read
Signature
Map<String, Object> getTodo(String id, RequestOptions options)

One to-do in a to-do list you keep or are a member of.

Parameters

idStringRequired

The to-do id, tdo_ followed by 24 hex characters, as listTodos returns it.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A to-do map with id, calendarId, uid, title, notes, status, start, due, allDay, timezone, completedAt, priority, percentComplete, categories, parentId, recurrence, createdAt and updatedAt. start and due are days as YYYY-MM-DD when allDay is true and ISO 8601 date-times in UTC otherwise, and status is one of sh.nextmail.constants.TodoStatuses.

Example

Map<String, Object> todo = client.calendar().getTodo("tdo_8c1e0f3a9b7d42e65a1c0d9e"); System.out.println(todo.get("title") + " " + todo.get("status") + " " + todo.get("due"));

Notes

  • A to-do that is gone, or that is in a list you cannot reach, is a 404 todo_not_found.

Also available in

API
GET /calendar/todos/{id}
TypeScript
calendar.getTodo()
Python
calendar.get_todo()
Ruby
calendar.get_todo
PHP
calendar->getTodo
Go
Calendar.GetTodo
C#
Calendar.GetTodoAsync

calendar().createTodo

Create a to-do

Scopescalendar:write
Signature
Map<String, Object> createTodo(Map<String, Object> body, RequestOptions options)

Adds a to-do to a to-do list, as the quick add box of the To-dos view does in the app. It goes in your default to-do list unless you name one with calendarId: one you keep, or one you are a member of with write access. Calendar apps that sync the list show it on their next sync.

Parameters

body.titleStringRequired

What has to be done, 1 to 500 characters.

body.calendarIdString

The to-do list to put it in. Your default to-do list unless you say.

body.notesString or null

Notes on the to-do, up to 8,000 characters.

body.statusString

NEEDS-ACTION, IN-PROCESS, COMPLETED or CANCELLED, as in sh.nextmail.constants.TodoStatuses.

body.startInstant, String or null

When work on it can start, in the same form as due.

body.dueInstant, String or null

When it is due: a day as YYYY-MM-DD, or a moment as an Instant or an ISO 8601 date-time. An Instant is sent as an instant in UTC.

body.timezoneString or null

The IANA time zone a moment is written in for calendar apps, such as Europe/Berlin. UTC unless you say.

body.priorityint

From 1, the most urgent, to 9, the least. 0 means none.

body.percentCompleteInteger or null

How far along it is, from 0 to 100.

body.categoriesList<String>

Up to 20 labels of up to 64 characters each.

body.parentIdString or null

Makes it a step of another to-do in the same list.

body.recurrenceString or null

An RRULE, such as FREQ=WEEKLY;BYDAY=MO, that makes it repeat from its start or due date.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A to-do map for the new to-do, shaped like the one calendar().getTodo returns.

Example

List<Map<String, Object>> lists = client.calendar().listCalendars(RequestOptions.create().set("kind", CalendarKinds.TODOS));Body body = Body.of("title", "Renew the passport", "due", "2026-11-20", "priority", 1); for (Map<String, Object> list : lists) {    if (Boolean.TRUE.equals(list.get("isDefault"))) {        body.with("calendarId", list.get("id"));    }} Map<String, Object> todo = client.calendar().createTodo(body); System.out.println(todo.get("id") + " " + todo.get("status"));

Notes

  • start and due are both days or both moments, and a to-do cannot be due before it starts: otherwise a 400 invalid_time.

  • A to-do list holds at most 5,000 to-dos. One more is a 409 todo_limit.

  • calendarId that names a calendar of events is a 422 calendar_wrong_kind.

  • Not retried automatically, because a second call makes a second to-do.

Also available in

API
POST /calendar/todos
TypeScript
calendar.createTodo()
Python
calendar.create_todo()
Ruby
calendar.create_todo
PHP
calendar->createTodo
Go
Calendar.CreateTodo
C#
Calendar.CreateTodoAsync

calendar().updateTodo

Change a to-do

Scopescalendar:write
Signature
Map<String, Object> updateTodo(String id, Map<String, Object> patch, RequestOptions options)

Changes a to-do, checks it off or opens it again, as the To-dos view does in the app. Send only the fields that change, and null to clear one. status COMPLETED stamps completedAt, and on a repeating to-do it moves the to-do to its next date and keeps it open instead. calendarId moves it, with its steps, to another to-do list.

Parameters

idStringRequired

The to-do id, tdo_ followed by 24 hex characters.

patch.titleString

What has to be done, 1 to 500 characters.

patch.calendarIdString

Moves it, with its steps, to this to-do list.

patch.notesString or null

Notes on the to-do, up to 8,000 characters.

patch.statusString

NEEDS-ACTION, IN-PROCESS, COMPLETED or CANCELLED, as in sh.nextmail.constants.TodoStatuses.

patch.startInstant, String or null

When work on it can start, in the same form as due.

patch.dueInstant, String or null

When it is due: a day as YYYY-MM-DD, or a moment as an Instant or an ISO 8601 date-time. An Instant is sent as an instant in UTC.

patch.timezoneString or null

The IANA time zone a moment is written in for calendar apps, such as Europe/Berlin. UTC unless you say.

patch.priorityint

From 1, the most urgent, to 9, the least. 0 means none.

patch.percentCompleteInteger or null

How far along it is, from 0 to 100.

patch.categoriesList<String>

Up to 20 labels of up to 64 characters each.

patch.parentIdString or null

Makes it a step of another to-do in the same list.

patch.recurrenceString or null

An RRULE, such as FREQ=WEEKLY;BYDAY=MO, that makes it repeat from its start or due date.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A to-do map for the to-do as it stands now.

Example

Map<String, Object> todo = client.calendar().updateTodo("tdo_8c1e0f3a9b7d42e65a1c0d9e", Body.of("status", TodoStatuses.COMPLETED)); System.out.println(todo.get("status") + " " + todo.get("completedAt"));

Notes

Also available in

API
PATCH /calendar/todos/{id}
TypeScript
calendar.updateTodo()
Python
calendar.update_todo()
Ruby
calendar.update_todo
PHP
calendar->updateTodo
Go
Calendar.UpdateTodo
C#
Calendar.UpdateTodoAsync

calendar().deleteTodo

Delete a to-do

Scopescalendar:write
Signature
Map<String, Object> deleteTodo(String id, RequestOptions options)

Deletes a to-do and its steps. Calendar apps that sync the list drop them on their next sync.

Parameters

idStringRequired

The to-do id, tdo_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object set to todo, id, deleted set to true and removed, which counts the steps that went with it.

Example

Map<String, Object> gone = client.calendar().deleteTodo("tdo_8c1e0f3a9b7d42e65a1c0d9e"); System.out.println(gone.get("removed") + " to-dos deleted");

Notes

Also available in

API
DELETE /calendar/todos/{id}
TypeScript
calendar.deleteTodo()
Python
calendar.delete_todo()
Ruby
calendar.delete_todo
PHP
calendar->deleteTodo
Go
Calendar.DeleteTodo
C#
Calendar.DeleteTodoAsync

calendar().listFeeds

List calendar links

Scopescalendar:read
Signature
List<Map<String, Object>> listFeeds(RequestOptions options)

Returns the secret links that publish your calendar to other calendar apps, as the Share tab of the calendar settings in the app lists them. Anyone with a link can read what it shows, so treat url and webcalUrl like passwords.

Parameters

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A list of maps, each with id, name, mode, url, webcalUrl and when calendar apps last read it.

Example

List<Map<String, Object>> feeds = client.calendar().listFeeds(); for (Map<String, Object> feed : feeds) {    System.out.println(feed.get("name") + " " + feed.get("mode") + " " + feed.get("url"));}

Notes

  • A key limited to particular addresses or domains is refused with 422 capability_unsupported, because a link covers the whole calendar.

Also available in

API
GET /calendar/feeds
TypeScript
calendar.listFeeds()
Python
calendar.list_feeds()
Ruby
calendar.list_feeds
PHP
calendar->listFeeds
Go
Calendar.ListFeeds
C#
Calendar.ListFeedsAsync

calendar().createFeed

Create a calendar link

Scopescalendar:write
Signature
Map<String, Object> createFeed(Map<String, Object> body, RequestOptions options)

Makes a secret link that publishes your calendar as an iCalendar feed, for Google Calendar (From URL), Outlook (Subscribe from web) or Apple Calendar (New subscription). full shows every detail, busy only the times you are busy. The calendar app reads the link again on its own schedule, usually every few hours.

Parameters

body.nameStringRequired

The name calendar apps show for the calendar, up to 100 characters.

body.modeStringRequired

full for every detail, busy for busy times only, as in sh.nextmail.constants.CalendarFeedModes.

body.calendarIdString

The one calendar you keep that the link publishes. Left out, it publishes every calendar you keep or are a member of, with the events you are invited to.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the link with the new url and webcalUrl.

Example

Map<String, Object> feed = client.calendar().createFeed(Body.of("name", "Work (busy)", "mode", "busy")); System.out.println(feed.get("url"));

Notes

Also available in

API
POST /calendar/feeds
TypeScript
calendar.createFeed()
Python
calendar.create_feed()
Ruby
calendar.create_feed
PHP
calendar->createFeed
Go
Calendar.CreateFeed
C#
Calendar.CreateFeedAsync

calendar().resetFeed

Reset a calendar link

Scopescalendar:write
Signature
Map<String, Object> resetFeed(String id, RequestOptions options)

Replaces the secret in a calendar link, so the old address stops working everywhere it was shared. Paste the new address into the calendar apps you still want to update.

Parameters

idStringRequired

Calendar link id, cfd_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the link with its new url and webcalUrl.

Example

Map<String, Object> feed = client.calendar().resetFeed("cfd_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(feed.get("url"));

Notes

Also available in

API
POST /calendar/feeds/{id}/reset
TypeScript
calendar.resetFeed()
Python
calendar.reset_feed()
Ruby
calendar.reset_feed
PHP
calendar->resetFeed
Go
Calendar.ResetFeed
C#
Calendar.ResetFeedAsync

calendar().deleteFeed

Delete a calendar link

Scopescalendar:write
Signature
Map<String, Object> deleteFeed(String id, RequestOptions options)

Turns a calendar link off for good. Calendar apps that subscribed to it stop getting updates.

Parameters

idStringRequired

Calendar link id, cfd_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object, id and deleted set to true.

Example

Map<String, Object> result = client.calendar().deleteFeed("cfd_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));

Notes

Also available in

API
DELETE /calendar/feeds/{id}
TypeScript
calendar.deleteFeed()
Python
calendar.delete_feed()
Ruby
calendar.delete_feed
PHP
calendar->deleteFeed
Go
Calendar.DeleteFeed
C#
Calendar.DeleteFeedAsync

calendar().listSubscriptions

List calendar subscriptions

Scopescalendar:read
Signature
List<Map<String, Object>> listSubscriptions(RequestOptions options)

Returns the other calendars you subscribe to by link, such as a Google or Outlook calendar address, a team rota or public holidays, as Other calendars in the app lists them. Their events show on your calendar, read-only.

Parameters

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A list of maps, each with name, url, color, status, lastError and how many events it holds.

Example

List<Map<String, Object>> subscriptions = client.calendar().listSubscriptions(); for (Map<String, Object> subscription : subscriptions) {    System.out.println(subscription.get("name") + " " + subscription.get("status") + " " + subscription.get("eventCount"));}

Notes

  • status is failing while reads fail and are retried, and stopped after ten failures in a row until you refresh it.

Also available in

API
GET /calendar/subscriptions
TypeScript
calendar.listSubscriptions()
Python
calendar.list_subscriptions()
Ruby
calendar.list_subscriptions
PHP
calendar->listSubscriptions
Go
Calendar.ListSubscriptions
C#
Calendar.ListSubscriptionsAsync

calendar().createSubscription

Subscribe to a calendar

Scopescalendar:write
Signature
Map<String, Object> createSubscription(Map<String, Object> body, RequestOptions options)

Adds a calendar by its iCalendar link, an https, http or webcal address, such as the secret address of a Google calendar or a published Outlook calendar. It is read at once, then again about every half hour. name defaults to the name the calendar gives itself.

Parameters

body.urlStringRequired

The calendar link, https, http or webcal.

body.nameString

The name to show, up to 100 characters.

body.colorString

The colour of its events, as in sh.nextmail.constants.CalendarColors.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the subscription with its first events read.

Example

Map<String, Object> holidays = client.calendar().createSubscription(Body.of("url", "webcal://example.com/holidays.ics", "color", "green")); System.out.println(holidays.get("name") + " " + holidays.get("eventCount"));

Notes

Also available in

API
POST /calendar/subscriptions
TypeScript
calendar.createSubscription()
Python
calendar.create_subscription()
Ruby
calendar.create_subscription
PHP
calendar->createSubscription
Go
Calendar.CreateSubscription
C#
Calendar.CreateSubscriptionAsync

calendar().updateSubscription

Change a calendar subscription

Scopescalendar:write
Signature
Map<String, Object> updateSubscription(String id, Map<String, Object> patch, RequestOptions options)

Renames a subscription or gives it another colour.

Parameters

idStringRequired

Subscription id, csb_ followed by 24 hex characters.

patch.nameString

The new name, up to 100 characters.

patch.colorString

The new colour, as in sh.nextmail.constants.CalendarColors.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the subscription as it stands now.

Example

Map<String, Object> result = client.calendar().updateSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b", Body.of("name", "Team rota", "color", "purple")); System.out.println(result.get("id") + " " + result.get("name"));

Notes

Also available in

API
PATCH /calendar/subscriptions/{id}
TypeScript
calendar.updateSubscription()
Python
calendar.update_subscription()
Ruby
calendar.update_subscription
PHP
calendar->updateSubscription
Go
Calendar.UpdateSubscription
C#
Calendar.UpdateSubscriptionAsync

calendar().refreshSubscription

Refresh a calendar subscription

Scopescalendar:write
Signature
Map<String, Object> refreshSubscription(String id, RequestOptions options)

Reads a subscribed calendar again now instead of waiting for the next half-hourly read, and restarts one that stopped after repeated failures.

Parameters

idStringRequired

Subscription id, csb_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map for the subscription after the read, with status and lastError.

Example

Map<String, Object> subscription = client.calendar().refreshSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(subscription.get("lastError"));

Notes

Also available in

API
POST /calendar/subscriptions/{id}/refresh
TypeScript
calendar.refreshSubscription()
Python
calendar.refresh_subscription()
Ruby
calendar.refresh_subscription
PHP
calendar->refreshSubscription
Go
Calendar.RefreshSubscription
C#
Calendar.RefreshSubscriptionAsync

calendar().deleteSubscription

Unsubscribe from a calendar

Scopescalendar:write
Signature
Map<String, Object> deleteSubscription(String id, RequestOptions options)

Removes a subscription and every event it brought onto your calendar.

Parameters

idStringRequired

Subscription id, csb_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

Returns

A map with object, id and deleted set to true.

Example

Map<String, Object> result = client.calendar().deleteSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));

Notes

Also available in

API
DELETE /calendar/subscriptions/{id}
TypeScript
calendar.deleteSubscription()
Python
calendar.delete_subscription()
Ruby
calendar.delete_subscription
PHP
calendar->deleteSubscription
Go
Calendar.DeleteSubscription
C#
Calendar.DeleteSubscriptionAsync

calendar().importIcs

Import a calendar file

Scopescalendar:write
Signature
Map<String, Object> importIcs(byte[] data, RequestOptions options)

Sends an iCalendar (.ics) file as the request body and queues it. Its events become events of your own that you can edit, and nobody on them is sent anything, now or when you change them later, unless you ask for that on the change. Poll getImport until status is completed.

The file may be 10 MB and hold 25,000 events. Several calendars in one file are merged, and the report keeps their names. An event whose UID is already in the workspace is skipped and counted, never overwritten, so sending the same file twice adds nothing.

data is a byte array, and it goes out as text/calendar.

Parameters

databyte[]Required

The .ics file: a byte array.

options.filenameString

The name to show for the file in the list of imports, at most 255 characters.

options.calendarIdString

The calendar the events go into: one you keep, or one you are a member of with write access. Your default calendar unless you say.

options.apiKeyString

Overrides the client API key for this call only.

Returns

A map with status set to queued.

Example

Map<String, Object> queued = client.calendar().importIcs(Files.readAllBytes(Path.of("work.ics")), RequestOptions.of("filename", "work.ics")); System.out.println(queued.get("id") + " " + queued.get("status"));

Notes

  • A body that is not an iCalendar file is a 400 not_a_calendar_file, an empty one a 400 item_import_empty, and one holding more than 25,000 events a 400 too_many_events.

  • A file over 10 MB is a 413 item_import_too_large.

  • To send text you already hold, such as what getEventIcs returns, encode it first with text.getBytes(StandardCharsets.UTF_8).

  • An upload that outlasts the client timeout fails as a network error, so raise it on the client for a large file on a slow connection.

  • Not retried automatically.

Also available in

API
POST /calendar/imports
TypeScript
calendar.importIcs()
Python
calendar.import_ics()
Ruby
calendar.import_ics
PHP
calendar->importIcs
Go
Calendar.ImportIcs
C#
Calendar.ImportIcsAsync

calendar().listImports

List calendar imports

Scopescalendar:readPages through results
Signature
Page listImports(RequestOptions options)

Returns one page of the calendar files and calendars brought in, newest first, each with what it added and what it left out. Beside the files sent with importIcs it lists the calendars that came with a mailbox import, and those carry the id of that import in parentImportId.

Paging is keyset. limit takes 1 to 100 and defaults to 25, and nextCursor goes back as cursor while hasMore is true. listAllImports and iterateImports do that walk for you.

Parameters

options.limitint

Imports per page, a whole number from 1 to 100. The server defaults to 25.

options.cursorString

The nextCursor from the previous page. Never build one yourself.

options.apiKeyString

Overrides the client API key for this call only.

Returns

A Page of maps with items, hasMore and nextCursor.

Example

Page page = client.calendar().listImports(RequestOptions.create().limit(50)); for (Map<String, Object> item : page) {    System.out.println(item.get("fileName") + " " + item.get("status") + " " + item.get("counts"));} if (page.hasMore()) {    System.out.println("Next page: " + page.nextCursor());}

Notes

  • source is file for an upload. takeout, caldav and microsoft came with a mailbox import.

  • A cursor that names no import is a 400 invalid_cursor.

  • A GET is retried automatically on network failure and on 408, 500, 502, 503 and 504 responses, up to the client maxRetries, and on a 429 only when it carries a Retry-After of a minute or less.

Also available in

API
GET /calendar/imports
TypeScript
calendar.listImports()
Python
calendar.list_imports()
Ruby
calendar.list_imports
PHP
calendar->listImports
Go
Calendar.ListImports
C#
Calendar.ListImportsAsync

calendar().listAllImports

Collect every calendar import into one list

Scopescalendar:readPages through results
Signature
List<Map<String, Object>> listAllImports(RequestOptions options)

Follows nextCursor from page to page and returns every calendar import, newest first.

Everything is held in memory before the call settles. Prefer iterateImports when you can stop early. limit sets the page size of each request, not the total.

Parameters

options.limitint

Page size per request, from 1 to 100, defaulting to 25 on the server.

options.cursorString

A cursor from an earlier page to start after.

options.apiKeyString

Overrides the client API key for every page of this walk.

Returns

A list of maps holding every import across all pages.

Example

List<Map<String, Object>> imports = client.calendar().listAllImports(); for (Map<String, Object> item : imports) {    System.out.println(item.get("counts"));}

Notes

  • A failure on any page rejects the whole call, and the imports already fetched are discarded.

Also available in

API
GET /calendar/imports
TypeScript
calendar.listAllImports()
Python
calendar.list_all_imports()
Ruby
calendar.list_all_imports
PHP
calendar->listAllImports
Go
Calendar.ListAllImports
C#
Calendar.ListAllImportsAsync

calendar().iterateImports

Stream calendar imports one at a time

Scopescalendar:readPages through results
Signature
PagedIterable iterateImports(RequestOptions options)

Returns a PagedIterable that yields calendar imports one by one, newest first, and requests the next page only once the current one is drained. Nothing is fetched until you consume it, and breaking out of the loop stops the requests.

Parameters

options.limitint

Page size per request, from 1 to 100, defaulting to 25 on the server.

options.cursorString

A cursor from an earlier page to start after.

options.apiKeyString

Overrides the client API key for every page of this walk.

Returns

A PagedIterable of maps yielding one import per step.

Example

for (Map<String, Object> item : client.calendar().iterateImports()) {    System.out.println(item.get("status") + " " + item.get("id") + " " + item.get("counts"));}

Notes

  • The generator is lazy, so an abandoned loop costs only the pages you consumed.

Also available in

API
GET /calendar/imports
TypeScript
calendar.iterateImports()
Python
calendar.iterate_imports()
Ruby
calendar.iterate_imports
PHP
calendar->iterateImports
Go
Calendar.IterateImports
C#
Calendar.IterateImportsAsync

calendar().getImport

Get a calendar import

Scopescalendar:read
Signature
Map<String, Object> getImport(String id, RequestOptions options)

Returns one calendar import with its counts and its report: the calendars it read, how many events it left out and why, and up to 20 of the events it left out. Poll it after importIcs until status is completed or failed.

counts.imported is what was added and counts.skipped what was left out, which report.skipped breaks down by reason: uid-taken for an event that was already here, no-start for one with no start time, invalid for one that could not be read and empty for a file or calendar that held no events.

Parameters

idStringRequired

Calendar import id, iimp_ followed by 24 hex characters.

options.apiKeyString

Overrides the client API key for this call only.

Returns

A map with status, counts, report, undoable and when it started, finished and was undone.

Example

Map<String, Object> item = client.calendar().getImport("iimp_3f9c2a7b1e4d8f60a5c7b92d"); System.out.println(item.get("status") + " " + item.get("counts") + " " + item.get("report"));

Notes

  • An id that names no calendar import is a 404 item_import_not_found.

  • A GET is retried automatically on network failure and on 408, 500, 502, 503 and 504 responses, up to the client maxRetries, and on a 429 only when it carries a Retry-After of a minute or less.

Also available in

API
GET /calendar/imports/{id}
TypeScript
calendar.getImport()
Python
calendar.get_import()
Ruby
calendar.get_import
PHP
calendar->getImport
Go
Calendar.GetImport
C#
Calendar.GetImportAsync

calendar().undoImport

Remove what a calendar import added

Scopescalendar:write
Signature
Map<String, Object> undoImport(String id, RequestOptions options)

Deletes every event the import added, changed since or not, and marks the import undone. Nobody is told. Events that were skipped because they were already here are not touched.

Parameters

idStringRequired

Calendar import id, iimp_ followed by 24 hex characters.

options.apiKeyString

Overrides the client API key for this call only.

Returns

A map with status set to undone and undoneAt set.

Example

Map<String, Object> undone = client.calendar().undoImport("iimp_3f9c2a7b1e4d8f60a5c7b92d"); System.out.println(undone.get("status") + " " + undone.get("undoneAt") + " " + undone.get("counts"));

Notes

  • An import that is still running, or was already removed, is a 409 item_import_not_undoable. undoable on the import says whether the call would remove anything.

  • An id that names no calendar import is a 404 item_import_not_found.

  • Not retried automatically.

Also available in

API
POST /calendar/imports/{id}/undo
TypeScript
calendar.undoImport()
Python
calendar.undo_import()
Ruby
calendar.undo_import
PHP
calendar->undoImport
Go
Calendar.UndoImport
C#
Calendar.UndoImportAsync