Event types (cal-api-version: 2024-06-14): the bookable meeting kinds. List, get, create, update and delete.
Context Vars
cal-com.api.key
Functions
build-create-body
fn (title: Str, slug: Str, length-in-minutes: Int, options: Map): Map
Build the create body from the required title, slug and
lengthInMinutes plus options (any other field the API accepts:
description, scheduleId, minimumBookingNotice,
beforeEventBuffer, afterEventBuffer, slotInterval, locations,
bookingFields, confirmationPolicy, hidden, ...). Unset options are
omitted. Exposed for testing.
Example
::cal-com::event-types/build-create-body("Intro call", "intro-call", 30, {hidden: false, description: null})
// {hidden: false, title: "Intro call", slug: "intro-call", lengthInMinutes: 30}
create-event-type
fn (title: Str, slug: Str, length-in-minutes: Int): Any
fn (title: Str, slug: Str, length-in-minutes: Int, options: Map): Any
fn (title: Str, slug: Str, length-in-minutes: Int, options: Map, opts: Map): Any
POST /event-types - Create an event type.
Example
::cal-com::event-types/create-event-type("Intro call", "intro-call", 30, {
description: "A quick first conversation.",
minimumBookingNotice: 120
})
delete-event-type
fn (id: Any): Any
fn (id: Any, opts: Map): Any
DELETE /event-types/{id} - Delete an event type. Returns the deleted event type's summary.
Example
::cal-com::event-types/delete-event-type(123)
get-event-type
fn (id: Any): Any
fn (id: Any, opts: Map): Any
GET /event-types/{id} - One event type.
Example
event-type ::cal-com::event-types/get-event-type(123)
event-type.lengthInMinutes
list-event-types
fn (): Any
fn (options: Map): Any
fn (options: Map, opts: Map): Any
GET /event-types - The API key owner's event types (Vec). options:
username with eventSlug, usernames (dynamic group events),
orgSlug/orgId, sortCreatedAt ("asc"/"desc").
Example
event-types ::cal-com::event-types/list-event-types({sortCreatedAt: "desc"})
map(event-types, %.slug)
update-event-type
fn (id: Any, changes: Map): Any
fn (id: Any, changes: Map, opts: Map): Any
PATCH /event-types/{id} - Update an event type; changes takes the same
fields as create. Unset fields are omitted (and left unchanged).
Example
::cal-com::event-types/update-event-type(123, {lengthInMinutes: 45, minimumBookingNotice: 240})