---
title: "What Is an ICS File? How to Create, Open, and Import Calendar Invites (2026)"
url: https://apyhub.com/blog/what-is-an-ics-file
author: ApyHub
published: 2026-09-17T10:08:40.166288Z
---

# What Is an ICS File? How to Create, Open, and Import Calendar Invites (2026)

# What Is an ICS File? How to Create, Open, and Import Calendar Invites (2026)

## Introduction

An **ICS file** (`.ics`) is a calendar file. It stores one or more events, such as a meeting, a webinar, or a flight, in the iCalendar format, a plain-text standard that Google Calendar, Outlook, and Apple Calendar all understand. When you click "Add to calendar" in an email or download an invite, you're almost always opening an ICS file.

This guide covers what's inside an ICS file, how to open and import one in every major calendar app, and the problems developers actually hit: events landing at the wrong time, updates that create duplicates, and cancellations that don't cancel.

If you need to create ICS files from your own app, for booking confirmations, demo scheduling, or webinar sign-ups, ApyHub's [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) does it in one request: send the event details as JSON and get back a valid `.ics` invite with time zones, attendees, reminders, recurring events, and cancellations handled for you. [Jump to the API section](#generate-ics-files-with-the-apyhub-ics-generator-api).

\<div style\="background:#1A1A22;color:#F8F1DA;border-left:6px solid #BC4A63;border-radius:12px;padding:24px 28px;margin:32px 0;"> \<p style\="margin:0 0 6px;font-family:'JetBrains Mono',monospace;font-size:12px;letter-spacing:0.12em;text-transform:uppercase;color:#BC4A63;">ICS Generator API\</p> \<p style\="margin:0 0 16px;font-size:20px;font-weight:800;line-height:1.3;">Turn event details into a valid .ics invite with one request.\</p> \<a href\="https://apyhub.com/apyhub/service/generate-ical-event" style\="display:inline-block;background:#BC4A63;color:#F8F1DA;font-weight:700;padding:10px 20px;border-radius:8px;text-decoration:none;">Try it free →\</a> \</div>

## What's inside an ICS file

An ICS file is plain text, so you can open it in any text editor. The iCalendar format is defined by [RFC 5545](https://www.ietf.org/rfc/rfc5545), and a minimal meeting invite looks like this:

```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp//Booking App//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:demo-2026-10-15-9f1c2a7e@example.com
DTSTAMP:20260917T080000Z
DTSTART:20261015T070000Z
DTEND:20261015T073000Z
SUMMARY:Product demo
LOCATION:https://meet.example.com/demo
DESCRIPTION:30-minute walkthrough of the product.
ORGANIZER;CN=Sales Team:mailto:sales@example.com
ATTENDEE;RSVP=TRUE:mailto:alex@example.com
SEQUENCE:0
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
```

The parts that matter most:

| Field               | What it means                                                          |
| ------------------- | ---------------------------------------------------------------------- |
| SUMMARY             | The event title                                                        |
| DTSTART, DTEND      | Start and end time (a trailing Z means UTC)                            |
| LOCATION            | Where the event happens, including meeting links                       |
| ORGANIZER, ATTENDEE | Who sent the invite and who's invited                                  |
| UID                 | A permanent ID that lets calendars recognize updates to the same event |
| VALARM              | A reminder, here 15 minutes before the start                           |

**ICS vs iCal vs iCalendar:** they're the same thing. iCalendar is the standard, `.ics` is the file extension, and "iCal" is the common nickname (and the old name of Apple's calendar app).

## How to open or import an ICS file

### Import an ICS file into Google Calendar

Google Calendar imports ICS files from a computer, following [Google's own steps](https://support.google.com/calendar/answer/37118):

1. Open Google Calendar in a browser.
2. Click the **gear icon**, then **Settings**.
3. In the left menu, click **Import & export**.
4. Click **Select file from your computer** and choose the `.ics` file.
5. Pick the calendar to add the events to, then click **Import**.

**On a phone:** the Google Calendar app has no import option. Open calendar.google.com in your phone's browser, switch to the desktop site, and follow the same steps.

**Import vs subscribe:** importing copies the events once. If the source calendar keeps changing, such as a team schedule or sports fixtures, use **Other calendars → From URL** with the `.ics` link instead, so Google keeps it updated.

### Open an ICS file in Outlook

* **Outlook for Windows or Mac:** double-click the `.ics` file, check the event, and click **Save & Close**.
* **Outlook on the web:** go to **Calendar → Add calendar → Upload from file**, choose the file, and pick a calendar.
* **Invite emails:** when an email includes an ICS invite, Outlook shows **Accept / Tentative / Decline** buttons directly.

### Open an ICS file in Apple Calendar

* **Mac:** double-click the file, or use **File → Import** in Calendar.
* **iPhone and iPad:** tap the `.ics` attachment in Mail or Files, then tap **Add All**.

## How to create an ICS file

### 1. By hand

Copy the example above into a text editor, change the details, and save it with the `.ics` extension. This works for a one-off event, but small formatting mistakes can stop the file from importing (see the common problems below).

### 2. In Python

For a simple event, a few lines of Python are enough:

python

```python
from datetime import datetime, timezone
import uuid

def make_ics(summary, start, end, location=""):
    now = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
    fmt = lambda dt: dt.astimezone(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
    lines = [
        "BEGIN:VCALENDAR",
        "VERSION:2.0",
        "PRODID:-//Example Corp//Booking App//EN",
        "BEGIN:VEVENT",
        f"UID:{uuid.uuid4()}@example.com",
        f"DTSTAMP:{now}",
        f"DTSTART:{fmt(start)}",
        f"DTEND:{fmt(end)}",
        f"SUMMARY:{summary}",
        f"LOCATION:{location}",
        "END:VEVENT",
        "END:VCALENDAR",
    ]
    return "\r\n".join(lines) + "\r\n"

start = datetime(2026, 10, 15, 9, 0, tzinfo=timezone.utc)
end = datetime(2026, 10, 15, 9, 30, tzinfo=timezone.utc)
with open("invite.ics", "w", newline="") as f:
    f.write(make_ics("Product demo", start, end, "Online"))
```

This covers a basic event. Once you need recurring events, reminders, attendees, local time zones, or cancellations, the edge cases add up quickly: text escaping for commas and semicolons, line folding, `RRULE` syntax, and time zone definitions. That's where libraries such as `icalendar` for Python, or an API, save time.

### 3. With an API

When ICS files are part of your product, generating them yourself means owning every edge case: time zones, recurrence rules, escaping, updates, and cancellations. An API takes that off your plate. The next section shows how with ApyHub.

## Generate ICS files with the ApyHub ICS Generator API

The [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) turns plain JSON into a ready-to-send calendar invite. You describe the event; the API writes a valid iCalendar file that opens in Google Calendar, Outlook, and Apple Calendar.

**What it handles for you:**

| Feature                 | How you set it                                                                                       |
| ----------------------- | ---------------------------------------------------------------------------------------------------- |
| Event details           | summary, description, location                                                                       |
| Date and time           | meeting\_date (YYYY-MM-DD), start\_time and end\_time (HH:MM)                                        |
| Time zones              | time\_zone, any IANA name such as Europe/Amsterdam or America/New\_York                              |
| All-day events          | all\_day: true                                                                                       |
| Organizer and attendees | organizer\_email, attendees\_emails                                                                  |
| Recurring events        | recurring: true plus recurrence with frequency (DAILY, WEEKLY, MONTHLY, YEARLY), interval, and count |
| Reminders               | reminders, each with minutes\_before and action (display or email)                                   |
| Updates                 | Reuse the same id and increase sequence                                                              |
| Cancellations           | Same id with ?event\_type\=cancel                                                                    |
| File name               | ?output\=my-invite                                                                                   |

**Two ways to get the file:**

* `POST /generate-ical-event/download` returns the `.ics` file itself, ready to attach to an email.
* `POST /generate-ical-event/link` returns a signed link to the file, ready to put in a button or message.

### Example: a weekly meeting with a reminder

bash

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/generate-ical-event/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "team-sync-2026@example.com",
    "summary": "Weekly Team Sync",
    "description": "Project updates and action items.",
    "meeting_date": "2026-10-15",
    "start_time": "09:00",
    "end_time": "09:30",
    "time_zone": "Europe/Amsterdam",
    "location": "https://meet.example.com/sync",
    "organizer_email": "organizer@example.com",
    "attendees_emails": ["alex@example.com", "sam@example.com"],
    "recurring": true,
    "recurrence": { "frequency": "WEEKLY", "interval": 1, "count": 10 },
    "reminders": [{ "action": "display", "minutes_before": 15 }]
  }'
```

Response:

json

```json
{
  "data": "https://storage.example.com/invite_2026-10-15_abc123.ics?sig=abc123"
}
```

Need the file itself to attach to an email? Call the `/download` endpoint with the same body. To cancel the meeting later, send the same `id` with `?event_type=cancel`. The [API page](https://apyhub.com/apyhub/service/generate-ical-event) has the full reference and a live playground.

**Where teams use it:** booking and scheduling apps, demo and sales confirmations, webinar and event registrations, course and class schedules, appointment reminders, and internal tools that send team events. It runs on the same ApyHub key as the rest of the catalog, and you can start on the free tier with no card required.

## How to send a calendar invite by email

To make an email show up as a real invite, with an "Add to calendar" or "Accept" option, attach the ICS file:

1. Generate the file with `METHOD:REQUEST`, an `ORGANIZER`, and at least one `ATTENDEE`.
2. Attach it as `invite.ics` with the content type `text/calendar; method=REQUEST`.
3. Send the email from the organizer's address, so calendar apps trust the invite.

Most booking tools, CRMs, and webinar platforms work this way: the app generates the ICS file and attaches it to the confirmation email. Check attendee addresses first with the [Email Validation API](https://apyhub.com/apyhub/service/verify-email-validity-and-deliverability) so invites don't bounce.

## ICS file vs "Add to calendar" link

An **"Add to calendar" link** opens a pre-filled event in one calendar app. Google Calendar links look like this:

text

```
https://calendar.google.com/calendar/render?action=TEMPLATE&text=Product%20demo&dates=20261015T070000Z/20261015T073000Z&details=30-minute%20walkthrough&location=Online
```

|                           | "Add to calendar" link                  | ICS file                                               |
| ------------------------- | --------------------------------------- | ------------------------------------------------------ |
| Works with                | One calendar app per link               | Google, Outlook, Apple, and most others                |
| Attendees and RSVPs       | No                                      | Yes                                                    |
| Reminders and recurrence  | Limited                                 | Yes                                                    |
| Updates and cancellations | No                                      | Yes, with UID and SEQUENCE                             |
| Best for                  | Landing pages and simple one-off events | Invites, confirmations, and anything that might change |

Many sites offer both: a Google Calendar link for quick adds, and an ICS download for everything else.

## Common ICS problems and how to fix them

**The event shows at the wrong time.** The time has no time zone, so each calendar guesses. Write times in UTC with a trailing `Z` (`20261015T070000Z`), or include a `TZID` with a matching time zone definition. The [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) handles this when you pass `time_zone`.

**An update creates a duplicate event.** The update used a new `UID`. Keep the same `UID` for the life of the event and increase `SEQUENCE` by one with each change. With the [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event), reuse the same `id` and raise `sequence`.

**A cancellation doesn't remove the event.** Send a file with `METHOD:CANCEL`, the same `UID`, and a higher `SEQUENCE`. With the [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event), send the same `id` with `?event_type=cancel`.

**The file won't import, or text looks broken.** The iCalendar format ([RFC 5545](https://www.ietf.org/rfc/rfc5545)) is strict about a few details. Check that every line ends with a CRLF line break, lines longer than 75 bytes are folded onto the next line (starting with a space), commas, semicolons, and backslashes in text are escaped, and every event has a `UID` and `DTSTAMP`. The file must start with `BEGIN:VCALENDAR` and end with `END:VCALENDAR`.

**Google Calendar on mobile can't open the file.** The app doesn't support imports. Use a browser in desktop mode, or tap the file in Mail on iPhone to add it to Apple Calendar.

**Recurring events arrive as separate events.** The recurrence was written as individual events. Use a single event with an `RRULE`, or set `recurring` and `recurrence` in the API.

## Creating calendar invites with AI agents

AI assistants that book meetings or plan events need to produce real invites, not only text. The [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) is available through [ApyHub MCP](https://apyhub.com/mcp), so an agent can turn "set up a weekly sync with Alex and Sam, Thursdays at 9" into a valid `.ics` invite without a custom integration. New to MCP? Read [what is MCP](https://apyhub.com/blog/what-is-mcp-the-model-context-protocol-in-plain-english).

## Conclusion

An ICS file is the universal format for sharing calendar events. It's plain text, it works in every major calendar, and it supports everything invites need: attendees, reminders, recurring events, updates, and cancellations.

Importing one takes a few clicks. Creating one by hand works for a single event, but as soon as time zones, recurrence, and updates come in, a generator saves you from the edge cases. The [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) turns JSON into a valid invite in one request.

\<div style\="background:#F8F1DA;color:#1A1A22;border:2px solid #7A2238;border-radius:12px;padding:24px 28px;margin:32px 0;"> \<p style\="margin:0 0 6px;font-family:'JetBrains Mono',monospace;font-size:12px;letter-spacing:0.12em;text-transform:uppercase;color:#7A2238;">Start free\</p> \<p style\="margin:0 0 8px;font-size:20px;font-weight:800;line-height:1.3;">Generate your first .ics invite in minutes.\</p> \<p style\="margin:0 0 16px;color:#5A5A66;">The Starter plan is free, with 3,000 atoms a month and MCP access. No card required.\</p> \<a href\="https://apyhub.com/apyhub/service/generate-ical-event" style\="display:inline-block;background:#7A2238;color:#F8F1DA;font-weight:700;padding:10px 20px;border-radius:8px;text-decoration:none;margin-right:8px;">Try the ICS Generator API →\</a> \<a href\="https://apyhub.com/catalog" style\="display:inline-block;border:1px solid #7A2238;color:#7A2238;font-weight:700;padding:10px 20px;border-radius:8px;text-decoration:none;">Browse all APIs\</a> \</div>

## FAQ

**What is an ICS file?** An ICS file is a plain-text calendar file in the iCalendar format. It stores events that Google Calendar, Outlook, Apple Calendar, and most other calendar apps can open.

**How do I import an ICS file into Google Calendar?** On a computer, open Google Calendar, go to **Settings → Import & export**, select the `.ics` file, choose a calendar, and click **Import**.

**How do I open an ICS file?** Double-click it to open it in your default calendar app, or import it through your calendar's import option. You can also read it in any text editor.

**Is an ICS file safe to open?** ICS files are plain text and can't run code. Still, only add events from senders you trust, since invites can contain misleading links.

**What's the difference between ICS and iCal?** They're the same format. iCalendar is the standard, `.ics` is the file extension, and "iCal" is a common nickname.

**How do I create an ICS file?** Write one in a text editor, generate it in code with a library, or send the event details as JSON to the [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event).

**How do I make a calendar invite that people can accept?** Create an ICS file with `METHOD:REQUEST`, an organizer, and attendees, then attach it to an email as `text/calendar`.

**Why does my event show at the wrong time?** The file didn't specify a time zone. Use UTC times ending in `Z`, or include a `TZID`.

**How do I update or cancel an event I already sent?** Send a new file with the same `UID` and a higher `SEQUENCE`. For a cancellation, also set `METHOD:CANCEL`. With the [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event), reuse the event `id` and add `?event_type=cancel` to cancel.

**Can I import an ICS file on my phone?** Not in the Google Calendar app. Use a mobile browser in desktop mode, or on iPhone, tap the file to add it to Apple Calendar.

**Is there an API to generate ICS files?** Yes. ApyHub's [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) creates `.ics` invites from JSON, with time zones, attendees, reminders, recurring events, and cancellations. It returns the file or a signed link, and you can start on the free tier.

**Can AI agents create calendar invites?** Yes. The [ICS Generator API](https://apyhub.com/apyhub/service/generate-ical-event) is available to agents through [ApyHub MCP](https://apyhub.com/mcp).

## About ApyHub

[ApyHub](https://apyhub.com/) is a curated API catalog and trusted operational layer for developers and AI agents, with over 1,500 endpoints or capabilities and growing. Teams use the whole [catalog](https://apyhub.com/catalog) through a single subscription priced in atoms, a unit that reflects the actual work each call performs. Every endpoint ships with machine-readable certification aligned with GDPR, SOC 2, and ISO 27001, and is MCP-ready by default, so AI agents can discover and call it through [ApyHub MCP](https://apyhub.com/mcp) without custom wrappers. ApyHub is headquartered in Amsterdam, with offices in the Netherlands, Greece, and India, and serves 65,000+ developer workspaces every month. The free Starter plan includes 3,000 atoms per month, with no card required. Building an API of your own? [Become a provider →](https://apyhub.com/become-a-provider)
