# 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.

## `POST /api/v1/identities/{identityId}/calendars/invitations/respond`

### Path parameters

- `identityId` (string, required) — Identity ULID identifier

### Request body (required)

`application/json`

- `partstat` ("ACCEPTED" | "DECLINED" | "TENTATIVE" | "NEEDS-ACTION", required) — RFC 5545 PARTSTAT to record for the caller
- `ics` (string, 1–262144 chars) — Inline form: the raw text/calendar part from the message
- `messageId` (string, 1–64 chars) — Reference form: a message in THIS mailbox carrying the invitation
- `section` (string, max 64 chars, pattern `^[0-9]+(\.[0-9]+)*$`) — Reference form, optional: the part's section as reported by …/messages/{id}/invitation. Omitted, the server picks the message's scheduling part itself

### Responses

**200** — Recorded. `filed` says whether a copy had to be created; `organizerUpdated` / `replySent` report how the organizer was told, exactly as the collection-scoped RSVP does

`application/json` → PimRsvpResult

- `calendarId` (string, required) — Calendar collection ULID holding the event
- `etag` (string, required) — Updated ETag of the calendar object
- `filed` (boolean, required) — True if the event was newly added to the calendar
- `href` (string, required) — DAV resource path of the event
- `myAddress` (string, required) — Recipient email address for which this RSVP was recorded
- `organizerUpdated` (boolean, required) — True if local organizer event copy was updated directly
- `partstat` ("ACCEPTED" | "DECLINED" | "TENTATIVE" | "NEEDS-ACTION", required) — Recorded participation status (ACCEPTED, DECLINED, TENTATIVE)
- `replySent` (boolean, required) — True if email reply was sent to remote organizer
- `summary` (string | null, required) — Event title/summary, or null

**400** — invalid_invitation (the body is not a parseable VEVENT) or multiple_uids (a scheduling message carries one event; overrides share its UID)

`application/json` → ErrorOrValidation

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**403** — not_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)

`application/json` → ErrorBody

**404** — Mailbox 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`)

`application/json` → ErrorBody

**409** — conflict — the copy changed concurrently under the reply; retry

`application/json` → ErrorBody

**413** — messageId form: message_too_large | invitation_too_large

`application/json` → ErrorBody

**422** — messageId form: unparseable_message | message_too_complex

`application/json` → ErrorBody

**503** — temporary_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)

`application/json` → ErrorBody

### Example request

```bash
curl -X POST 'https://api.open.email/api/v1/identities/{identityId}/calendars/invitations/respond' \
  -H 'Authorization: Bearer oek_…' \
  -H 'Content-Type: application/json' \
  -d '{
    "partstat": "ACCEPTED"
  }'
```

## TypeScript SDK

[`openemail.calendars.respondToInvitation`](/docs/sdks/typescript/calendars/respond-to-invitation)

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