Skip to Content

Accept or decline emailed invitation.

Files an emailed calendar invitation to the default calendar and submits the user's RSVP response (ACCEPT, DECLINE, TENTATIVE) to the organizer.

openemail.calendars.respondToInvitation(
  identityId: string,
  body: CalendarsRespondToInvitationBody,
  options?: CallOptions,
): ApiPromise<PimRsvpResult>

It calls POST /identities/{identityId}/calendars/invitations/respond: Accept or decline emailed invitation in the API reference.

Example

const pimRsvpResult = await openemail.calendars.respondToInvitation(identityId, { partstat: 'ACCEPTED' })

Arguments

ArgumentTypeDescription
identityIdstringIdentity ULID identifier. The path's {identityId}.
bodyCalendarsRespondToInvitationBodyThe request's body.

Options

It takes no options of its own. Every call also takes signal, timeout, retry and headers, which say how that one call is sent (call options).

Answer

Awaited, it is the API's JSON, PimRsvpResult. It is an ApiPromise: .withResponse() gives the same with the Response it came in, for its headers.

Errors

StatusWhat it means
400invalid_invitation (the body is not a parseable VEVENT) or multiple_uids (a scheduling message carries one event; overrides share its UID)
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
403not_attendee (no address of this mailbox is on the event) or is_organizer (the event names this mailbox as ORGANIZER — on ANY routing tier, not just its literal identities — an organizer answers by editing their own copy, and filing it here would schedule invitations on their behalf)
404Mailbox not found, it has no calendar to file into, or — on the messageId form — the message is unknown (not_found) or carries no scheduling part (no_invitation)
409conflict — the copy changed concurrently under the reply; retry
413messageId form: message_too_large | invitation_too_large
422messageId form: unparseable_message | message_too_complex
503temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

A failed call rejects with a RequestError: its status, and its code, the API's error. Decide on the code: one status covers several.

Types

CalendarsRespondToInvitationBody

/** The body of `calendars.respondToInvitation`. */
type CalendarsRespondToInvitationBody = {
  /** Inline form: the raw text/calendar part from the message */
  ics?: string
  /** Reference form: a message in THIS mailbox carrying the invitation */
  messageId?: string
  /** RFC 5545 PARTSTAT to record for the caller */
  partstat: ('ACCEPTED' | 'DECLINED' | 'TENTATIVE' | 'NEEDS-ACTION')
  /** Reference form, optional: the part's section as reported by …/messages/{id}/invitation. Omitted, the server picks the message's scheduling part itself */
  section?: string
}

It names these types of the API, each on a page of its own: PimRsvpResult.