KosmoKrator

communication

Wildix Lua API for KosmoKrator Agents

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

6 functions 6 read 0 write Bearer token auth

Lua Namespace

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

Wildix — Lua API Reference

list_calls

List call records from the Wildix PBX with optional pagination and date filtering.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of call records to return (default: 25)
pageintegernoPage number for pagination (default: 1)
date_fromstringnoStart date for filtering calls (ISO 8601, e.g. “2026-01-01”)
date_tostringnoEnd date for filtering calls (ISO 8601, e.g. “2026-01-31”)

Examples

List recent calls

local result = app.integrations.wildix.list_calls({
  limit = 10,
  page = 1
})

for _, call in ipairs(result.calls or {}) do
  print(call.id .. ": " .. call.status)
end

Filter calls by date range

local result = app.integrations.wildix.list_calls({
  date_from = "2026-01-01",
  date_to = "2026-01-31",
  limit = 50
})

get_call

Get detailed information about a specific call record.

Parameters

NameTypeRequiredDescription
idstringyesThe unique identifier of the call record

Example

local result = app.integrations.wildix.get_call({ id = "call-123" })
print("Duration: " .. result.duration .. "s")
print("From: " .. result.from)
print("To: " .. result.to)

list_extensions

List PBX extensions configured in the Wildix system.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of extensions to return (default: 25)
pageintegernoPage number for pagination (default: 1)

Example

local result = app.integrations.wildix.list_extensions({
  limit = 50,
  page = 1
})

for _, ext in ipairs(result.extensions or {}) do
  print(ext.id .. ": " .. ext.name)
end

get_extension

Get detailed information about a specific PBX extension.

Parameters

NameTypeRequiredDescription
idstringyesThe unique identifier of the extension

Example

local result = app.integrations.wildix.get_extension({ id = "ext-456" })
print("Extension: " .. result.number)
print("User: " .. result.user_name)

list_users

List users configured in the Wildix PBX system.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of users to return (default: 25)
pageintegernoPage number for pagination (default: 1)

Example

local result = app.integrations.wildix.list_users({
  limit = 50,
  page = 1
})

for _, user in ipairs(result.users or {}) do
  print(user.id .. ": " .. user.name .. " <" .. user.email .. ">")
end

get_current_user

Get the profile of the currently authenticated Wildix user. No parameters required.

Example

local result = app.integrations.wildix.get_current_user({})
print("Logged in as: " .. result.name)
print("Email: " .. result.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.wildix.list_calls({...})

-- Explicit default (portable across setups)
app.integrations.wildix.default.list_calls({...})

-- Named accounts
app.integrations.wildix.office.list_calls({...})
app.integrations.wildix.support.list_calls({...})

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

Raw agent markdown
# Wildix — Lua API Reference

## list_calls

List call records from the Wildix PBX with optional pagination and date filtering.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of call records to return (default: 25) |
| `page` | integer | no | Page number for pagination (default: 1) |
| `date_from` | string | no | Start date for filtering calls (ISO 8601, e.g. "2026-01-01") |
| `date_to` | string | no | End date for filtering calls (ISO 8601, e.g. "2026-01-31") |

### Examples

#### List recent calls

```lua
local result = app.integrations.wildix.list_calls({
  limit = 10,
  page = 1
})

for _, call in ipairs(result.calls or {}) do
  print(call.id .. ": " .. call.status)
end
```

#### Filter calls by date range

```lua
local result = app.integrations.wildix.list_calls({
  date_from = "2026-01-01",
  date_to = "2026-01-31",
  limit = 50
})
```

---

## get_call

Get detailed information about a specific call record.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique identifier of the call record |

### Example

```lua
local result = app.integrations.wildix.get_call({ id = "call-123" })
print("Duration: " .. result.duration .. "s")
print("From: " .. result.from)
print("To: " .. result.to)
```

---

## list_extensions

List PBX extensions configured in the Wildix system.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of extensions to return (default: 25) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Example

```lua
local result = app.integrations.wildix.list_extensions({
  limit = 50,
  page = 1
})

for _, ext in ipairs(result.extensions or {}) do
  print(ext.id .. ": " .. ext.name)
end
```

---

## get_extension

Get detailed information about a specific PBX extension.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique identifier of the extension |

### Example

```lua
local result = app.integrations.wildix.get_extension({ id = "ext-456" })
print("Extension: " .. result.number)
print("User: " .. result.user_name)
```

---

## list_users

List users configured in the Wildix PBX system.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of users to return (default: 25) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Example

```lua
local result = app.integrations.wildix.list_users({
  limit = 50,
  page = 1
})

for _, user in ipairs(result.users or {}) do
  print(user.id .. ": " .. user.name .. " <" .. user.email .. ">")
end
```

---

## get_current_user

Get the profile of the currently authenticated Wildix user. No parameters required.

### Example

```lua
local result = app.integrations.wildix.get_current_user({})
print("Logged in as: " .. result.name)
print("Email: " .. result.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.wildix.list_calls({...})

-- Explicit default (portable across setups)
app.integrations.wildix.default.list_calls({...})

-- Named accounts
app.integrations.wildix.office.list_calls({...})
app.integrations.wildix.support.list_calls({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.wildix.wildix_list_calls({
  limit = 1,
  page = 1,
  date_from = "example_date_from",
  date_to = "example_date_to"
})
print(result)

Functions

wildix_list_calls

List call records from the Wildix PBX. Supports pagination and optional date range filtering to narrow results by period.

Operation
Read read
Full name
wildix.wildix_list_calls
ParameterTypeRequiredDescription
limit integer no Maximum number of call records to return (default: 25).
page integer no Page number for pagination (default: 1).
date_from string no Start date for filtering calls (ISO 8601, e.g. "2026-01-01").
date_to string no End date for filtering calls (ISO 8601, e.g. "2026-01-31").

wildix_get_call

Get detailed information about a specific call record by its ID.

Operation
Read read
Full name
wildix.wildix_get_call
ParameterTypeRequiredDescription
id string yes The unique identifier of the call record.

wildix_list_extensions

List PBX extensions configured in the Wildix system. Supports pagination.

Operation
Read read
Full name
wildix.wildix_list_extensions
ParameterTypeRequiredDescription
limit integer no Maximum number of extensions to return (default: 25).
page integer no Page number for pagination (default: 1).

wildix_get_extension

Get detailed information about a specific PBX extension by its ID.

Operation
Read read
Full name
wildix.wildix_get_extension
ParameterTypeRequiredDescription
id string yes The unique identifier of the extension.

wildix_list_users

List users configured in the Wildix PBX system. Supports pagination.

Operation
Read read
Full name
wildix.wildix_list_users
ParameterTypeRequiredDescription
limit integer no Maximum number of users to return (default: 25).
page integer no Page number for pagination (default: 1).

wildix_get_current_user

Get the profile of the currently authenticated Wildix user (the user associated with the configured access token).

Operation
Read read
Full name
wildix.wildix_get_current_user
ParameterTypeRequiredDescription
No parameters.