KosmoKrator

communication

Dialpad Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write Bearer token auth

Lua Namespace

Agents call this integration through app.integrations.dialpad.*. Use lua_read_doc("integrations.dialpad") 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.

Dialpad — Lua API Reference

list_calls

List call history records from Dialpad.

Parameters

NameTypeRequiredDescription
startTimeintegernoUnix timestamp for the start of the date range
endTimeintegernoUnix timestamp for the end of the date range
limitintegernoMaximum number of records to return (default: 50)
cursorstringnoPagination cursor from a previous response

Examples

-- List recent calls
local result = app.integrations.dialpad.list_calls({
  limit = 20
})

for _, call in ipairs(result.items or {}) do
  print(call.direction .. " call from " .. (call.from_number or "unknown"))
end
-- List calls from the last 24 hours
local now = os.time()
local result = app.integrations.dialpad.list_calls({
  startTime = now - 86400,
  endTime = now,
  limit = 100
})

get_call

Get details of a specific call record by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe call history record ID

Example

local result = app.integrations.dialpad.get_call({ id = "call_abc123" })
print("Duration: " .. (result.duration or 0) .. " seconds")

list_sms

List SMS messages from Dialpad.

Parameters

NameTypeRequiredDescription
startTimeintegernoUnix timestamp for the start of the date range
endTimeintegernoUnix timestamp for the end of the date range
limitintegernoMaximum number of messages to return (default: 50)
cursorstringnoPagination cursor from a previous response

Example

local result = app.integrations.dialpad.list_sms({
  limit = 25
})

for _, msg in ipairs(result.items or {}) do
  print(msg.from .. " -> " .. msg.to .. ": " .. msg.text)
end

send_sms

Send an SMS message via Dialpad.

Parameters

NameTypeRequiredDescription
tostringyesRecipient phone number in E.164 format (e.g., “+14155551234”)
fromstringyesSender phone number or department ID in E.164 format
textstringyesThe SMS message body

Example

local result = app.integrations.dialpad.send_sms({
  to = "+14155551234",
  from = "+14155559876",
  text = "Hello from Dialpad!"
})
print("Message sent, ID: " .. (result.id or "unknown"))

list_users

List users in the Dialpad organization.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of users to return (default: 50)
cursorstringnoPagination cursor from a previous response

Example

local result = app.integrations.dialpad.list_users({ limit = 100 })

for _, user in ipairs(result.items or {}) do
  print(user.first_name .. " " .. user.last_name .. " - " .. (user.email or ""))
end

get_user

Get details of a specific Dialpad user by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe Dialpad user ID

Example

local result = app.integrations.dialpad.get_user({ id = "user_abc123" })
print(result.first_name .. " " .. result.last_name)
print("Email: " .. (result.email or "N/A"))

get_current_user

Get the profile of the currently authenticated Dialpad user.

Parameters

None.

Example

local result = app.integrations.dialpad.get_current_user({})
print("Connected as: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.dialpad.list_calls({ limit = 10 })

-- Explicit default (portable across setups)
app.integrations.dialpad.default.list_calls({ limit = 10 })

-- Named accounts
app.integrations.dialpad.work.list_calls({ limit = 10 })
app.integrations.dialpad.support.list_calls({ limit = 10 })

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

Raw agent markdown
# Dialpad — Lua API Reference

## list_calls

List call history records from Dialpad.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `startTime` | integer | no | Unix timestamp for the start of the date range |
| `endTime` | integer | no | Unix timestamp for the end of the date range |
| `limit` | integer | no | Maximum number of records to return (default: 50) |
| `cursor` | string | no | Pagination cursor from a previous response |

### Examples

```lua
-- List recent calls
local result = app.integrations.dialpad.list_calls({
  limit = 20
})

for _, call in ipairs(result.items or {}) do
  print(call.direction .. " call from " .. (call.from_number or "unknown"))
end
```

```lua
-- List calls from the last 24 hours
local now = os.time()
local result = app.integrations.dialpad.list_calls({
  startTime = now - 86400,
  endTime = now,
  limit = 100
})
```

---

## get_call

Get details of a specific call record by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The call history record ID |

### Example

```lua
local result = app.integrations.dialpad.get_call({ id = "call_abc123" })
print("Duration: " .. (result.duration or 0) .. " seconds")
```

---

## list_sms

List SMS messages from Dialpad.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `startTime` | integer | no | Unix timestamp for the start of the date range |
| `endTime` | integer | no | Unix timestamp for the end of the date range |
| `limit` | integer | no | Maximum number of messages to return (default: 50) |
| `cursor` | string | no | Pagination cursor from a previous response |

### Example

```lua
local result = app.integrations.dialpad.list_sms({
  limit = 25
})

for _, msg in ipairs(result.items or {}) do
  print(msg.from .. " -> " .. msg.to .. ": " .. msg.text)
end
```

---

## send_sms

Send an SMS message via Dialpad.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `to` | string | yes | Recipient phone number in E.164 format (e.g., "+14155551234") |
| `from` | string | yes | Sender phone number or department ID in E.164 format |
| `text` | string | yes | The SMS message body |

### Example

```lua
local result = app.integrations.dialpad.send_sms({
  to = "+14155551234",
  from = "+14155559876",
  text = "Hello from Dialpad!"
})
print("Message sent, ID: " .. (result.id or "unknown"))
```

---

## list_users

List users in the Dialpad organization.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of users to return (default: 50) |
| `cursor` | string | no | Pagination cursor from a previous response |

### Example

```lua
local result = app.integrations.dialpad.list_users({ limit = 100 })

for _, user in ipairs(result.items or {}) do
  print(user.first_name .. " " .. user.last_name .. " - " .. (user.email or ""))
end
```

---

## get_user

Get details of a specific Dialpad user by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The Dialpad user ID |

### Example

```lua
local result = app.integrations.dialpad.get_user({ id = "user_abc123" })
print(result.first_name .. " " .. result.last_name)
print("Email: " .. (result.email or "N/A"))
```

---

## get_current_user

Get the profile of the currently authenticated Dialpad user.

### Parameters

None.

### Example

```lua
local result = app.integrations.dialpad.get_current_user({})
print("Connected as: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.dialpad.list_calls({ limit = 10 })

-- Explicit default (portable across setups)
app.integrations.dialpad.default.list_calls({ limit = 10 })

-- Named accounts
app.integrations.dialpad.work.list_calls({ limit = 10 })
app.integrations.dialpad.support.list_calls({ limit = 10 })
```

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

Metadata-Derived Lua Example

local result = app.integrations.dialpad.dialpad_list_calls({
  startTime = 1,
  endTime = 1,
  limit = 1,
  cursor = "example_cursor"
})
print(result)

Functions

dialpad_list_calls

List call history records from Dialpad. Returns call details including participants, duration, and direction. Supports date range filtering and pagination.

Operation
Read read
Full name
dialpad.dialpad_list_calls
ParameterTypeRequiredDescription
startTime integer no Unix timestamp for the start of the date range.
endTime integer no Unix timestamp for the end of the date range.
limit integer no Maximum number of call records to return (default: 50).
cursor string no Pagination cursor — pass the cursor from a previous response to get the next page.

dialpad_get_call

Get details of a specific call record by ID. Returns full call information including participants, duration, direction, and recording URL if available.

Operation
Read read
Full name
dialpad.dialpad_get_call
ParameterTypeRequiredDescription
id string yes The call history record ID.

dialpad_list_sms

List SMS messages from Dialpad. Returns message details including sender, recipient, text content, and timestamps. Supports date range filtering and pagination.

Operation
Read read
Full name
dialpad.dialpad_list_sms
ParameterTypeRequiredDescription
startTime integer no Unix timestamp for the start of the date range.
endTime integer no Unix timestamp for the end of the date range.
limit integer no Maximum number of SMS messages to return (default: 50).
cursor string no Pagination cursor — pass the cursor from a previous response to get the next page.

dialpad_send_sms

Send an SMS message via Dialpad. Specify the recipient number, sender number (or department ID), and message text.

Operation
Write write
Full name
dialpad.dialpad_send_sms
ParameterTypeRequiredDescription
to string yes The recipient phone number in E.164 format (e.g., "+14155551234").
from string yes The sender phone number or department ID in E.164 format (e.g., "+14155559876").
text string yes The SMS message body.

dialpad_list_users

List users in the Dialpad organization. Returns user details including name, email, phone numbers, and department. Supports pagination.

Operation
Read read
Full name
dialpad.dialpad_list_users
ParameterTypeRequiredDescription
limit integer no Maximum number of users to return (default: 50).
cursor string no Pagination cursor — pass the cursor from a previous response to get the next page.

dialpad_get_user

Get details of a specific Dialpad user by ID. Returns user profile including name, email, phone numbers, department, and status.

Operation
Read read
Full name
dialpad.dialpad_get_user
ParameterTypeRequiredDescription
id string yes The Dialpad user ID.

dialpad_get_current_user

Get the profile of the currently authenticated Dialpad user. Useful for verifying the connection and identifying which account the integration is using.

Operation
Read read
Full name
dialpad.dialpad_get_current_user
ParameterTypeRequiredDescription
No parameters.