KosmoKrator

communication

Sinch Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write API token auth

Lua Namespace

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

Client for the Sinch SMS API — Lua API Reference

sinch_list_messages

List inbound and outbound SMS messages from Sinch. Supports filtering by direction, recipient, sender, and date range.

Parameters

NameTypeRequiredDescription
directionstringnoFilter by direction: “mt” (mobile terminated / outbound) or “mo” (mobile originated / inbound).
tostringnoFilter by destination phone number (E.164 format).
fromstringnoFilter by originating phone number or sender (E.164 format).
start_datestringnoStart date for filtering (ISO 8601 format, e.g. 2024-01-01T00:00:00Z).
end_datestringnoEnd date for filtering (ISO 8601 format, e.g. 2024-12-31T23:59:59Z).
pageintegernoPage number for pagination (default 0).
page_sizeintegernoNumber of results per page (default 30, max 100).

Example

local result = app.integrations.sinch.sinch_list_messages({
  direction = "mt"
  page = 0
  page_size = 30
})

sinch_send_sms

Send an SMS message to one or more recipients via Sinch. Requires sender phone number, recipient(s), and message body.

Parameters

NameTypeRequiredDescription
fromstringyesSender phone number or alphanumeric sender ID (E.164 format for numbers).
toarrayyesArray of recipient phone numbers in E.164 format (e.g. [“+1234567890”]).
bodystringyesThe SMS message body text.
delivery_reportstringnoDelivery report type: “none”, “summary”, or “full” (default “none”).
expire_atstringnoMessage expiration time in ISO 8601 format.
send_atstringnoScheduled send time in ISO 8601 format.

Example

local result = app.integrations.sinch.sinch_send_sms({
  from = "+1234567890"
  to = {"+1987654321"}
  body = "Hello from Sinch!"
})

sinch_list_phone_numbers

List all rented phone numbers in your Sinch account with pagination.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default 0).
page_sizeintegernoNumber of results per page (default 30, max 100).

Example

local result = app.integrations.sinch.sinch_list_phone_numbers({
  page = 0
  page_size = 30
})

sinch_get_phone_number

Get details for a specific phone number in your Sinch account.

Parameters

NameTypeRequiredDescription
phone_numberstringyesThe phone number to look up (E.164 format, e.g. “+1234567890”).

Example

local result = app.integrations.sinch.sinch_get_phone_number({
  phone_number = "+1234567890"
})

sinch_list_groups

List all groups in your Sinch account with pagination.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default 0).
page_sizeintegernoNumber of results per page (default 30, max 100).

Example

local result = app.integrations.sinch.sinch_list_groups({
  page = 0
  page_size = 30
})

sinch_get_group

Get details for a specific group in your Sinch account.

Parameters

NameTypeRequiredDescription
group_idstringyesThe unique identifier of the group.

Example

local result = app.integrations.sinch.sinch_get_group({
  group_id = "group_abc123"
})

sinch_list_batches

List all message batches in your Sinch account with pagination.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default 0).
page_sizeintegernoNumber of results per page (default 30, max 100).

Example

local result = app.integrations.sinch.sinch_list_batches({
  page = 0
  page_size = 30
})

Multi-Account Usage

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

-- Default account (always works)
app.integrations.sinch.function_name({...})

-- Explicit default (portable across setups)
app.integrations.sinch.default.function_name({...})

-- Named accounts
app.integrations.sinch.work.function_name({...})
app.integrations.sinch.personal.function_name({...})

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

Raw agent markdown
# Client for the Sinch SMS API — Lua API Reference

## sinch_list_messages

List inbound and outbound SMS messages from Sinch. Supports filtering by direction, recipient, sender, and date range.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `direction` | string | no | Filter by direction: "mt" (mobile terminated / outbound) or "mo" (mobile originated / inbound). |
| `to` | string | no | Filter by destination phone number (E.164 format). |
| `from` | string | no | Filter by originating phone number or sender (E.164 format). |
| `start_date` | string | no | Start date for filtering (ISO 8601 format, e.g. 2024-01-01T00:00:00Z). |
| `end_date` | string | no | End date for filtering (ISO 8601 format, e.g. 2024-12-31T23:59:59Z). |
| `page` | integer | no | Page number for pagination (default 0). |
| `page_size` | integer | no | Number of results per page (default 30, max 100). |

### Example

```lua
local result = app.integrations.sinch.sinch_list_messages({
  direction = "mt"
  page = 0
  page_size = 30
})
```

## sinch_send_sms

Send an SMS message to one or more recipients via Sinch. Requires sender phone number, recipient(s), and message body.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `from` | string | yes | Sender phone number or alphanumeric sender ID (E.164 format for numbers). |
| `to` | array | yes | Array of recipient phone numbers in E.164 format (e.g. ["+1234567890"]). |
| `body` | string | yes | The SMS message body text. |
| `delivery_report` | string | no | Delivery report type: "none", "summary", or "full" (default "none"). |
| `expire_at` | string | no | Message expiration time in ISO 8601 format. |
| `send_at` | string | no | Scheduled send time in ISO 8601 format. |

### Example

```lua
local result = app.integrations.sinch.sinch_send_sms({
  from = "+1234567890"
  to = {"+1987654321"}
  body = "Hello from Sinch!"
})
```

## sinch_list_phone_numbers

List all rented phone numbers in your Sinch account with pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default 0). |
| `page_size` | integer | no | Number of results per page (default 30, max 100). |

### Example

```lua
local result = app.integrations.sinch.sinch_list_phone_numbers({
  page = 0
  page_size = 30
})
```

## sinch_get_phone_number

Get details for a specific phone number in your Sinch account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `phone_number` | string | yes | The phone number to look up (E.164 format, e.g. "+1234567890"). |

### Example

```lua
local result = app.integrations.sinch.sinch_get_phone_number({
  phone_number = "+1234567890"
})
```

## sinch_list_groups

List all groups in your Sinch account with pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default 0). |
| `page_size` | integer | no | Number of results per page (default 30, max 100). |

### Example

```lua
local result = app.integrations.sinch.sinch_list_groups({
  page = 0
  page_size = 30
})
```

## sinch_get_group

Get details for a specific group in your Sinch account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `group_id` | string | yes | The unique identifier of the group. |

### Example

```lua
local result = app.integrations.sinch.sinch_get_group({
  group_id = "group_abc123"
})
```

## sinch_list_batches

List all message batches in your Sinch account with pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default 0). |
| `page_size` | integer | no | Number of results per page (default 30, max 100). |

### Example

```lua
local result = app.integrations.sinch.sinch_list_batches({
  page = 0
  page_size = 30
})
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.sinch.function_name({...})

-- Explicit default (portable across setups)
app.integrations.sinch.default.function_name({...})

-- Named accounts
app.integrations.sinch.work.function_name({...})
app.integrations.sinch.personal.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.sinch.sinch_get_group({
  group_id = "example_group_id"
})
print(result)

Functions

sinch_get_group

Get details for a specific group in your Sinch account.

Operation
Read read
Full name
sinch.sinch_get_group
ParameterTypeRequiredDescription
group_id string yes The unique identifier of the group.

sinch_get_phone_number

Get details for a specific phone number in your Sinch account.

Operation
Read read
Full name
sinch.sinch_get_phone_number
ParameterTypeRequiredDescription
phone_number string yes The phone number to look up (E.164 format, e.g. "+1234567890").

sinch_list_batches

List all message batches in your Sinch account with pagination.

Operation
Read read
Full name
sinch.sinch_list_batches
ParameterTypeRequiredDescription
page integer no Page number for pagination (default 0).
page_size integer no Number of results per page (default 30, max 100).

sinch_list_groups

List all groups in your Sinch account with pagination.

Operation
Read read
Full name
sinch.sinch_list_groups
ParameterTypeRequiredDescription
page integer no Page number for pagination (default 0).
page_size integer no Number of results per page (default 30, max 100).

sinch_list_messages

List inbound and outbound SMS messages from Sinch. Supports filtering by direction, recipient, sender, and date range.

Operation
Read read
Full name
sinch.sinch_list_messages
ParameterTypeRequiredDescription
direction string no Filter by direction: "mt" (mobile terminated / outbound) or "mo" (mobile originated / inbound).
to string no Filter by destination phone number (E.164 format).
from string no Filter by originating phone number or sender (E.164 format).
start_date string no Start date for filtering (ISO 8601 format, e.g. 2024-01-01T00:00:00Z).
end_date string no End date for filtering (ISO 8601 format, e.g. 2024-12-31T23:59:59Z).
page integer no Page number for pagination (default 0).
page_size integer no Number of results per page (default 30, max 100).

sinch_list_phone_numbers

List all rented phone numbers in your Sinch account with pagination.

Operation
Read read
Full name
sinch.sinch_list_phone_numbers
ParameterTypeRequiredDescription
page integer no Page number for pagination (default 0).
page_size integer no Number of results per page (default 30, max 100).

sinch_send_sms

Send an SMS message to one or more recipients via Sinch. Requires sender phone number, recipient(s), and message body.

Operation
Write write
Full name
sinch.sinch_send_sms
ParameterTypeRequiredDescription
from string yes Sender phone number or alphanumeric sender ID (E.164 format for numbers).
to array yes Array of recipient phone numbers in E.164 format (e.g. ["+1234567890"]).
body string yes The SMS message body text.
delivery_report string no Delivery report type: "none", "summary", or "full" (default "none").
expire_at string no Message expiration time in ISO 8601 format.
send_at string no Scheduled send time in ISO 8601 format.