KosmoKrator

communication

Cisco Webex Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Cisco Webex KosmoKrator integration.

6 functions 5 read 1 write Manual OAuth token auth

Lua Namespace

Agents call this integration through app.integrations.webex.*. Use lua_read_doc("integrations.webex") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Cisco Webex — Lua API Reference

list_rooms

List Webex spaces (rooms) the authenticated user belongs to.

Parameters

NameTypeRequiredDescription
maxintegernoMaximum number of rooms to return (1–1000, default: 100)
beforestringnoList rooms before this ISO 8601 timestamp (pagination cursor)
afterstringnoList rooms after this ISO 8601 timestamp (pagination cursor)

Example

local result = app.integrations.webex.list_rooms({ max = 20 })

for _, room in ipairs(result.items) do
  print(room.title .. " (type: " .. room.type .. ")")
end

get_room

Get details for a specific Webex room.

Parameters

NameTypeRequiredDescription
room_idstringyesThe unique identifier of the room

Example

local room = app.integrations.webex.get_room({ room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v..." })
print("Room: " .. room.title)
print("Type: " .. room.type)
print("Created: " .. room.created)

list_messages

List messages in a Webex room with optional date filtering and pagination.

Parameters

NameTypeRequiredDescription
room_idstringyesThe room to list messages from
maxintegernoMaximum number of messages (1–1000, default: 50)
beforestringnoList messages posted before this ISO 8601 timestamp
afterstringnoList messages posted after this ISO 8601 timestamp

Example

local result = app.integrations.webex.list_messages({
  room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v...",
  max = 25,
  after = "2025-04-01T00:00:00Z"
})

for _, msg in ipairs(result.items) do
  print(msg.personEmail .. ": " .. (msg.text or "(no text)"))
end

create_message

Post a new message to a Webex room. Supports plain text and Markdown.

Parameters

NameTypeRequiredDescription
room_idstringyesThe room to post the message in
textstringno*Plain-text message content
markdownstringno*Markdown-formatted message content

* At least one of text or markdown is required. If both are provided, Webex displays Markdown to capable clients and falls back to plain text.

Example

-- Plain text message
app.integrations.webex.create_message({
  room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v...",
  text = "Hello from the AI agent!"
})

-- Markdown message
app.integrations.webex.create_message({
  room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v...",
  text = "Summary report attached.",
  markdown = "**Summary Report**\n\n* Item 1\n* Item 2\n* Item 3"
})

list_meetings

List scheduled Webex meetings for the authenticated user.

Parameters

NameTypeRequiredDescription
fromstringnoStart of date range (ISO 8601, e.g., "2025-04-01T00:00:00Z")
tostringnoEnd of date range (ISO 8601, e.g., "2025-04-30T23:59:59Z")
maxintegernoMaximum number of meetings (1–100, default: 100)

Example

local result = app.integrations.webex.list_meetings({
  from = "2025-04-01T00:00:00Z",
  to = "2025-04-30T23:59:59Z"
})

for _, meeting in ipairs(result.items) do
  print(meeting.title .. " — " .. meeting.start .. " to " .. meeting.end)
end

get_current_user

Get the profile of the currently authenticated Webex user. Takes no parameters.

Example

local user = app.integrations.webex.get_current_user({})
print("Name: " .. user.displayName)
print("Email: " .. user.emails[1])

Multi-Account Usage

If you have multiple Webex accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.webex.list_rooms({ max = 20 })

-- Explicit default (portable across setups)
app.integrations.webex.default.list_rooms({ max = 20 })

-- Named accounts
app.integrations.webex.work.list_rooms({ max = 20 })
app.integrations.webex.personal.list_rooms({ max = 20 })

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Cisco Webex — Lua API Reference

## list_rooms

List Webex spaces (rooms) the authenticated user belongs to.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `max` | integer | no | Maximum number of rooms to return (1–1000, default: 100) |
| `before` | string | no | List rooms before this ISO 8601 timestamp (pagination cursor) |
| `after` | string | no | List rooms after this ISO 8601 timestamp (pagination cursor) |

### Example

```lua
local result = app.integrations.webex.list_rooms({ max = 20 })

for _, room in ipairs(result.items) do
  print(room.title .. " (type: " .. room.type .. ")")
end
```

---

## get_room

Get details for a specific Webex room.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `room_id` | string | yes | The unique identifier of the room |

### Example

```lua
local room = app.integrations.webex.get_room({ room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v..." })
print("Room: " .. room.title)
print("Type: " .. room.type)
print("Created: " .. room.created)
```

---

## list_messages

List messages in a Webex room with optional date filtering and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `room_id` | string | yes | The room to list messages from |
| `max` | integer | no | Maximum number of messages (1–1000, default: 50) |
| `before` | string | no | List messages posted before this ISO 8601 timestamp |
| `after` | string | no | List messages posted after this ISO 8601 timestamp |

### Example

```lua
local result = app.integrations.webex.list_messages({
  room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v...",
  max = 25,
  after = "2025-04-01T00:00:00Z"
})

for _, msg in ipairs(result.items) do
  print(msg.personEmail .. ": " .. (msg.text or "(no text)"))
end
```

---

## create_message

Post a new message to a Webex room. Supports plain text and Markdown.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `room_id` | string | yes | The room to post the message in |
| `text` | string | no* | Plain-text message content |
| `markdown` | string | no* | Markdown-formatted message content |

\* At least one of `text` or `markdown` is required. If both are provided, Webex displays Markdown to capable clients and falls back to plain text.

### Example

```lua
-- Plain text message
app.integrations.webex.create_message({
  room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v...",
  text = "Hello from the AI agent!"
})

-- Markdown message
app.integrations.webex.create_message({
  room_id = "Y2lzY29zcGFyazovL3VzL1JPT00v...",
  text = "Summary report attached.",
  markdown = "**Summary Report**\n\n* Item 1\n* Item 2\n* Item 3"
})
```

---

## list_meetings

List scheduled Webex meetings for the authenticated user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `from` | string | no | Start of date range (ISO 8601, e.g., `"2025-04-01T00:00:00Z"`) |
| `to` | string | no | End of date range (ISO 8601, e.g., `"2025-04-30T23:59:59Z"`) |
| `max` | integer | no | Maximum number of meetings (1–100, default: 100) |

### Example

```lua
local result = app.integrations.webex.list_meetings({
  from = "2025-04-01T00:00:00Z",
  to = "2025-04-30T23:59:59Z"
})

for _, meeting in ipairs(result.items) do
  print(meeting.title .. " — " .. meeting.start .. " to " .. meeting.end)
end
```

---

## get_current_user

Get the profile of the currently authenticated Webex user. Takes no parameters.

### Example

```lua
local user = app.integrations.webex.get_current_user({})
print("Name: " .. user.displayName)
print("Email: " .. user.emails[1])
```

---

## Multi-Account Usage

If you have multiple Webex accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.webex.list_rooms({ max = 20 })

-- Explicit default (portable across setups)
app.integrations.webex.default.list_rooms({ max = 20 })

-- Named accounts
app.integrations.webex.work.list_rooms({ max = 20 })
app.integrations.webex.personal.list_rooms({ max = 20 })
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.webex.webex_list_rooms({
  max = 1,
  before = "example_before",
  after = "example_after"
})
print(result)

Functions

webex_list_rooms

List Webex spaces (rooms) the authenticated user belongs to. Returns room IDs, titles, types, and last activity timestamps. Use for discovering available rooms before reading messages or posting.

Operation
Read read
Full name
webex.webex_list_rooms
ParameterTypeRequiredDescription
max integer no Maximum number of rooms to return (1–1000, default: 100).
before string no List rooms before this ISO 8601 timestamp (for pagination).
after string no List rooms after this ISO 8601 timestamp (for pagination).

webex_get_room

Get details for a specific Webex room by its ID. Returns room title, type (direct or group), creator, creation date, and last activity.

Operation
Read read
Full name
webex.webex_get_room
ParameterTypeRequiredDescription
room_id string yes The unique identifier of the Webex room.

webex_list_messages

List messages in a Webex room. Supports date-based filtering with before/after parameters and pagination. Returns message text, sender info, and timestamps.

Operation
Read read
Full name
webex.webex_list_messages
ParameterTypeRequiredDescription
room_id string yes The room to list messages from.
max integer no Maximum number of messages to return (1–1000, default: 50).
before string no List messages posted before this ISO 8601 timestamp.
after string no List messages posted after this ISO 8601 timestamp.

webex_create_message

Post a new message to a Webex room. Supports plain text and Markdown formatting. Provide either "text" (plain text) or "markdown" (formatted), or both — Webex will display Markdown to clients that support it and fall back to plain text.

Operation
Write write
Full name
webex.webex_create_message
ParameterTypeRequiredDescription
room_id string yes The room to post the message in.
text string no Plain-text content of the message.
markdown string no Markdown-formatted content of the message.

webex_list_meetings

List scheduled Webex meetings for the authenticated user. Supports date range filtering with "from" and "to" parameters (ISO 8601). Returns meeting titles, start/end times, and join links.

Operation
Read read
Full name
webex.webex_list_meetings
ParameterTypeRequiredDescription
from string no Start of the date range (ISO 8601, e.g., "2025-04-01T00:00:00Z"). Lists meetings starting from this time.
to string no End of the date range (ISO 8601, e.g., "2025-04-30T23:59:59Z"). Lists meetings up to this time.
max integer no Maximum number of meetings to return (1–100, default: 100).

webex_get_current_user

Get the profile of the currently authenticated Webex user. Returns display name, email, avatar, and account details. Useful for identifying which account the integration is connected to.

Operation
Read read
Full name
webex.webex_get_current_user
ParameterTypeRequiredDescription
No parameters.