KosmoKrator

productivity

Vero Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.vero.*. Use lua_read_doc("integrations.vero") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Vero workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.vero.get_current_user({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("vero"))' --json
kosmo integrations:lua --eval 'print(docs.read("vero.get_current_user"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local vero = app.integrations.vero
local result = vero.get_current_user({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.vero, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.vero.default.* or app.integrations.vero.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Vero, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Vero Lua API Reference

Namespace: app.integrations.vero

Vero tools wrap the Track REST API at https://api.getvero.com/api/v2. The integration adds auth_token automatically as a query parameter.

Users

identify_user

Creates or updates a user via POST /users/track.

app.integrations.vero.identify_user({
  id = "usr_123",
  email = "person@example.test",
  name = "Example User",
  data = {
    plan = "premium",
    signup_date = "2026-05-01"
  }
})

Optional channels may include Vero channel objects, for example push tokens with type, address, and platform.

update_user

Compatibility helper for profile updates. It also uses POST /users/track.

app.integrations.vero.update_user({
  id = "usr_123",
  data = {
    plan = "enterprise"
  }
})

alias_user

Changes a user’s identifier via PUT /users/reidentify. This merges identities, so use it only when that merge is intended.

app.integrations.vero.alias_user({
  id = "anonymous_123",
  new_id = "usr_123"
})

unsubscribe / resubscribe

app.integrations.vero.unsubscribe({ id = "usr_123" })
app.integrations.vero.resubscribe({ id = "usr_123" })

delete_user

Deletes the user profile and activity. Deleted users are not recoverable in Vero.

app.integrations.vero.delete_user({
  id = "usr_123"
})

Tags

edit_tags

Adds and removes tags in one call via PUT /users/tags/edit.

app.integrations.vero.edit_tags({
  id = "usr_123",
  add = { "prospect", "trial" },
  remove = { "inactive" }
})

Events

track_event

Tracks an event via POST /events/track. Prefer an identity object with id and/or email.

app.integrations.vero.track_event({
  identity = {
    id = "usr_123",
    email = "person@example.test"
  },
  event_name = "Viewed product",
  data = {
    product_name = "Example product",
    product_url = "https://example.test/products/1"
  },
  extras = {
    source = "OpenCompany",
    created_at = "2026-05-07T12:00:00+0000"
  }
})

Vero deduplicates similar events over a short window. Include unique event data when every event occurrence must be recorded.

Generic API

Use generic tools only for documented endpoints that do not yet have a first-class tool. Paths must be relative.

local campaigns = app.integrations.vero.api_get({
  path = "/campaigns",
  params = { page = 1 }
})

app.integrations.vero.api_post({
  path = "/users/track",
  payload = {
    id = "usr_456",
    email = "new@example.test"
  }
})

Absolute URLs are rejected.

Connection Status

get_current_user returns local configuration status only. Vero Track API does not expose a current-user endpoint, so API access is verified when a write tool sends data.

local status = app.integrations.vero.get_current_user({})

Multi-Account Usage

app.integrations.vero.identify_user({ id = "1", email = "a@example.test" })
app.integrations.vero.default.identify_user({ id = "1", email = "a@example.test" })
app.integrations.vero.marketing.track_event({
  identity = { id = "1", email = "a@example.test" },
  event_name = "Signed up"
})
Raw agent markdown
# Vero Lua API Reference

Namespace: `app.integrations.vero`

Vero tools wrap the Track REST API at `https://api.getvero.com/api/v2`. The integration adds `auth_token` automatically as a query parameter.

## Users

### identify_user

Creates or updates a user via `POST /users/track`.

```lua
app.integrations.vero.identify_user({
  id = "usr_123",
  email = "person@example.test",
  name = "Example User",
  data = {
    plan = "premium",
    signup_date = "2026-05-01"
  }
})
```

Optional `channels` may include Vero channel objects, for example push tokens with `type`, `address`, and `platform`.

### update_user

Compatibility helper for profile updates. It also uses `POST /users/track`.

```lua
app.integrations.vero.update_user({
  id = "usr_123",
  data = {
    plan = "enterprise"
  }
})
```

### alias_user

Changes a user's identifier via `PUT /users/reidentify`. This merges identities, so use it only when that merge is intended.

```lua
app.integrations.vero.alias_user({
  id = "anonymous_123",
  new_id = "usr_123"
})
```

### unsubscribe / resubscribe

```lua
app.integrations.vero.unsubscribe({ id = "usr_123" })
app.integrations.vero.resubscribe({ id = "usr_123" })
```

### delete_user

Deletes the user profile and activity. Deleted users are not recoverable in Vero.

```lua
app.integrations.vero.delete_user({
  id = "usr_123"
})
```

## Tags

### edit_tags

Adds and removes tags in one call via `PUT /users/tags/edit`.

```lua
app.integrations.vero.edit_tags({
  id = "usr_123",
  add = { "prospect", "trial" },
  remove = { "inactive" }
})
```

## Events

### track_event

Tracks an event via `POST /events/track`. Prefer an identity object with `id` and/or `email`.

```lua
app.integrations.vero.track_event({
  identity = {
    id = "usr_123",
    email = "person@example.test"
  },
  event_name = "Viewed product",
  data = {
    product_name = "Example product",
    product_url = "https://example.test/products/1"
  },
  extras = {
    source = "OpenCompany",
    created_at = "2026-05-07T12:00:00+0000"
  }
})
```

Vero deduplicates similar events over a short window. Include unique event data when every event occurrence must be recorded.

## Generic API

Use generic tools only for documented endpoints that do not yet have a first-class tool. Paths must be relative.

```lua
local campaigns = app.integrations.vero.api_get({
  path = "/campaigns",
  params = { page = 1 }
})

app.integrations.vero.api_post({
  path = "/users/track",
  payload = {
    id = "usr_456",
    email = "new@example.test"
  }
})
```

Absolute URLs are rejected.

## Connection Status

`get_current_user` returns local configuration status only. Vero Track API does not expose a current-user endpoint, so API access is verified when a write tool sends data.

```lua
local status = app.integrations.vero.get_current_user({})
```

## Multi-Account Usage

```lua
app.integrations.vero.identify_user({ id = "1", email = "a@example.test" })
app.integrations.vero.default.identify_user({ id = "1", email = "a@example.test" })
app.integrations.vero.marketing.track_event({
  identity = { id = "1", email = "a@example.test" },
  event_name = "Signed up"
})
```
Metadata-derived Lua example
local result = app.integrations.vero.get_current_user({})
print(result)

Functions

get_current_user Read

Return Vero Track API configuration status. Vero does not expose a current-user endpoint, so API access is verified when write tools run.

Lua path
app.integrations.vero.get_current_user
Full name
vero.vero_get_current_user
ParameterTypeRequiredDescription
No parameters.
identify_user Write

Identify (create or update) a user in Vero. Pass a unique user ID, email, optional name, and any custom attributes in the data object. This creates the user if they don't exist, or updates their profile if they do.

Lua path
app.integrations.vero.identify_user
Full name
vero.vero_identify_user
ParameterTypeRequiredDescription
id string yes Unique user identifier (e.g., database ID or UUID).
email string yes User email address.
name string no Display name for the user.
data object no Custom user attributes as key-value pairs (e.g., {"plan": "premium", "signup_date": "2025-01-15"}).
channels array no Optional Vero channel objects, such as push tokens with type, address, and platform.
update_user Write

Update a user's profile in Vero via the official identify endpoint. Pass the user ID, an optional email, and a data object with attributes to update.

Lua path
app.integrations.vero.update_user
Full name
vero.vero_update_user
ParameterTypeRequiredDescription
id string yes Unique user identifier to update.
email string no New email address for the user.
data object no Attributes to update as key-value pairs (e.g., {"plan": "enterprise", "company": "Acme Inc"}).
alias_user Write

Change a Vero user identifier with the official alias endpoint. This merges identities and should be used carefully.

Lua path
app.integrations.vero.alias_user
Full name
vero.vero_alias_user
ParameterTypeRequiredDescription
id string yes Existing user identifier.
new_id string yes Replacement user identifier.
unsubscribe Write

Unsubscribe a user from all Vero email campaigns. The user will no longer receive any email communication.

Lua path
app.integrations.vero.unsubscribe
Full name
vero.vero_unsubscribe
ParameterTypeRequiredDescription
id string yes Unique user identifier to unsubscribe.
resubscribe Write

Resubscribe a previously unsubscribed user to Vero email campaigns. The user will start receiving emails again.

Lua path
app.integrations.vero.resubscribe
Full name
vero.vero_resubscribe
ParameterTypeRequiredDescription
id string yes Unique user identifier to resubscribe.
delete_user Write

Delete a Vero user by ID. This permanently removes profile properties and tracked activity.

Lua path
app.integrations.vero.delete_user
Full name
vero.vero_delete_user
ParameterTypeRequiredDescription
id string yes Unique user identifier to delete.
edit_tags Write

Add and/or remove tags on a Vero user profile using the official tag edit endpoint.

Lua path
app.integrations.vero.edit_tags
Full name
vero.vero_edit_tags
ParameterTypeRequiredDescription
id string yes Unique user identifier.
add array no Tags to add.
remove array no Tags to remove.
track_event Write

Track a behavioral event for a user in Vero. Pass an identity object with id and/or email, an event name, optional event data, and optional extras such as source or created_at.

Lua path
app.integrations.vero.track_event
Full name
vero.vero_track_event
ParameterTypeRequiredDescription
identity object,string yes Identity object with id and/or email. A string is accepted for legacy calls and sent as id.
event_name string yes Name of the event to track (e.g., "Logged in", "Added to cart", "Purchased").
data object no Event-specific data as key-value pairs (e.g., {"product": "Widget", "price": 29.99}).
extras object no Optional Vero-specific extras such as source, created_at, or conversion data.
api_get Read

Call a relative Vero API GET path. Use for documented endpoints not yet exposed as first-class tools.

Lua path
app.integrations.vero.api_get
Full name
vero.vero_api_get
ParameterTypeRequiredDescription
path string yes Relative Vero API path such as /campaigns. Absolute URLs are rejected.
params object no Query parameters. auth_token is added automatically.
api_post Write

Call a relative Vero API POST path. Use for documented endpoints not yet exposed as first-class tools.

Lua path
app.integrations.vero.api_post
Full name
vero.vero_api_post
ParameterTypeRequiredDescription
path string yes Relative Vero API path such as /users/track. Absolute URLs are rejected.
payload object no JSON request body. auth_token is added as a query parameter automatically.
api_put Write

Call a relative Vero API PUT path. Use for documented endpoints not yet exposed as first-class tools.

Lua path
app.integrations.vero.api_put
Full name
vero.vero_api_put
ParameterTypeRequiredDescription
path string yes Relative Vero API path such as /users/tags/edit. Absolute URLs are rejected.
payload object no JSON request body. auth_token is added as a query parameter automatically.
api_delete Write

Call a relative Vero API DELETE path. Use for documented endpoints not yet exposed as first-class tools.

Lua path
app.integrations.vero.api_delete
Full name
vero.vero_api_delete
ParameterTypeRequiredDescription
path string yes Relative Vero API path. Absolute URLs are rejected.
payload object no Optional JSON request body. auth_token is added as a query parameter automatically.