KosmoKrator

email

EmailOctopus Lua API for KosmoKrator Agents

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

6 functions 5 read 1 write API key auth

Lua Namespace

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

EmailOctopus Lua API Reference

Overview

The EmailOctopus integration provides tools for managing contacts, viewing campaigns, and accessing account information via the EmailOctopus API.

All tools are available under the emailoctopus_ namespace.


Tools

emailoctopus_list_contacts

List contacts in an EmailOctopus mailing list.

Parameters:

ParameterTypeRequiredDescription
list_idstringNoList ID to query. Uses default configured list if omitted.
limitintegerNoMax contacts to return (default: 100, max: 100).
beforestringNoPagination cursor — contact ID to paginate before.
afterstringNoPagination cursor — contact ID to paginate after.

Example:

app.integrations["email-octopus"].work.emailoctopus_list_contacts({
    limit = 25,
})

emailoctopus_get_contact

Get details of a specific contact.

Parameters:

ParameterTypeRequiredDescription
contact_idstringYesThe contact ID to retrieve.
list_idstringNoThe list ID. Uses default configured list if omitted.

Example:

app.integrations["email-octopus"].work.emailoctopus_get_contact({
    contact_id = "cntg_abc123",
})

emailoctopus_create_contact

Add a new contact to a mailing list.

Parameters:

ParameterTypeRequiredDescription
email_addressstringYesThe contact’s email address.
list_idstringNoList ID. Uses default configured list if omitted.
first_namestringNoThe contact’s first name.
last_namestringNoThe contact’s last name.

Example:

app.integrations["email-octopus"].work.emailoctopus_create_contact({
    email_address = "[email protected]",
    first_name = "Jane",
    last_name = "Doe",
})

emailoctopus_list_campaigns

List all email campaigns.

Parameters:

ParameterTypeRequiredDescription
limitintegerNoMax campaigns to return (default: 100, max: 100).
beforestringNoPagination cursor.
afterstringNoPagination cursor.

Example:

app.integrations["email-octopus"].work.emailoctopus_list_campaigns({})

emailoctopus_get_campaign

Get details of a specific campaign.

Parameters:

ParameterTypeRequiredDescription
campaign_idstringYesThe campaign ID.

Example:

app.integrations["email-octopus"].work.emailoctopus_get_campaign({
    campaign_id = "cmpn_abc123",
})

emailoctopus_get_current_user

Get the authenticated account details.

Parameters: None

Example:

app.integrations["email-octopus"].work.emailoctopus_get_current_user({})

Multi-Account Usage

When multiple EmailOctopus accounts are configured, specify the account namespace:

app.integrations["email-octopus"].marketing.emailoctopus_list_contacts({})
app.integrations["email-octopus"].newsletter.emailoctopus_create_contact({
    email_address = "[email protected]",
})
Raw agent markdown
# EmailOctopus Lua API Reference

## Overview

The EmailOctopus integration provides tools for managing contacts, viewing campaigns, and accessing account information via the EmailOctopus API.

All tools are available under the `emailoctopus_` namespace.

---

## Tools

### `emailoctopus_list_contacts`

List contacts in an EmailOctopus mailing list.

**Parameters:**

| Parameter  | Type    | Required | Description                                          |
|------------|---------|----------|------------------------------------------------------|
| `list_id`  | string  | No       | List ID to query. Uses default configured list if omitted. |
| `limit`    | integer | No       | Max contacts to return (default: 100, max: 100).     |
| `before`   | string  | No       | Pagination cursor — contact ID to paginate before.   |
| `after`    | string  | No       | Pagination cursor — contact ID to paginate after.    |

**Example:**

```lua
app.integrations["email-octopus"].work.emailoctopus_list_contacts({
    limit = 25,
})
```

---

### `emailoctopus_get_contact`

Get details of a specific contact.

**Parameters:**

| Parameter     | Type   | Required | Description                                          |
|---------------|--------|----------|------------------------------------------------------|
| `contact_id`  | string | Yes      | The contact ID to retrieve.                          |
| `list_id`     | string | No       | The list ID. Uses default configured list if omitted.|

**Example:**

```lua
app.integrations["email-octopus"].work.emailoctopus_get_contact({
    contact_id = "cntg_abc123",
})
```

---

### `emailoctopus_create_contact`

Add a new contact to a mailing list.

**Parameters:**

| Parameter       | Type   | Required | Description                                          |
|-----------------|--------|----------|------------------------------------------------------|
| `email_address` | string | Yes      | The contact's email address.                         |
| `list_id`       | string | No       | List ID. Uses default configured list if omitted.    |
| `first_name`    | string | No       | The contact's first name.                            |
| `last_name`     | string | No       | The contact's last name.                             |

**Example:**

```lua
app.integrations["email-octopus"].work.emailoctopus_create_contact({
    email_address = "[email protected]",
    first_name = "Jane",
    last_name = "Doe",
})
```

---

### `emailoctopus_list_campaigns`

List all email campaigns.

**Parameters:**

| Parameter | Type    | Required | Description                                       |
|-----------|---------|----------|---------------------------------------------------|
| `limit`   | integer | No       | Max campaigns to return (default: 100, max: 100). |
| `before`  | string  | No       | Pagination cursor.                                |
| `after`   | string  | No       | Pagination cursor.                                |

**Example:**

```lua
app.integrations["email-octopus"].work.emailoctopus_list_campaigns({})
```

---

### `emailoctopus_get_campaign`

Get details of a specific campaign.

**Parameters:**

| Parameter      | Type   | Required | Description              |
|----------------|--------|----------|--------------------------|
| `campaign_id`  | string | Yes      | The campaign ID.         |

**Example:**

```lua
app.integrations["email-octopus"].work.emailoctopus_get_campaign({
    campaign_id = "cmpn_abc123",
})
```

---

### `emailoctopus_get_current_user`

Get the authenticated account details.

**Parameters:** None

**Example:**

```lua
app.integrations["email-octopus"].work.emailoctopus_get_current_user({})
```

---

## Multi-Account Usage

When multiple EmailOctopus accounts are configured, specify the account namespace:

```lua
app.integrations["email-octopus"].marketing.emailoctopus_list_contacts({})
app.integrations["email-octopus"].newsletter.emailoctopus_create_contact({
    email_address = "[email protected]",
})
```

Metadata-Derived Lua Example

local result = app.integrations.email_octopus.emailoctopus_list_contacts({
  list_id = "example_list_id",
  limit = 1,
  before = "example_before",
  after = "example_after"
})
print(result)

Functions

emailoctopus_list_contacts

List contacts in an EmailOctopus mailing list. Returns contact email addresses, statuses, and pagination cursors.

Operation
Read read
Full name
email-octopus.emailoctopus_list_contacts
ParameterTypeRequiredDescription
list_id string no The list ID to query. Uses the default configured list if omitted.
limit integer no Maximum number of contacts to return (default: 100, max: 100).
before string no Cursor for pagination — contact ID to paginate before.
after string no Cursor for pagination — contact ID to paginate after.

emailoctopus_get_contact

Get details of a specific contact in an EmailOctopus mailing list, including email address, status, and custom fields.

Operation
Read read
Full name
email-octopus.emailoctopus_get_contact
ParameterTypeRequiredDescription
contact_id string yes The contact ID to retrieve.
list_id string no The list ID the contact belongs to. Uses the default configured list if omitted.

emailoctopus_create_contact

Add a new contact to an EmailOctopus mailing list. Requires an email address.

Operation
Write write
Full name
email-octopus.emailoctopus_create_contact
ParameterTypeRequiredDescription
email_address string yes The contact's email address.
list_id string no The list ID to add the contact to. Uses the default configured list if omitted.
first_name string no The contact's first name.
last_name string no The contact's last name.

emailoctopus_list_campaigns

List all email campaigns in your EmailOctopus account, including their status, subject, and send dates.

Operation
Read read
Full name
email-octopus.emailoctopus_list_campaigns
ParameterTypeRequiredDescription
limit integer no Maximum number of campaigns to return (default: 100, max: 100).
before string no Cursor for pagination — campaign ID to paginate before.
after string no Cursor for pagination — campaign ID to paginate after.

emailoctopus_get_campaign

Get details of a specific EmailOctopus campaign, including status, subject, content, and delivery statistics.

Operation
Read read
Full name
email-octopus.emailoctopus_get_campaign
ParameterTypeRequiredDescription
campaign_id string yes The campaign ID to retrieve.

emailoctopus_get_current_user

Get the authenticated EmailOctopus account details, including name and email address.

Operation
Read read
Full name
email-octopus.emailoctopus_get_current_user
ParameterTypeRequiredDescription
No parameters.