KosmoKrator

productivity

Cisco Webex Lua API for KosmoKrator Agents

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

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.

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 Cisco Webex workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.webex.list_rooms({max = 1, before = "example_before", after = "example_after"}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("webex"))' --json
kosmo integrations:lua --eval 'print(docs.read("webex.list_rooms"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local webex = app.integrations.webex
local result = webex.list_rooms({max = 1, before = "example_before", after = "example_after"})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.webex, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.webex.default.* or app.integrations.webex.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Cisco Webex, use the narrower mcp:lua command.

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.

Cisco Webex Lua API Reference

Namespace: app.integrations.webex

Use this integration for Webex Messaging, Teams, Meetings, People, Memberships, Webhooks, and relative Webex REST API calls. Returned data is the parsed Webex JSON response with the package’s parameter validation applied before the request.

Common Patterns

List rooms before reading messages or posting:

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

for _, room in ipairs(rooms.items or {}) do
  print(room.id .. " " .. room.title)
end

Create a message with either text, markdown, or both:

app.integrations.webex.create_message({
  room_id = "room_123",
  text = "Summary report attached.",
  markdown = "**Summary report**\n\n* Revenue is up\n* Churn is flat"
})

Pass official Webex fields that are not first-class parameters through payload on create/update tools:

app.integrations.webex.create_webhook({
  name = "Room messages",
  targetUrl = "https://example.test/webex",
  resource = "messages",
  event = "created",
  filter = "roomId=room_123"
})

Rooms

FunctionPurpose
list_rooms({ max?, before?, after? })List rooms visible to the token. max is capped at 1000.
get_room({ room_id })Get one room by ID.
create_room({ title, teamId?, classificationId?, payload? })Create a standalone or team room.
update_room({ room_id, title?, isLocked?, isPublic?, payload? })Update room metadata.
delete_room({ room_id })Delete one room.

Messages

FunctionPurpose
list_messages({ room_id, max?, before?, after? })List messages from a room. max is capped at 1000.
create_message({ room_id, text?, markdown? })Post a message. At least one of text or markdown is required.
get_message({ message_id })Get one message by ID.
update_message({ message_id, text?, markdown?, payload? })Update a message. At least one update field is required.
delete_message({ message_id })Delete one message.

Bots can only see messages in rooms where they are present, and bot tokens only receive messages where the bot is mentioned unless the upstream token has wider scopes.

People And Memberships

FunctionPurpose
list_people({ email?, displayName?, id?, orgId?, max? })Search or list people visible to the token.
get_person({ person_id })Get one person profile.
list_memberships({ roomId?, personId?, personEmail?, max? })List room memberships.
create_membership({ roomId, personId?, personEmail?, isModerator?, payload? })Add a person to a room.
delete_membership({ membership_id })Remove a room membership.

Use either personId or personEmail when creating a membership.

Teams

FunctionPurpose
list_teams({ max? })List teams visible to the token.
get_team({ team_id })Get one team by ID.
create_team({ name, payload? })Create a team.
update_team({ team_id, name?, payload? })Update a team.
delete_team({ team_id })Delete one team.
list_team_memberships({ teamId?, personId?, personEmail?, max? })List team memberships.

Meetings

FunctionPurpose
list_meetings({ from?, to?, max? })List scheduled meetings. max is capped at 100.
get_meeting({ meeting_id })Get one meeting by ID.
create_meeting({ title, start, end, invitees?, payload? })Create a meeting.
update_meeting({ meeting_id, title?, start?, end?, invitees?, payload? })Update a meeting.
delete_meeting({ meeting_id })Delete one meeting.

Meeting create and update payloads are forwarded as Webex JSON fields, so include only fields supported by the meeting scopes available to the stored token.

Webhooks

FunctionPurpose
list_webhooks({ max? })List webhooks.
get_webhook({ webhook_id })Get one webhook.
create_webhook({ name, targetUrl, resource, event, filter?, payload? })Register a webhook callback.
update_webhook({ webhook_id, name?, targetUrl?, status?, payload? })Update a webhook.
delete_webhook({ webhook_id })Delete one webhook.

Webhook resources and events are scope-dependent. Some Webex for Government deployments do not expose every resource type.

Generic API Helpers

FunctionPurpose
api_get({ path, params? })Send GET to a relative Webex API path.
api_post({ path, payload? })Send POST to a relative Webex API path.
api_put({ path, payload? })Send PUT to a relative Webex API path.
api_delete({ path, payload? })Send DELETE to a relative Webex API path.

Generic API helpers reject absolute URLs. Use paths such as /rooms, /messages/message_123, or /team/memberships so host credentials and base URL stay centralized in the service layer.

Current User

get_current_user({}) returns the authenticated profile from /people/me. Use it to confirm which Webex identity a configured account represents.

Multi-Account Usage

All functions work the same way under account-specific namespaces:

app.integrations.webex.list_rooms({ max = 20 })
app.integrations.webex.default.list_rooms({ max = 20 })
app.integrations.webex.work.list_rooms({ max = 20 })
Raw agent markdown
# Cisco Webex Lua API Reference

Namespace: `app.integrations.webex`

Use this integration for Webex Messaging, Teams, Meetings, People, Memberships,
Webhooks, and relative Webex REST API calls. Returned data is the parsed Webex
JSON response with the package's parameter validation applied before the request.

## Common Patterns

List rooms before reading messages or posting:

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

for _, room in ipairs(rooms.items or {}) do
  print(room.id .. " " .. room.title)
end
```

Create a message with either `text`, `markdown`, or both:

```lua
app.integrations.webex.create_message({
  room_id = "room_123",
  text = "Summary report attached.",
  markdown = "**Summary report**\n\n* Revenue is up\n* Churn is flat"
})
```

Pass official Webex fields that are not first-class parameters through
`payload` on create/update tools:

```lua
app.integrations.webex.create_webhook({
  name = "Room messages",
  targetUrl = "https://example.test/webex",
  resource = "messages",
  event = "created",
  filter = "roomId=room_123"
})
```

## Rooms

| Function | Purpose |
|----------|---------|
| `list_rooms({ max?, before?, after? })` | List rooms visible to the token. `max` is capped at 1000. |
| `get_room({ room_id })` | Get one room by ID. |
| `create_room({ title, teamId?, classificationId?, payload? })` | Create a standalone or team room. |
| `update_room({ room_id, title?, isLocked?, isPublic?, payload? })` | Update room metadata. |
| `delete_room({ room_id })` | Delete one room. |

## Messages

| Function | Purpose |
|----------|---------|
| `list_messages({ room_id, max?, before?, after? })` | List messages from a room. `max` is capped at 1000. |
| `create_message({ room_id, text?, markdown? })` | Post a message. At least one of `text` or `markdown` is required. |
| `get_message({ message_id })` | Get one message by ID. |
| `update_message({ message_id, text?, markdown?, payload? })` | Update a message. At least one update field is required. |
| `delete_message({ message_id })` | Delete one message. |

Bots can only see messages in rooms where they are present, and bot tokens only
receive messages where the bot is mentioned unless the upstream token has wider
scopes.

## People And Memberships

| Function | Purpose |
|----------|---------|
| `list_people({ email?, displayName?, id?, orgId?, max? })` | Search or list people visible to the token. |
| `get_person({ person_id })` | Get one person profile. |
| `list_memberships({ roomId?, personId?, personEmail?, max? })` | List room memberships. |
| `create_membership({ roomId, personId?, personEmail?, isModerator?, payload? })` | Add a person to a room. |
| `delete_membership({ membership_id })` | Remove a room membership. |

Use either `personId` or `personEmail` when creating a membership.

## Teams

| Function | Purpose |
|----------|---------|
| `list_teams({ max? })` | List teams visible to the token. |
| `get_team({ team_id })` | Get one team by ID. |
| `create_team({ name, payload? })` | Create a team. |
| `update_team({ team_id, name?, payload? })` | Update a team. |
| `delete_team({ team_id })` | Delete one team. |
| `list_team_memberships({ teamId?, personId?, personEmail?, max? })` | List team memberships. |

## Meetings

| Function | Purpose |
|----------|---------|
| `list_meetings({ from?, to?, max? })` | List scheduled meetings. `max` is capped at 100. |
| `get_meeting({ meeting_id })` | Get one meeting by ID. |
| `create_meeting({ title, start, end, invitees?, payload? })` | Create a meeting. |
| `update_meeting({ meeting_id, title?, start?, end?, invitees?, payload? })` | Update a meeting. |
| `delete_meeting({ meeting_id })` | Delete one meeting. |

Meeting create and update payloads are forwarded as Webex JSON fields, so include
only fields supported by the meeting scopes available to the stored token.

## Webhooks

| Function | Purpose |
|----------|---------|
| `list_webhooks({ max? })` | List webhooks. |
| `get_webhook({ webhook_id })` | Get one webhook. |
| `create_webhook({ name, targetUrl, resource, event, filter?, payload? })` | Register a webhook callback. |
| `update_webhook({ webhook_id, name?, targetUrl?, status?, payload? })` | Update a webhook. |
| `delete_webhook({ webhook_id })` | Delete one webhook. |

Webhook resources and events are scope-dependent. Some Webex for Government
deployments do not expose every resource type.

## Generic API Helpers

| Function | Purpose |
|----------|---------|
| `api_get({ path, params? })` | Send GET to a relative Webex API path. |
| `api_post({ path, payload? })` | Send POST to a relative Webex API path. |
| `api_put({ path, payload? })` | Send PUT to a relative Webex API path. |
| `api_delete({ path, payload? })` | Send DELETE to a relative Webex API path. |

Generic API helpers reject absolute URLs. Use paths such as `/rooms`,
`/messages/message_123`, or `/team/memberships` so host credentials and base URL
stay centralized in the service layer.

## Current User

`get_current_user({})` returns the authenticated profile from `/people/me`.
Use it to confirm which Webex identity a configured account represents.

## Multi-Account Usage

All functions work the same way under account-specific namespaces:

```lua
app.integrations.webex.list_rooms({ max = 20 })
app.integrations.webex.default.list_rooms({ max = 20 })
app.integrations.webex.work.list_rooms({ max = 20 })
```
Metadata-derived Lua example
local result = app.integrations.webex.list_rooms({max = 1, before = "example_before", after = "example_after"})
print(result)

Functions

list_rooms Read

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.

Lua path
app.integrations.webex.list_rooms
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).
get_room Read

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

Lua path
app.integrations.webex.get_room
Full name
webex.webex_get_room
ParameterTypeRequiredDescription
room_id string yes The unique identifier of the Webex room.
create_room Write

Create a Webex room or team room.

Lua path
app.integrations.webex.create_room
Full name
webex.webex_create_room
ParameterTypeRequiredDescription
title string yes Room title.
teamId string no Optional team ID for a team room.
classificationId string no Optional classification ID when enabled.
payload object no Additional official room fields.
update_room Write

Update Webex room metadata, such as title.

Lua path
app.integrations.webex.update_room
Full name
webex.webex_update_room
ParameterTypeRequiredDescription
room_id string yes Room ID.
title string no New room title.
payload object no Additional official room update fields.
delete_room Write

Delete a Webex room by room ID.

Lua path
app.integrations.webex.delete_room
Full name
webex.webex_delete_room
ParameterTypeRequiredDescription
room_id string yes Room ID.
list_messages Read

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

Lua path
app.integrations.webex.list_messages
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.
create_message Write

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.

Lua path
app.integrations.webex.create_message
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.
get_message Read

Get details for one Webex message by message ID.

Lua path
app.integrations.webex.get_message
Full name
webex.webex_get_message
ParameterTypeRequiredDescription
message_id string yes Message ID.
update_message Write

Update an existing Webex message with text, markdown, or official message fields.

Lua path
app.integrations.webex.update_message
Full name
webex.webex_update_message
ParameterTypeRequiredDescription
message_id string yes Message ID.
text string no Plain-text message content.
markdown string no Markdown message content.
payload object no Additional official message update fields.
delete_message Write

Delete a Webex message by message ID.

Lua path
app.integrations.webex.delete_message
Full name
webex.webex_delete_message
ParameterTypeRequiredDescription
message_id string yes Message ID.
list_people Read

List Webex people by email, display name, organization, or pagination filters.

Lua path
app.integrations.webex.list_people
Full name
webex.webex_list_people
ParameterTypeRequiredDescription
email string no Filter by email.
displayName string no Filter by display name.
id string no Filter by person ID.
orgId string no Filter by organization ID.
max integer no Maximum results to return.
get_person Read

Get a Webex person profile by person ID.

Lua path
app.integrations.webex.get_person
Full name
webex.webex_get_person
ParameterTypeRequiredDescription
person_id string yes Person ID.
list_memberships Read

List memberships for Webex rooms by room, person, email, or pagination filters.

Lua path
app.integrations.webex.list_memberships
Full name
webex.webex_list_memberships
ParameterTypeRequiredDescription
roomId string no Filter by room ID.
personId string no Filter by person ID.
personEmail string no Filter by person email.
max integer no Maximum results to return.
create_membership Write

Create a Webex room membership by room ID and person ID or email.

Lua path
app.integrations.webex.create_membership
Full name
webex.webex_create_membership
ParameterTypeRequiredDescription
roomId string yes Room ID.
personId string no Person ID to add.
personEmail string no Person email to add.
isModerator boolean no Whether the person should be a moderator.
payload object no Additional official membership fields.
delete_membership Write

Remove a person from a Webex room by membership ID.

Lua path
app.integrations.webex.delete_membership
Full name
webex.webex_delete_membership
ParameterTypeRequiredDescription
membership_id string yes Membership ID.
list_teams Read

List Webex teams visible to the authenticated token.

Lua path
app.integrations.webex.list_teams
Full name
webex.webex_list_teams
ParameterTypeRequiredDescription
max integer no Maximum results to return.
get_team Read

Get details for a Webex team by team ID.

Lua path
app.integrations.webex.get_team
Full name
webex.webex_get_team
ParameterTypeRequiredDescription
team_id string yes Team ID.
create_team Write

Create a Webex team.

Lua path
app.integrations.webex.create_team
Full name
webex.webex_create_team
ParameterTypeRequiredDescription
name string yes Team name.
payload object no Additional official team fields.
update_team Write

Update a Webex team, such as renaming it.

Lua path
app.integrations.webex.update_team
Full name
webex.webex_update_team
ParameterTypeRequiredDescription
team_id string yes Team ID.
name string no Team name.
payload object no Additional official team fields.
delete_team Write

Delete a Webex team by team ID.

Lua path
app.integrations.webex.delete_team
Full name
webex.webex_delete_team
ParameterTypeRequiredDescription
team_id string yes Team ID.
list_team_memberships Read

List Webex team memberships by team, person, email, or pagination filters.

Lua path
app.integrations.webex.list_team_memberships
Full name
webex.webex_list_team_memberships
ParameterTypeRequiredDescription
teamId string no Filter by team ID.
personId string no Filter by person ID.
personEmail string no Filter by person email.
max integer no Maximum results to return.
list_meetings Read

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.

Lua path
app.integrations.webex.list_meetings
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).
get_meeting Read

Get details for one Webex meeting by meeting ID.

Lua path
app.integrations.webex.get_meeting
Full name
webex.webex_get_meeting
ParameterTypeRequiredDescription
meeting_id string yes Meeting ID.
create_meeting Write

Create a Webex meeting with title, start/end times, invitees, and official meeting fields.

Lua path
app.integrations.webex.create_meeting
Full name
webex.webex_create_meeting
ParameterTypeRequiredDescription
title string yes Meeting title.
start string yes Start time in ISO 8601.
end string yes End time in ISO 8601.
invitees array no Invitee objects accepted by the Webex API.
payload object no Additional official meeting fields.
update_meeting Write

Update a Webex meeting by meeting ID.

Lua path
app.integrations.webex.update_meeting
Full name
webex.webex_update_meeting
ParameterTypeRequiredDescription
meeting_id string yes Meeting ID.
title string no Meeting title.
start string no Start time in ISO 8601.
end string no End time in ISO 8601.
invitees array no Invitee objects accepted by the Webex API.
payload object no Additional official meeting fields.
delete_meeting Write

Delete a Webex meeting by meeting ID.

Lua path
app.integrations.webex.delete_meeting
Full name
webex.webex_delete_meeting
ParameterTypeRequiredDescription
meeting_id string yes Meeting ID.
list_webhooks Read

List Webex webhooks for the authenticated token.

Lua path
app.integrations.webex.list_webhooks
Full name
webex.webex_list_webhooks
ParameterTypeRequiredDescription
max integer no Maximum results to return.
get_webhook Read

Get details for one Webex webhook by webhook ID.

Lua path
app.integrations.webex.get_webhook
Full name
webex.webex_get_webhook
ParameterTypeRequiredDescription
webhook_id string yes Webhook ID.
create_webhook Write

Create a Webex webhook for events such as created messages or memberships.

Lua path
app.integrations.webex.create_webhook
Full name
webex.webex_create_webhook
ParameterTypeRequiredDescription
name string yes Webhook name.
targetUrl string yes HTTPS webhook target URL.
resource string yes Resource such as messages, rooms, or memberships.
event string yes Event such as created, updated, or deleted.
filter string no Optional Webex webhook filter string.
secret string no Optional webhook signing secret.
payload object no Additional official webhook fields.
update_webhook Write

Update a Webex webhook by webhook ID.

Lua path
app.integrations.webex.update_webhook
Full name
webex.webex_update_webhook
ParameterTypeRequiredDescription
webhook_id string yes Webhook ID.
name string no Webhook name.
targetUrl string no HTTPS webhook target URL.
status string no Webhook status when supported.
payload object no Additional official webhook update fields.
delete_webhook Write

Delete a Webex webhook by webhook ID.

Lua path
app.integrations.webex.delete_webhook
Full name
webex.webex_delete_webhook
ParameterTypeRequiredDescription
webhook_id string yes Webhook ID.
get_current_user Read

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.

Lua path
app.integrations.webex.get_current_user
Full name
webex.webex_get_current_user
ParameterTypeRequiredDescription
No parameters.
api_get Read

Call a relative Webex API GET path, such as "/rooms". Absolute URLs are rejected.

Lua path
app.integrations.webex.api_get
Full name
webex.webex_api_get
ParameterTypeRequiredDescription
path string yes Relative Webex API path.
params object no Query parameters.
api_post Write

Call a relative Webex API POST path with a JSON body. Absolute URLs are rejected.

Lua path
app.integrations.webex.api_post
Full name
webex.webex_api_post
ParameterTypeRequiredDescription
path string yes Relative Webex API path.
payload object no JSON request body.
api_put Write

Call a relative Webex API PUT path with a JSON body. Absolute URLs are rejected.

Lua path
app.integrations.webex.api_put
Full name
webex.webex_api_put
ParameterTypeRequiredDescription
path string yes Relative Webex API path.
payload object no JSON request body.
api_delete Write

Call a relative Webex API DELETE path. Absolute URLs are rejected.

Lua path
app.integrations.webex.api_delete
Full name
webex.webex_api_delete
ParameterTypeRequiredDescription
path string yes Relative Webex API path.
payload object no Optional JSON body.