KosmoKrator

communication

Missive Lua API for KosmoKrator Agents

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

6 functions 4 read 2 write Bearer token auth

Lua Namespace

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

Missive — Lua API Reference

list_conversations

List conversations from Missive with optional filters and pagination.

Parameters

NameTypeRequiredDescription
inboxstringnoFilter by inbox ID
assigneestringnoFilter by assignee user ID or email
statestringnoFilter by state: "open", "closed", or "spam"
limitintegernoMax results (default: 25, max: 100)
offsetintegernoOffset for pagination

Examples

-- List open conversations
local result = app.integrations.missive.list_conversations({
  state = "open",
  limit = 10
})

for _, conv in ipairs(result.conversations) do
  print(conv.subject .. " - " .. conv.state)
end
-- List conversations assigned to a specific user
local result = app.integrations.missive.list_conversations({
  assignee = "[email protected]",
  state = "open"
})

get_conversation

Get a single conversation by ID, including messages and metadata.

Parameters

NameTypeRequiredDescription
idstringyesThe conversation UUID

Example

local result = app.integrations.missive.get_conversation({
  id = "abc123-def456-..."
})

print(result.conversation.subject)
for _, msg in ipairs(result.conversation.messages) do
  print(msg.from .. ": " .. msg.body)
end

create_comment

Add a comment to a Missive conversation. Use this for internal notes or replies.

Parameters

NameTypeRequiredDescription
conversation_idstringyesThe UUID of the conversation
bodystringyesComment body text (supports Markdown)
assigneesarraynoList of user IDs or emails to assign

Example

local result = app.integrations.missive.create_comment({
  conversation_id = "abc123-def456-...",
  body = "Reviewed the proposal — approved. Ready to proceed.",
  assignees = {"[email protected]"}
})

list_tasks

List tasks from Missive with optional filters and pagination.

Parameters

NameTypeRequiredDescription
statestringnoFilter by state: "open" or "completed"
assigneestringnoFilter by assignee user ID or email
limitintegernoMax results (default: 25, max: 100)
offsetintegernoOffset for pagination

Examples

-- List open tasks
local result = app.integrations.missive.list_tasks({
  state = "open"
})

for _, task in ipairs(result.tasks) do
  print(task.title .. " (due: " .. (task.due_date or "no date") .. ")")
end
-- List completed tasks for a user
local result = app.integrations.missive.list_tasks({
  state = "completed",
  assignee = "[email protected]",
  limit = 20
})

create_task

Create a new task in Missive.

Parameters

NameTypeRequiredDescription
titlestringyesThe task title
descriptionstringnoDetailed description (supports Markdown)
assigneestringnoUser ID or email to assign the task to
due_datestringnoDue date in ISO 8601 format (e.g., "2025-12-31")

Example

local result = app.integrations.missive.create_task({
  title = "Follow up with client",
  description = "Reply to the pricing inquiry from the conversation thread.",
  assignee = "[email protected]",
  due_date = "2025-12-31"
})

print("Created task: " .. result.task.id)

get_current_user

Get the profile of the currently authenticated Missive user.

Parameters

None.

Example

local result = app.integrations.missive.get_current_user({})

print("Logged in as: " .. result.user.name .. " (" .. result.user.email .. ")")

Multi-Account Usage

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

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

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

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

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

Raw agent markdown
# Missive — Lua API Reference

## list_conversations

List conversations from Missive with optional filters and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `inbox` | string | no | Filter by inbox ID |
| `assignee` | string | no | Filter by assignee user ID or email |
| `state` | string | no | Filter by state: `"open"`, `"closed"`, or `"spam"` |
| `limit` | integer | no | Max results (default: 25, max: 100) |
| `offset` | integer | no | Offset for pagination |

### Examples

```lua
-- List open conversations
local result = app.integrations.missive.list_conversations({
  state = "open",
  limit = 10
})

for _, conv in ipairs(result.conversations) do
  print(conv.subject .. " - " .. conv.state)
end
```

```lua
-- List conversations assigned to a specific user
local result = app.integrations.missive.list_conversations({
  assignee = "[email protected]",
  state = "open"
})
```

---

## get_conversation

Get a single conversation by ID, including messages and metadata.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The conversation UUID |

### Example

```lua
local result = app.integrations.missive.get_conversation({
  id = "abc123-def456-..."
})

print(result.conversation.subject)
for _, msg in ipairs(result.conversation.messages) do
  print(msg.from .. ": " .. msg.body)
end
```

---

## create_comment

Add a comment to a Missive conversation. Use this for internal notes or replies.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `conversation_id` | string | yes | The UUID of the conversation |
| `body` | string | yes | Comment body text (supports Markdown) |
| `assignees` | array | no | List of user IDs or emails to assign |

### Example

```lua
local result = app.integrations.missive.create_comment({
  conversation_id = "abc123-def456-...",
  body = "Reviewed the proposal — approved. Ready to proceed.",
  assignees = {"[email protected]"}
})
```

---

## list_tasks

List tasks from Missive with optional filters and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `state` | string | no | Filter by state: `"open"` or `"completed"` |
| `assignee` | string | no | Filter by assignee user ID or email |
| `limit` | integer | no | Max results (default: 25, max: 100) |
| `offset` | integer | no | Offset for pagination |

### Examples

```lua
-- List open tasks
local result = app.integrations.missive.list_tasks({
  state = "open"
})

for _, task in ipairs(result.tasks) do
  print(task.title .. " (due: " .. (task.due_date or "no date") .. ")")
end
```

```lua
-- List completed tasks for a user
local result = app.integrations.missive.list_tasks({
  state = "completed",
  assignee = "[email protected]",
  limit = 20
})
```

---

## create_task

Create a new task in Missive.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | The task title |
| `description` | string | no | Detailed description (supports Markdown) |
| `assignee` | string | no | User ID or email to assign the task to |
| `due_date` | string | no | Due date in ISO 8601 format (e.g., `"2025-12-31"`) |

### Example

```lua
local result = app.integrations.missive.create_task({
  title = "Follow up with client",
  description = "Reply to the pricing inquiry from the conversation thread.",
  assignee = "[email protected]",
  due_date = "2025-12-31"
})

print("Created task: " .. result.task.id)
```

---

## get_current_user

Get the profile of the currently authenticated Missive user.

### Parameters

None.

### Example

```lua
local result = app.integrations.missive.get_current_user({})

print("Logged in as: " .. result.user.name .. " (" .. result.user.email .. ")")
```

---

## Multi-Account Usage

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

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

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

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

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

Metadata-Derived Lua Example

local result = app.integrations.missive.missive_list_conversations({
  inbox = "example_inbox",
  assignee = "example_assignee",
  state = "example_state",
  limit = 1,
  offset = 1
})
print(result)

Functions

missive_list_conversations

List conversations from Missive. Supports filtering by inbox, assignee, and state. Returns paginated results.

Operation
Read read
Full name
missive.missive_list_conversations
ParameterTypeRequiredDescription
inbox string no Filter by inbox ID.
assignee string no Filter by assignee user ID or email.
state string no Filter by conversation state: "open", "closed", or "spam".
limit integer no Maximum number of conversations to return (default: 25, max: 100).
offset integer no Offset for pagination.

missive_get_conversation

Get a single Missive conversation by ID, including messages and metadata.

Operation
Read read
Full name
missive.missive_get_conversation
ParameterTypeRequiredDescription
id string yes The conversation UUID.

missive_create_comment

Create a comment on a Missive conversation. Use this to add internal notes or replies.

Operation
Write write
Full name
missive.missive_create_comment
ParameterTypeRequiredDescription
conversation_id string yes The UUID of the conversation to comment on.
body string yes The comment body text. Supports Markdown.
assignees array no List of user IDs or emails to assign the comment to.

missive_list_tasks

List tasks from Missive. Supports filtering by state and assignee. Returns paginated results.

Operation
Read read
Full name
missive.missive_list_tasks
ParameterTypeRequiredDescription
state string no Filter by task state: "open" or "completed".
assignee string no Filter by assignee user ID or email.
limit integer no Maximum number of tasks to return (default: 25, max: 100).
offset integer no Offset for pagination.

missive_create_task

Create a new task in Missive. Requires a title. Optionally set description, assignee, and due date.

Operation
Write write
Full name
missive.missive_create_task
ParameterTypeRequiredDescription
title string yes The task title.
description string no Detailed description of the task. Supports Markdown.
assignee string no User ID or email of the person to assign the task to.
due_date string no Due date in ISO 8601 format (e.g., "2025-12-31").

missive_get_current_user

Get the profile of the currently authenticated Missive user, including name, email, and organization info.

Operation
Read read
Full name
missive.missive_get_current_user
ParameterTypeRequiredDescription
No parameters.