productivity
Calendly Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Calendly KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.calendly.*.
Use lua_read_doc("integrations.calendly") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Calendly workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.calendly.list_event_types({user = "example_user", organization = "example_organization", active = true, page_token = "example_page_token", count = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("calendly"))' --json
kosmo integrations:lua --eval 'print(docs.read("calendly.list_event_types"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local calendly = app.integrations.calendly
local result = calendly.list_event_types({user = "example_user", organization = "example_organization", active = true, page_token = "example_page_token", count = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.calendly, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.calendly.default.* or app.integrations.calendly.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Calendly, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Calendly Integration
Authentication
The Calendly integration uses a Personal Access Token passed via the Authorization: Bearer {token} header on every request.
Generate a token: Calendly → Integrations & Apps → API & Webhooks → Personal Access Tokens
Response Format
Single-resource responses wrap data in resource:
{
"resource": {
"uri": "https://api.calendly.com/users/...",
"name": "John Doe",
"email": "john@example.com"
}
}
Collection responses include collection and pagination:
{
"collection": [...],
"pagination": {
"count": 20,
"next_page": "https://api.calendly.com/v2/event_types?page_token=..."
}
}
Pagination
List endpoints use page_token for cursor-based pagination. Pass the page_token value from pagination.next_page to fetch the next page. When next_page is null, there are no more results.
Tools
calendly_list_event_types
List event types for a user or organization.
| Name | Type | Required | Description |
|---|---|---|---|
user | string | no | User URI to filter by |
organization | string | no | Organization URI to filter by |
active | boolean | no | Filter by active status |
page_token | string | no | Pagination token |
count | integer | no | Results per page (default 20, max 100) |
local result = app.integrations.calendly.list_event_types({
active = true
})
for _, et in ipairs(result.collection) do
print(et.name, et.duration, et.scheduling_url)
end
calendly_get_event_type
Get a single event type by UUID.
| Name | Type | Required | Description |
|---|---|---|---|
uuid | string | yes | Event type UUID |
local et = app.integrations.calendly.get_event_type({ uuid = "abc-123" })
print(et.resource.name, et.resource.duration)
calendly_create_booking
Create a booking by generating a one-off event type with a scheduling URL.
| Name | Type | Required | Description |
|---|---|---|---|
host | string | yes | Host user URI (e.g. https://api.calendly.com/users/…) |
start_time | string | yes | ISO 8601 start time |
end_time | string | yes | ISO 8601 end time |
location | object | no | Location object (type + location) |
name | string | no | Name for the booking |
local result = app.integrations.calendly.create_booking({
host = "https://api.calendly.com/users/abc-123",
start_time = "2024-06-15T10:00:00Z",
end_time = "2024-06-15T11:00:00Z",
name = "Quick Sync",
location = { type = "zoom" }
})
print(result.resource.scheduling_url)
calendly_list_bookings
List scheduled bookings (events) with optional filters.
| Name | Type | Required | Description |
|---|---|---|---|
user | string | no | User URI to filter by |
organization | string | no | Organization URI to filter by |
status | string | no | "active" or "canceled" |
min_start_time | string | no | ISO 8601 lower bound |
max_start_time | string | no | ISO 8601 upper bound |
page_token | string | no | Pagination token |
count | integer | no | Results per page (default 20, max 100) |
local result = app.integrations.calendly.list_bookings({
status = "active",
min_start_time = "2024-01-01T00:00:00Z",
max_start_time = "2024-12-31T23:59:59Z"
})
for _, booking in ipairs(result.collection) do
print(booking.name, booking.start_time, booking.end_time)
end
calendly_list_organizations
List organizations the authenticated user belongs to.
| Name | Type | Required | Description |
|---|---|---|---|
page_token | string | no | Pagination token |
local result = app.integrations.calendly.list_organizations({})
for _, org in ipairs(result.collection) do
print(org.name, org.slug)
end
calendly_list_users
List users (organization memberships) in a Calendly organization.
| Name | Type | Required | Description |
|---|---|---|---|
organization | string | no | Organization URI to filter by |
user | string | no | User URI to filter by |
page_token | string | no | Pagination token |
count | integer | no | Results per page (default 20, max 100) |
local result = app.integrations.calendly.list_users({
organization = "https://api.calendly.com/organizations/org-123"
})
for _, member in ipairs(result.collection) do
print(member.user.name, member.user.email, member.role)
end
calendly_get_current_user
Get the authenticated user’s profile (name, email, scheduling URL, timezone, organization).
local user = app.integrations.calendly.get_current_user()
print(user.resource.name, user.resource.email)
Common Workflows
Check upcoming meetings for the current user
calendly_get_current_user— Get the authenticated user’s URIcalendly_list_bookings— Filter byuserURI andstatus = "active"with amin_start_timeof now
Find available event types and create a booking link
calendly_list_event_types— Find available event typescalendly_get_event_type— Get details for a specific event typecalendly_create_booking— Create a one-off event type with a scheduling URL
Explore organization structure
calendly_get_current_user— Get user profile with organization infocalendly_list_organizations— See all organizationscalendly_list_users— List members within an organization
Multi-Account Usage
If you have multiple Calendly accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.calendly.function_name({...})
-- Explicit default (portable across setups)
app.integrations.calendly.default.function_name({...})
-- Named accounts
app.integrations.calendly.work.function_name({...})
app.integrations.calendly.personal.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Calendly Integration
## Authentication
The Calendly integration uses a Personal Access Token passed via the `Authorization: Bearer {token}` header on every request.
Generate a token: **Calendly → Integrations & Apps → API & Webhooks → Personal Access Tokens**
## Response Format
Single-resource responses wrap data in `resource`:
```json
{
"resource": {
"uri": "https://api.calendly.com/users/...",
"name": "John Doe",
"email": "john@example.com"
}
}
```
Collection responses include `collection` and `pagination`:
```json
{
"collection": [...],
"pagination": {
"count": 20,
"next_page": "https://api.calendly.com/v2/event_types?page_token=..."
}
}
```
## Pagination
List endpoints use `page_token` for cursor-based pagination. Pass the `page_token` value from `pagination.next_page` to fetch the next page. When `next_page` is `null`, there are no more results.
---
## Tools
### calendly_list_event_types
List event types for a user or organization.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `user` | string | no | User URI to filter by |
| `organization` | string | no | Organization URI to filter by |
| `active` | boolean | no | Filter by active status |
| `page_token` | string | no | Pagination token |
| `count` | integer | no | Results per page (default 20, max 100) |
```lua
local result = app.integrations.calendly.list_event_types({
active = true
})
for _, et in ipairs(result.collection) do
print(et.name, et.duration, et.scheduling_url)
end
```
---
### calendly_get_event_type
Get a single event type by UUID.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `uuid` | string | yes | Event type UUID |
```lua
local et = app.integrations.calendly.get_event_type({ uuid = "abc-123" })
print(et.resource.name, et.resource.duration)
```
---
### calendly_create_booking
Create a booking by generating a one-off event type with a scheduling URL.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `host` | string | yes | Host user URI (e.g. https://api.calendly.com/users/...) |
| `start_time` | string | yes | ISO 8601 start time |
| `end_time` | string | yes | ISO 8601 end time |
| `location` | object | no | Location object (type + location) |
| `name` | string | no | Name for the booking |
```lua
local result = app.integrations.calendly.create_booking({
host = "https://api.calendly.com/users/abc-123",
start_time = "2024-06-15T10:00:00Z",
end_time = "2024-06-15T11:00:00Z",
name = "Quick Sync",
location = { type = "zoom" }
})
print(result.resource.scheduling_url)
```
---
### calendly_list_bookings
List scheduled bookings (events) with optional filters.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `user` | string | no | User URI to filter by |
| `organization` | string | no | Organization URI to filter by |
| `status` | string | no | `"active"` or `"canceled"` |
| `min_start_time` | string | no | ISO 8601 lower bound |
| `max_start_time` | string | no | ISO 8601 upper bound |
| `page_token` | string | no | Pagination token |
| `count` | integer | no | Results per page (default 20, max 100) |
```lua
local result = app.integrations.calendly.list_bookings({
status = "active",
min_start_time = "2024-01-01T00:00:00Z",
max_start_time = "2024-12-31T23:59:59Z"
})
for _, booking in ipairs(result.collection) do
print(booking.name, booking.start_time, booking.end_time)
end
```
---
### calendly_list_organizations
List organizations the authenticated user belongs to.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_token` | string | no | Pagination token |
```lua
local result = app.integrations.calendly.list_organizations({})
for _, org in ipairs(result.collection) do
print(org.name, org.slug)
end
```
---
### calendly_list_users
List users (organization memberships) in a Calendly organization.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `organization` | string | no | Organization URI to filter by |
| `user` | string | no | User URI to filter by |
| `page_token` | string | no | Pagination token |
| `count` | integer | no | Results per page (default 20, max 100) |
```lua
local result = app.integrations.calendly.list_users({
organization = "https://api.calendly.com/organizations/org-123"
})
for _, member in ipairs(result.collection) do
print(member.user.name, member.user.email, member.role)
end
```
---
### calendly_get_current_user
Get the authenticated user's profile (name, email, scheduling URL, timezone, organization).
```lua
local user = app.integrations.calendly.get_current_user()
print(user.resource.name, user.resource.email)
```
---
## Common Workflows
### Check upcoming meetings for the current user
1. `calendly_get_current_user` — Get the authenticated user's URI
2. `calendly_list_bookings` — Filter by `user` URI and `status = "active"` with a `min_start_time` of now
### Find available event types and create a booking link
1. `calendly_list_event_types` — Find available event types
2. `calendly_get_event_type` — Get details for a specific event type
3. `calendly_create_booking` — Create a one-off event type with a scheduling URL
### Explore organization structure
1. `calendly_get_current_user` — Get user profile with organization info
2. `calendly_list_organizations` — See all organizations
3. `calendly_list_users` — List members within an organization
---
## Multi-Account Usage
If you have multiple Calendly accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.calendly.function_name({...})
-- Explicit default (portable across setups)
app.integrations.calendly.default.function_name({...})
-- Named accounts
app.integrations.calendly.work.function_name({...})
app.integrations.calendly.personal.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.calendly.list_event_types({user = "example_user", organization = "example_organization", active = true, page_token = "example_page_token", count = 1})
print(result) Functions
list_event_types Read
List event types for a Calendly user or organization.
- Lua path
app.integrations.calendly.list_event_types- Full name
calendly.calendly_list_event_types
| Parameter | Type | Required | Description |
|---|---|---|---|
user | string | no | The user URI to filter by (e.g. https://api.calendly.com/users/...). |
organization | string | no | The organization URI to filter by. |
active | boolean | no | Filter by active status. true returns only active event types. |
page_token | string | no | Pagination token from a previous response. |
count | integer | no | Number of results per page (default 20, max 100). |
get_event_type Read
Get a single Calendly event type by UUID.
- Lua path
app.integrations.calendly.get_event_type- Full name
calendly.calendly_get_event_type
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid | string | yes | The event type UUID. |
create_booking Write
Create a booking in Calendly by generating a one-off event type with a scheduling URL for the invitee.
- Lua path
app.integrations.calendly.create_booking- Full name
calendly.calendly_create_booking
| Parameter | Type | Required | Description |
|---|---|---|---|
host | string | yes | The host user URI (e.g. https://api.calendly.com/users/...). |
start_time | string | yes | Start time in ISO 8601 format (e.g. 2024-06-15T10:00:00Z). |
end_time | string | yes | End time in ISO 8601 format (e.g. 2024-06-15T11:00:00Z). |
location | object | no | Location object with "type" (e.g. "zoom", "google_conference", "custom") and optional "location". |
name | string | no | Name for the booking / event type. |
list_bookings Read
List scheduled Calendly bookings (events) with optional filters.
- Lua path
app.integrations.calendly.list_bookings- Full name
calendly.calendly_list_bookings
| Parameter | Type | Required | Description |
|---|---|---|---|
user | string | no | The user URI to filter by. |
organization | string | no | The organization URI to filter by. |
status | string | no | Filter by status: "active" or "canceled". |
min_start_time | string | no | ISO 8601 lower bound for start time. |
max_start_time | string | no | ISO 8601 upper bound for start time. |
page_token | string | no | Pagination token from a previous response. |
count | integer | no | Number of results per page (default 20, max 100). |
list_organizations Read
List Calendly organizations the authenticated user belongs to.
- Lua path
app.integrations.calendly.list_organizations- Full name
calendly.calendly_list_organizations
| Parameter | Type | Required | Description |
|---|---|---|---|
page_token | string | no | Pagination token from a previous response. |
list_users Read
List users (organization memberships) in a Calendly organization.
- Lua path
app.integrations.calendly.list_users- Full name
calendly.calendly_list_users
| Parameter | Type | Required | Description |
|---|---|---|---|
organization | string | no | The organization URI to filter by (e.g. https://api.calendly.com/organizations/...). |
user | string | no | The user URI to filter by. |
page_token | string | no | Pagination token from a previous response. |
count | integer | no | Number of results per page (default 20, max 100). |
get_current_user Read
Get the authenticated Calendly user profile.
- Lua path
app.integrations.calendly.get_current_user- Full name
calendly.calendly_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||