KosmoKrator

data

Apollo.io Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.apollo.*. Use lua_read_doc("integrations.apollo") 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 Apollo.io workflow without starting an interactive agent session.

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

Workflow file

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

workflow.lua
local apollo = app.integrations.apollo
local result = apollo.search_people({})

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.apollo, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.apollo.default.* or app.integrations.apollo.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Apollo.io, 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.

Apollo.io Lua Reference

Namespace: apollo

Apollo separates net-new database records from records saved to your team:

  • search_people searches Apollo’s people database.
  • search_contacts searches contacts saved in your team account.
  • list_organizations searches Apollo’s organization database. The legacy slug is retained even though the upstream operation is Organization Search.
  • search_accounts searches accounts saved in your team account.

Some endpoints require a master API key or plan-specific access. A 403 usually means the key is valid but the Apollo account cannot use that endpoint. Requests are authenticated with Apollo’s X-Api-Key header, not a bearer token.

Search And Enrichment

local people = app.integrations.apollo.search_people({
  q_keywords = "revenue operations",
  person_titles = { "VP Sales", "Head of Revenue" },
  page = 1,
  per_page = 10,
})

local person = app.integrations.apollo.enrich({
  email = "person@example.test",
  reveal_personal_emails = false,
})

local bulk_people = app.integrations.apollo.bulk_enrich_people({
  details = {
    { email = "one@example.test" },
    { name = "Jane Example", domain = "example.test" },
  },
})

local orgs = app.integrations.apollo.list_organizations({
  q_organization_name = "example",
  organization_locations = { "california" },
})

local org = app.integrations.apollo.enrich_organization({
  domain = "example.test",
})

local bulk_orgs = app.integrations.apollo.bulk_enrich_organizations({
  domains = { "example.test", "example.invalid" },
})

Use the filters object for documented Apollo filters that do not have a named parameter in this package:

local result = app.integrations.apollo.search_people({
  filters = {
    person_seniorities = { "director", "vp" },
    organization_num_employees_ranges = { "100,250" },
  },
  per_page = 25,
})

Contacts

local contacts = app.integrations.apollo.search_contacts({
  q_keywords = "example",
  page = 1,
  per_page = 10,
})

local contact = app.integrations.apollo.get_contact({
  contact_id = "66e34b81740c50074e3d1bd4",
})

local created = app.integrations.apollo.create_contact({
  first_name = "Jane",
  last_name = "Example",
  email = "jane@example.test",
  organization_name = "Example Inc",
  run_dedupe = true,
})

local updated = app.integrations.apollo.update_contact({
  contact_id = "66e34b81740c50074e3d1bd4",
  title = "VP Sales",
})

local stages = app.integrations.apollo.list_contact_stages({})

Accounts

local accounts = app.integrations.apollo.search_accounts({
  q_organization_name = "example",
  page = 1,
})

local account = app.integrations.apollo.get_organization({
  account_id = "6518c6184f20350001a0b9c0",
})

local created = app.integrations.apollo.create_account({
  name = "Example Inc",
  domain = "example.test",
})

local updated = app.integrations.apollo.update_account({
  account_id = "6518c6184f20350001a0b9c0",
  account_stage_id = "6095a710bd01d100a506d4b9",
})

local stages = app.integrations.apollo.list_account_stages({})

Team Metadata

local usage = app.integrations.apollo.get_api_usage_stats({})
local users = app.integrations.apollo.list_users({})
local email_accounts = app.integrations.apollo.list_email_accounts({})

Normalized Output

Tools return Apollo’s JSON response with only transport errors normalized. Agents should inspect the upstream keys such as people, contacts, organizations, accounts, pagination, or endpoint-specific result arrays.

Raw agent markdown
# Apollo.io Lua Reference

Namespace: `apollo`

Apollo separates net-new database records from records saved to your team:

- `search_people` searches Apollo's people database.
- `search_contacts` searches contacts saved in your team account.
- `list_organizations` searches Apollo's organization database. The legacy slug
  is retained even though the upstream operation is Organization Search.
- `search_accounts` searches accounts saved in your team account.

Some endpoints require a master API key or plan-specific access. A `403` usually
means the key is valid but the Apollo account cannot use that endpoint.
Requests are authenticated with Apollo's `X-Api-Key` header, not a bearer token.

## Search And Enrichment

```lua
local people = app.integrations.apollo.search_people({
  q_keywords = "revenue operations",
  person_titles = { "VP Sales", "Head of Revenue" },
  page = 1,
  per_page = 10,
})

local person = app.integrations.apollo.enrich({
  email = "person@example.test",
  reveal_personal_emails = false,
})

local bulk_people = app.integrations.apollo.bulk_enrich_people({
  details = {
    { email = "one@example.test" },
    { name = "Jane Example", domain = "example.test" },
  },
})

local orgs = app.integrations.apollo.list_organizations({
  q_organization_name = "example",
  organization_locations = { "california" },
})

local org = app.integrations.apollo.enrich_organization({
  domain = "example.test",
})

local bulk_orgs = app.integrations.apollo.bulk_enrich_organizations({
  domains = { "example.test", "example.invalid" },
})
```

Use the `filters` object for documented Apollo filters that do not have a named
parameter in this package:

```lua
local result = app.integrations.apollo.search_people({
  filters = {
    person_seniorities = { "director", "vp" },
    organization_num_employees_ranges = { "100,250" },
  },
  per_page = 25,
})
```

## Contacts

```lua
local contacts = app.integrations.apollo.search_contacts({
  q_keywords = "example",
  page = 1,
  per_page = 10,
})

local contact = app.integrations.apollo.get_contact({
  contact_id = "66e34b81740c50074e3d1bd4",
})

local created = app.integrations.apollo.create_contact({
  first_name = "Jane",
  last_name = "Example",
  email = "jane@example.test",
  organization_name = "Example Inc",
  run_dedupe = true,
})

local updated = app.integrations.apollo.update_contact({
  contact_id = "66e34b81740c50074e3d1bd4",
  title = "VP Sales",
})

local stages = app.integrations.apollo.list_contact_stages({})
```

## Accounts

```lua
local accounts = app.integrations.apollo.search_accounts({
  q_organization_name = "example",
  page = 1,
})

local account = app.integrations.apollo.get_organization({
  account_id = "6518c6184f20350001a0b9c0",
})

local created = app.integrations.apollo.create_account({
  name = "Example Inc",
  domain = "example.test",
})

local updated = app.integrations.apollo.update_account({
  account_id = "6518c6184f20350001a0b9c0",
  account_stage_id = "6095a710bd01d100a506d4b9",
})

local stages = app.integrations.apollo.list_account_stages({})
```

## Team Metadata

```lua
local usage = app.integrations.apollo.get_api_usage_stats({})
local users = app.integrations.apollo.list_users({})
local email_accounts = app.integrations.apollo.list_email_accounts({})
```

## Normalized Output

Tools return Apollo's JSON response with only transport errors normalized. Agents
should inspect the upstream keys such as `people`, `contacts`, `organizations`,
`accounts`, `pagination`, or endpoint-specific result arrays.
Metadata-derived Lua example
local result = app.integrations.apollo.search_people({})
print(result)

Functions

search_people Read

Search net-new people in Apollo data.

Lua path
app.integrations.apollo.search_people
Full name
apollo.apollo_search_people
ParameterTypeRequiredDescription
No parameters.
enrich_person Read

Enrich one person by email, name, ID, LinkedIn URL, or company attributes.

Lua path
app.integrations.apollo.enrich_person
Full name
apollo.apollo_enrich
ParameterTypeRequiredDescription
No parameters.
bulk_enrich_people Read

Enrich up to 10 people in a single Apollo request.

Lua path
app.integrations.apollo.bulk_enrich_people
Full name
apollo.apollo_bulk_enrich_people
ParameterTypeRequiredDescription
No parameters.
search_organizations Read

Search companies in Apollo data.

Lua path
app.integrations.apollo.search_organizations
Full name
apollo.apollo_list_organizations
ParameterTypeRequiredDescription
No parameters.
enrich_organization Read

Enrich one company by domain.

Lua path
app.integrations.apollo.enrich_organization
Full name
apollo.apollo_enrich_organization
ParameterTypeRequiredDescription
No parameters.
bulk_enrich_organizations Read

Enrich up to 10 companies by domain.

Lua path
app.integrations.apollo.bulk_enrich_organizations
Full name
apollo.apollo_bulk_enrich_organizations
ParameterTypeRequiredDescription
No parameters.
list_organization_job_postings Read

List current job postings for an Apollo organization.

Lua path
app.integrations.apollo.list_organization_job_postings
Full name
apollo.apollo_list_organization_job_postings
ParameterTypeRequiredDescription
No parameters.
search_contacts Read

Search saved contacts in your Apollo team account.

Lua path
app.integrations.apollo.search_contacts
Full name
apollo.apollo_search_contacts
ParameterTypeRequiredDescription
No parameters.
view_contact Read

View a saved Apollo contact by contact ID.

Lua path
app.integrations.apollo.view_contact
Full name
apollo.apollo_get_contact
ParameterTypeRequiredDescription
No parameters.
create_contact Write

Create a saved Apollo contact.

Lua path
app.integrations.apollo.create_contact
Full name
apollo.apollo_create_contact
ParameterTypeRequiredDescription
No parameters.
update_contact Write

Update a saved Apollo contact.

Lua path
app.integrations.apollo.update_contact
Full name
apollo.apollo_update_contact
ParameterTypeRequiredDescription
No parameters.
bulk_create_contacts Write

Create up to 100 Apollo contacts in one request.

Lua path
app.integrations.apollo.bulk_create_contacts
Full name
apollo.apollo_bulk_create_contacts
ParameterTypeRequiredDescription
No parameters.
list_contact_stages Read

List Apollo contact stage IDs.

Lua path
app.integrations.apollo.list_contact_stages
Full name
apollo.apollo_list_contact_stages
ParameterTypeRequiredDescription
No parameters.
search_accounts Read

Search saved accounts in your Apollo team account.

Lua path
app.integrations.apollo.search_accounts
Full name
apollo.apollo_search_accounts
ParameterTypeRequiredDescription
No parameters.
view_account Read

View a saved Apollo account by ID.

Lua path
app.integrations.apollo.view_account
Full name
apollo.apollo_get_organization
ParameterTypeRequiredDescription
No parameters.
create_account Write

Create a saved Apollo account.

Lua path
app.integrations.apollo.create_account
Full name
apollo.apollo_create_account
ParameterTypeRequiredDescription
No parameters.
update_account Write

Update a saved Apollo account.

Lua path
app.integrations.apollo.update_account
Full name
apollo.apollo_update_account
ParameterTypeRequiredDescription
No parameters.
bulk_create_accounts Write

Create up to 100 Apollo accounts in one request.

Lua path
app.integrations.apollo.bulk_create_accounts
Full name
apollo.apollo_bulk_create_accounts
ParameterTypeRequiredDescription
No parameters.
list_account_stages Read

List Apollo account stage IDs.

Lua path
app.integrations.apollo.list_account_stages
Full name
apollo.apollo_list_account_stages
ParameterTypeRequiredDescription
No parameters.
get_current_user Read

Get the authenticated Apollo user profile when available.

Lua path
app.integrations.apollo.get_current_user
Full name
apollo.apollo_get_current_user
ParameterTypeRequiredDescription
No parameters.
list_users Read

List Apollo team users.

Lua path
app.integrations.apollo.list_users
Full name
apollo.apollo_list_users
ParameterTypeRequiredDescription
No parameters.
list_email_accounts Read

List Apollo email accounts.

Lua path
app.integrations.apollo.list_email_accounts
Full name
apollo.apollo_list_email_accounts
ParameterTypeRequiredDescription
No parameters.
get_api_usage_stats Read

View Apollo API usage and rate-limit statistics.

Lua path
app.integrations.apollo.get_api_usage_stats
Full name
apollo.apollo_get_api_usage_stats
ParameterTypeRequiredDescription
No parameters.