KosmoKrator

notifications

Pushover Lua API for KosmoKrator Agents

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

3 functions 2 read 1 write API key auth

Lua Namespace

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

Pushover — Lua API Reference

send_message

Send a push notification via Pushover.

Parameters

NameTypeRequiredDescription
messagestringyesThe notification message body
titlestringnoOptional title for the notification
priorityintegernoMessage priority (see table below)
urlstringnoSupplementary URL to include
url_titlestringnoTitle for the supplementary URL
soundstringnoNotification sound name (use list_sounds to discover)
devicestringnoSpecific device name to target (omit for all devices)
timestampintegernoUnix timestamp for scheduled delivery
expireintegernoSeconds until emergency messages expire (max 10800)
retryintegernoSeconds between retries for emergency messages (min 30)

Priority Levels

PriorityNameBehavior
-2No notificationNo alert at all
-1QuietDelivered silently
0NormalDefault priority
1HighBypasses quiet hours
2EmergencyRequires acknowledgment; expire and retry are required

Emergency Priority

When using priority 2, you must also provide:

  • retry — seconds between re-alerts (minimum 30)
  • expire — seconds until the alert expires (maximum 10800)

Examples

Simple message

local result = app.integrations.pushover.send_message({
  message = "Deployment complete for example.com"
})

print(result.status) -- "sent"

Message with title and priority

local result = app.integrations.pushover.send_message({
  message = "Server CPU usage above 90%",
  title = "Server Alert",
  priority = 1
})

Emergency alert with retry

local result = app.integrations.pushover.send_message({
  message = "Database is unreachable!",
  title = "CRITICAL",
  priority = 2,
  retry = 60,
  expire = 3600
})

Message with URL and custom sound

local result = app.integrations.pushover.send_message({
  message = "New order received!",
  title = "Order #1234",
  sound = "cashregister",
  url = "https://example.com/orders/1234",
  url_title = "View Order"
})

list_sounds

List available notification sounds in Pushover.

Parameters

No parameters required.

Example

local result = app.integrations.pushover.list_sounds()

for name, label in pairs(result.sounds) do
  print(name .. " — " .. label)
end
-- pushover — Pushover (default)
-- bike — Bike
-- bugle — Bugle
-- cashregister — Cash Register
-- ...

get_current_user

Validate the current Pushover user credentials and retrieve account information.

Parameters

No parameters required.

Response Fields

FieldTypeDescription
validbooleanWhether the credentials are valid
devicesarrayList of registered device names
licensestring or nullLicense information

Example

local result = app.integrations.pushover.get_current_user()

print("Valid: " .. tostring(result.valid))
print("Devices: " .. table.concat(result.devices, ", "))

Multi-Account Usage

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

-- Default account (always works)
app.integrations.pushover.send_message({ message = "Hello" })

-- Explicit default (portable across setups)
app.integrations.pushover.default.send_message({ message = "Hello" })

-- Named accounts
app.integrations.pushover.work.send_message({ message = "Work alert" })
app.integrations.pushover.personal.send_message({ message = "Personal note" })

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

Raw agent markdown
# Pushover — Lua API Reference

## send_message

Send a push notification via Pushover.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `message` | string | yes | The notification message body |
| `title` | string | no | Optional title for the notification |
| `priority` | integer | no | Message priority (see table below) |
| `url` | string | no | Supplementary URL to include |
| `url_title` | string | no | Title for the supplementary URL |
| `sound` | string | no | Notification sound name (use `list_sounds` to discover) |
| `device` | string | no | Specific device name to target (omit for all devices) |
| `timestamp` | integer | no | Unix timestamp for scheduled delivery |
| `expire` | integer | no | Seconds until emergency messages expire (max 10800) |
| `retry` | integer | no | Seconds between retries for emergency messages (min 30) |

### Priority Levels

| Priority | Name | Behavior |
|----------|------|----------|
| -2 | No notification | No alert at all |
| -1 | Quiet | Delivered silently |
| 0 | Normal | Default priority |
| 1 | High | Bypasses quiet hours |
| 2 | Emergency | Requires acknowledgment; `expire` and `retry` are required |

### Emergency Priority

When using priority `2`, you **must** also provide:
- `retry` — seconds between re-alerts (minimum 30)
- `expire` — seconds until the alert expires (maximum 10800)

### Examples

#### Simple message

```lua
local result = app.integrations.pushover.send_message({
  message = "Deployment complete for example.com"
})

print(result.status) -- "sent"
```

#### Message with title and priority

```lua
local result = app.integrations.pushover.send_message({
  message = "Server CPU usage above 90%",
  title = "Server Alert",
  priority = 1
})
```

#### Emergency alert with retry

```lua
local result = app.integrations.pushover.send_message({
  message = "Database is unreachable!",
  title = "CRITICAL",
  priority = 2,
  retry = 60,
  expire = 3600
})
```

#### Message with URL and custom sound

```lua
local result = app.integrations.pushover.send_message({
  message = "New order received!",
  title = "Order #1234",
  sound = "cashregister",
  url = "https://example.com/orders/1234",
  url_title = "View Order"
})
```

---

## list_sounds

List available notification sounds in Pushover.

### Parameters

No parameters required.

### Example

```lua
local result = app.integrations.pushover.list_sounds()

for name, label in pairs(result.sounds) do
  print(name .. " — " .. label)
end
-- pushover — Pushover (default)
-- bike — Bike
-- bugle — Bugle
-- cashregister — Cash Register
-- ...
```

---

## get_current_user

Validate the current Pushover user credentials and retrieve account information.

### Parameters

No parameters required.

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `valid` | boolean | Whether the credentials are valid |
| `devices` | array | List of registered device names |
| `license` | string or null | License information |

### Example

```lua
local result = app.integrations.pushover.get_current_user()

print("Valid: " .. tostring(result.valid))
print("Devices: " .. table.concat(result.devices, ", "))
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.pushover.send_message({ message = "Hello" })

-- Explicit default (portable across setups)
app.integrations.pushover.default.send_message({ message = "Hello" })

-- Named accounts
app.integrations.pushover.work.send_message({ message = "Work alert" })
app.integrations.pushover.personal.send_message({ message = "Personal note" })
```

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

Metadata-Derived Lua Example

local result = app.integrations.pushover.pushover_send_message({
  message = "example_message",
  title = "example_title",
  priority = 1,
  url = "example_url",
  url_title = "example_url_title",
  sound = "example_sound",
  device = "example_device",
  timestamp = 1
})
print(result)

Functions

pushover_send_message

Send a push notification via Pushover. Supports message, title, priority levels, and optional URL/sound attachments.

Operation
Write write
Full name
pushover.pushover_send_message
ParameterTypeRequiredDescription
message string yes The notification message body.
title string no Optional title for the notification.
priority integer no Message priority: -2 = no notification/alert, -1 = quiet notification, 0 = normal (default), 1 = high priority (bypasses quiet hours), 2 = emergency (requires acknowledgment).
url string no A supplementary URL to include with the notification.
url_title string no Title for the supplementary URL.
sound string no Notification sound name (e.g., "pushover", "bike", "echo"). Use the list_sounds tool to see available options.
device string no Specific device name to send to. Omit to send to all devices.
timestamp integer no Unix timestamp to schedule the message delivery.
expire integer no Seconds until emergency-priority (2) messages expire (max 10800).
retry integer no Seconds between retries for emergency-priority (2) messages (min 30).

pushover_list_sounds

List available notification sounds in Pushover. Use sound names with the send_message tool.

Operation
Read read
Full name
pushover.pushover_list_sounds
ParameterTypeRequiredDescription
No parameters.

pushover_get_current_user

Validate the Pushover user credentials and retrieve account information.

Operation
Read read
Full name
pushover.pushover_get_current_user
ParameterTypeRequiredDescription
No parameters.