Skip to main content

Events

Pro Feature

The Programmatic API requires Prisma Calendar Pro.

createEvent(input)

Creates a tracked event with full frontmatter.

Input:

PropertyTypeRequiredDescription
titlestringyesEvent name
startstringnoISO datetime for start (e.g. 2025-02-14T09:00:00)
endstringnoISO datetime for end
allDaybooleannoAll-day event
categoriesstring[]noCategory values
locationstringnoLocation
participantsstring[]noParticipants
markAsDonebooleannoSet status to done
skipbooleannoMark as skipped
calendarIdstringnoTarget calendar ID
frontmatterobjectnoAdditional frontmatter properties

Omit start for an untracked event.

Datetime format

Datetime strings are automatically normalized to the internal .000Z suffix format. You can pass any of these — they are all equivalent:

  • "2025-02-14T09:00:00.000Z" (full format)
  • "2025-02-14T09:00:00" (no suffix)
  • "2025-02-14T09:00" (no seconds)

Returns: Promise<string | null> — File path of the created note, or null if creation failed.

Example:

const path = await window.PrismaCalendar.createEvent({
title: "Meeting",
start: "2025-02-14T09:00:00",
end: "2025-02-14T10:00:00",
categories: ["Work"]
});

editEvent(input)

Edits an existing event's frontmatter properties by file path.

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file to edit
titlestringnoNew event name
startstringnoNew ISO datetime for start
endstringnoNew ISO datetime for end
allDaybooleannoSet all-day flag
categoriesstring[]noNew category values
locationstringnoNew location
participantsstring[]noNew participants
markAsDonebooleannoSet status to done
skipbooleannoMark as skipped
calendarIdstringnoTarget calendar ID
frontmatterobjectnoAdditional frontmatter properties

Only include fields that should change — omitted fields are left unchanged.

Returns: Promise<boolean>true if the edit succeeded, false otherwise (e.g., file not found).

Example:

const ok = await window.PrismaCalendar.editEvent({
filePath: "Calendar/240101120000 Meeting.md",
start: "2025-02-14T10:00:00",
end: "2025-02-14T11:00:00",
categories: ["Work"]
});

deleteEvent(input)

Deletes an event by file path (moves to trash).

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file to delete
calendarIdstringnoTarget calendar ID

Returns: Promise<boolean>true if the deletion succeeded, false otherwise (e.g., file not found).

Example:

const ok = await window.PrismaCalendar.deleteEvent({
filePath: "Calendar/240101120000 Meeting.md"
});

convertFileToEvent(input)

Converts an existing file to Prisma format: ensures ZettelID and updates frontmatter (same as "Add ZettelID to current note" but for any file by path).

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the note to convert
calendarIdstring?noTarget calendar ID
titlestring?noOverride title
startstring?noSet start datetime
endstring?noSet end datetime
allDayboolean?noSet all-day flag
categoriesstring[]?noSet categories
locationstring?noSet location
participantsstring[]?noSet participants
markAsDoneboolean?noSet status to done
skipboolean?noMark as skipped
frontmatterobject?noAdditional frontmatter

Returns: Promise<boolean>true if conversion succeeded, false otherwise (e.g., file not found).

Example:

const ok = await window.PrismaCalendar.convertFileToEvent({
filePath: "Notes/MyNote.md",
start: "2025-02-14T09:00:00",
end: "2025-02-14T10:00:00"
});