KosmoKrator

developer

Svix Lua API for KosmoKrator Agents

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

7 functions 5 read 2 write API token auth

Lua Namespace

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

Svix — Lua API Reference

list_applications

List all Svix applications.

Parameters

NameTypeRequiredDescription
limitintegernoMax results (default: 50, max: 250)
iteratorstringnoPagination cursor from a previous response

Example

local result = app.integrations.svix.list_applications({ limit = 50 })

for _, app in ipairs(result.data) do
  print(app.name .. " (" .. app.id .. ")")
end

get_application

Get details of a specific Svix application.

Parameters

NameTypeRequiredDescription
idstringyesThe application ID (e.g., "app_xxxxxxxxx")

Example

local result = app.integrations.svix.get_application({ id = "app_xxxxxxxxx" })
print("Name: " .. result.name)
print("UID: " .. (result.uid or "none"))
print("Created: " .. result.created_at)

create_application

Create a new Svix application.

Parameters

NameTypeRequiredDescription
namestringyesApplication name (e.g., "My App")
uidstringnoOptional unique identifier

Example

local result = app.integrations.svix.create_application({
  name = "My New App",
  uid = "my-app-unique-id"
})
print("Created app: " .. result.id)

list_messages

List messages for a Svix application.

Parameters

NameTypeRequiredDescription
app_idstringyesThe application ID
limitintegernoMax results (default: 50, max: 250)
iteratorstringnoPagination cursor from a previous response

Example

local result = app.integrations.svix.list_messages({
  app_id = "app_xxxxxxxxx",
  limit = 25
})

for _, msg in ipairs(result.data) do
  print(msg.event_type .. " -> " .. msg.id)
end

list_endpoints

List webhook endpoints for a Svix application.

Parameters

NameTypeRequiredDescription
app_idstringyesThe application ID
limitintegernoMax results (default: 50, max: 250)
iteratorstringnoPagination cursor from a previous response

Example

local result = app.integrations.svix.list_endpoints({
  app_id = "app_xxxxxxxxx"
})

for _, ep in ipairs(result.data) do
  print(ep.url .. " (" .. ep.id .. ")")
end

create_endpoint

Create a new webhook endpoint for a Svix application.

Parameters

NameTypeRequiredDescription
app_idstringyesThe application ID
urlstringyesThe webhook URL (e.g., "https://example.com/webhooks")
versionintegeryesAPI version for the endpoint (e.g., 1)
descriptionstringnoOptional endpoint description

Example

local result = app.integrations.svix.create_endpoint({
  app_id = "app_xxxxxxxxx",
  url = "https://example.com/webhooks",
  version = 1,
  description = "Production webhook receiver"
})
print("Created endpoint: " .. result.id)

get_current_user

Get the current authenticated Svix user and dashboard usage information.

Parameters

None.

Example

local result = app.integrations.svix.get_current_user({})
print("User: " .. result.email)
print("Message count: " .. result.message_count)

Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.svix.production.function_name({...})
app.integrations.svix.staging.function_name({...})

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

Raw agent markdown
# Svix — Lua API Reference

## list_applications

List all Svix applications.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Max results (default: 50, max: 250) |
| `iterator` | string | no | Pagination cursor from a previous response |

### Example

```lua
local result = app.integrations.svix.list_applications({ limit = 50 })

for _, app in ipairs(result.data) do
  print(app.name .. " (" .. app.id .. ")")
end
```

---

## get_application

Get details of a specific Svix application.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The application ID (e.g., `"app_xxxxxxxxx"`) |

### Example

```lua
local result = app.integrations.svix.get_application({ id = "app_xxxxxxxxx" })
print("Name: " .. result.name)
print("UID: " .. (result.uid or "none"))
print("Created: " .. result.created_at)
```

---

## create_application

Create a new Svix application.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | string | yes | Application name (e.g., `"My App"`) |
| `uid` | string | no | Optional unique identifier |

### Example

```lua
local result = app.integrations.svix.create_application({
  name = "My New App",
  uid = "my-app-unique-id"
})
print("Created app: " .. result.id)
```

---

## list_messages

List messages for a Svix application.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `app_id` | string | yes | The application ID |
| `limit` | integer | no | Max results (default: 50, max: 250) |
| `iterator` | string | no | Pagination cursor from a previous response |

### Example

```lua
local result = app.integrations.svix.list_messages({
  app_id = "app_xxxxxxxxx",
  limit = 25
})

for _, msg in ipairs(result.data) do
  print(msg.event_type .. " -> " .. msg.id)
end
```

---

## list_endpoints

List webhook endpoints for a Svix application.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `app_id` | string | yes | The application ID |
| `limit` | integer | no | Max results (default: 50, max: 250) |
| `iterator` | string | no | Pagination cursor from a previous response |

### Example

```lua
local result = app.integrations.svix.list_endpoints({
  app_id = "app_xxxxxxxxx"
})

for _, ep in ipairs(result.data) do
  print(ep.url .. " (" .. ep.id .. ")")
end
```

---

## create_endpoint

Create a new webhook endpoint for a Svix application.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `app_id` | string | yes | The application ID |
| `url` | string | yes | The webhook URL (e.g., `"https://example.com/webhooks"`) |
| `version` | integer | yes | API version for the endpoint (e.g., `1`) |
| `description` | string | no | Optional endpoint description |

### Example

```lua
local result = app.integrations.svix.create_endpoint({
  app_id = "app_xxxxxxxxx",
  url = "https://example.com/webhooks",
  version = 1,
  description = "Production webhook receiver"
})
print("Created endpoint: " .. result.id)
```

---

## get_current_user

Get the current authenticated Svix user and dashboard usage information.

### Parameters

None.

### Example

```lua
local result = app.integrations.svix.get_current_user({})
print("User: " .. result.email)
print("Message count: " .. result.message_count)
```

---

## Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.svix.production.function_name({...})
app.integrations.svix.staging.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.svix.svix_list_applications({
  limit = 1,
  iterator = "example_iterator"
})
print(result)

Functions

svix_list_applications

List all Svix applications. Returns application IDs, names, and UIDs that you can use to manage endpoints and messages.

Operation
Read read
Full name
svix.svix_list_applications
ParameterTypeRequiredDescription
limit integer no Maximum number of applications to return (default: 50, max: 250).
iterator string no Cursor for pagination — pass the iterator value from a previous response to get the next page.

svix_get_application

Get details of a specific Svix application by its ID, including name, UID, and created timestamp.

Operation
Read read
Full name
svix.svix_get_application
ParameterTypeRequiredDescription
id string yes The application ID (e.g., "app_xxxxxxxxx").

svix_create_application

Create a new Svix application. Each application represents a webhook sender with its own set of endpoints.

Operation
Write write
Full name
svix.svix_create_application
ParameterTypeRequiredDescription
name string yes The application name (e.g., "My App").
uid string no Optional unique identifier for the application. Must be unique across all applications.

svix_list_messages

List messages for a Svix application. Returns message IDs, event types, payloads, and delivery status.

Operation
Read read
Full name
svix.svix_list_messages
ParameterTypeRequiredDescription
app_id string yes The application ID (e.g., "app_xxxxxxxxx").
limit integer no Maximum number of messages to return (default: 50, max: 250).
iterator string no Cursor for pagination — pass the iterator value from a previous response to get the next page.

svix_list_endpoints

List webhook endpoints for a Svix application. Returns endpoint IDs, URLs, and descriptions.

Operation
Read read
Full name
svix.svix_list_endpoints
ParameterTypeRequiredDescription
app_id string yes The application ID (e.g., "app_xxxxxxxxx").
limit integer no Maximum number of endpoints to return (default: 50, max: 250).
iterator string no Cursor for pagination — pass the iterator value from a previous response to get the next page.

svix_create_endpoint

Create a new webhook endpoint for a Svix application. Webhook events will be delivered to the specified URL.

Operation
Write write
Full name
svix.svix_create_endpoint
ParameterTypeRequiredDescription
app_id string yes The application ID (e.g., "app_xxxxxxxxx").
url string yes The URL where webhook events will be delivered (e.g., "https://example.com/webhooks").
version integer yes The API version for the endpoint (e.g., 1).
description string no Optional description for the endpoint.

svix_get_current_user

Get the current authenticated Svix user and dashboard usage information.

Operation
Read read
Full name
svix.svix_get_current_user
ParameterTypeRequiredDescription
No parameters.