KosmoKrator

sales

Apollo.io Lua API for KosmoKrator Agents

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

6 functions 6 read 0 write API key auth

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.

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 API Reference

search_contacts

Search for people in Apollo by name, email, or keyword.

Parameters

NameTypeRequiredDescription
qstringyesSearch query — name, email, company name, or keyword
pageintegernoPage number for pagination (default: 1)
per_pageintegernoResults per page (default: 25, max: 100)

Response Fields

FieldTypeDescription
contactsarrayList of matching contacts
contacts[].idstringApollo person ID
contacts[].namestringFull name
contacts[].emailstringEmail address
contacts[].titlestringJob title
contacts[].organizationstringCompany name
contacts[].phonestringPhone number
contacts[].linkedin_urlstringLinkedIn profile URL
totalintegerTotal matching results
pageintegerCurrent page
per_pageintegerResults per page
total_pagesintegerTotal number of pages

Example

local result = app.integrations.apollo.search_contacts({
  q = "john smith",
  per_page = 5
})

for _, contact in ipairs(result.contacts) do
  print(contact.name .. " — " .. (contact.title or "no title") .. " at " .. (contact.organization or "unknown"))
end

get_contact

Retrieve full details for a specific contact by their Apollo person ID.

Parameters

NameTypeRequiredDescription
idstringyesThe Apollo person ID

Example

local result = app.integrations.apollo.get_contact({
  id = "63f3b1c2XXXXXXXXXXXX"
})

print(result.name)
print(result.email)
print(result.title)
print("Organization: " .. (result.organization or "unknown"))

for _, job in ipairs(result.employment_history or {}) do
  print(job.title .. " at " .. (job.organization or "") .. (job.current and " (current)" or ""))
end

enrich

Enrich a contact by matching on email and/or name.

Parameters

NameTypeRequiredDescription
emailstringnoEmail address to match
namestringnoFull name to match

At least one of email or name must be provided.

Example

local result = app.integrations.apollo.enrich({
  email = "[email protected]",
  name = "John Smith"
})

if result.found then
  print("Found: " .. result.person.name)
  print("Title: " .. (result.person.title or "unknown"))
  print("Company: " .. (result.person.organization or "unknown"))
else
  print("No matching contact found")
end

list_organizations

List organizations from your Apollo account.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
per_pageintegernoResults per page (default: 25, max: 100)

Example

local result = app.integrations.apollo.list_organizations({
  page = 1,
  per_page = 10
})

for _, org in ipairs(result.organizations) do
  print(org.name .. " — " .. (org.industry or "unknown industry") .. " (" .. (org.employee_count or "?") .. " employees)")
end

get_organization

Retrieve full details for a specific organization by its Apollo ID.

Parameters

NameTypeRequiredDescription
idstringyesThe Apollo organization ID

Example

local result = app.integrations.apollo.get_organization({
  id = "63f3b1c2XXXXXXXXXXXX"
})

print(result.name)
print("Website: " .. (result.website_url or "unknown"))
print("Industry: " .. (result.industry or "unknown"))
print("Employees: " .. (result.employee_count or "unknown"))
print("Technologies: " .. table.concat(result.technologies or {}, ", "))

get_current_user

Retrieve the authenticated Apollo user’s profile.

Parameters

None.

Example

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

print("User: " .. result.name)
print("Email: " .. result.email)
print("Plan: " .. (result.plan or "unknown"))
print("Credits remaining: " .. tostring(result.credits_remaining or "unknown"))

Multi-Account Usage

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

-- Default account (always works)
app.integrations.apollo.search_contacts({ q = "john" })

-- Explicit default (portable across setups)
app.integrations.apollo.default.search_contacts({ q = "john" })

-- Named accounts
app.integrations.apollo.work.search_contacts({ q = "john" })
app.integrations.apollo.personal.search_contacts({ q = "john" })

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

Raw agent markdown
# Apollo.io — Lua API Reference

## search_contacts

Search for people in Apollo by name, email, or keyword.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `q` | string | yes | Search query — name, email, company name, or keyword |
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Results per page (default: 25, max: 100) |

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `contacts` | array | List of matching contacts |
| `contacts[].id` | string | Apollo person ID |
| `contacts[].name` | string | Full name |
| `contacts[].email` | string | Email address |
| `contacts[].title` | string | Job title |
| `contacts[].organization` | string | Company name |
| `contacts[].phone` | string | Phone number |
| `contacts[].linkedin_url` | string | LinkedIn profile URL |
| `total` | integer | Total matching results |
| `page` | integer | Current page |
| `per_page` | integer | Results per page |
| `total_pages` | integer | Total number of pages |

### Example

```lua
local result = app.integrations.apollo.search_contacts({
  q = "john smith",
  per_page = 5
})

for _, contact in ipairs(result.contacts) do
  print(contact.name .. " — " .. (contact.title or "no title") .. " at " .. (contact.organization or "unknown"))
end
```

---

## get_contact

Retrieve full details for a specific contact by their Apollo person ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The Apollo person ID |

### Example

```lua
local result = app.integrations.apollo.get_contact({
  id = "63f3b1c2XXXXXXXXXXXX"
})

print(result.name)
print(result.email)
print(result.title)
print("Organization: " .. (result.organization or "unknown"))

for _, job in ipairs(result.employment_history or {}) do
  print(job.title .. " at " .. (job.organization or "") .. (job.current and " (current)" or ""))
end
```

---

## enrich

Enrich a contact by matching on email and/or name.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `email` | string | no | Email address to match |
| `name` | string | no | Full name to match |

At least one of `email` or `name` must be provided.

### Example

```lua
local result = app.integrations.apollo.enrich({
  email = "[email protected]",
  name = "John Smith"
})

if result.found then
  print("Found: " .. result.person.name)
  print("Title: " .. (result.person.title or "unknown"))
  print("Company: " .. (result.person.organization or "unknown"))
else
  print("No matching contact found")
end
```

---

## list_organizations

List organizations from your Apollo account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `per_page` | integer | no | Results per page (default: 25, max: 100) |

### Example

```lua
local result = app.integrations.apollo.list_organizations({
  page = 1,
  per_page = 10
})

for _, org in ipairs(result.organizations) do
  print(org.name .. " — " .. (org.industry or "unknown industry") .. " (" .. (org.employee_count or "?") .. " employees)")
end
```

---

## get_organization

Retrieve full details for a specific organization by its Apollo ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The Apollo organization ID |

### Example

```lua
local result = app.integrations.apollo.get_organization({
  id = "63f3b1c2XXXXXXXXXXXX"
})

print(result.name)
print("Website: " .. (result.website_url or "unknown"))
print("Industry: " .. (result.industry or "unknown"))
print("Employees: " .. (result.employee_count or "unknown"))
print("Technologies: " .. table.concat(result.technologies or {}, ", "))
```

---

## get_current_user

Retrieve the authenticated Apollo user's profile.

### Parameters

None.

### Example

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

print("User: " .. result.name)
print("Email: " .. result.email)
print("Plan: " .. (result.plan or "unknown"))
print("Credits remaining: " .. tostring(result.credits_remaining or "unknown"))
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.apollo.search_contacts({ q = "john" })

-- Explicit default (portable across setups)
app.integrations.apollo.default.search_contacts({ q = "john" })

-- Named accounts
app.integrations.apollo.work.search_contacts({ q = "john" })
app.integrations.apollo.personal.search_contacts({ q = "john" })
```

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

Metadata-Derived Lua Example

local result = app.integrations.apollo.apollo_search_contacts({
  q = "example_q",
  page = 1,
  per_page = 1
})
print(result)

Functions

apollo_search_contacts

Search for people in Apollo by name, email, or keyword. Returns a paginated list of contacts with profile details including name, title, company, email, phone, and social profiles.

Operation
Read read
Full name
apollo.apollo_search_contacts
ParameterTypeRequiredDescription
q string yes Search query — a name, email address, company name, or keyword.
page integer no Page number for pagination (default: 1).
per_page integer no Number of results per page (default: 25, max: 100).

apollo_get_contact

Retrieve full details for a specific contact in Apollo by their person ID. Returns comprehensive profile data including employment history, emails, phone numbers, and social profiles.

Operation
Read read
Full name
apollo.apollo_get_contact
ParameterTypeRequiredDescription
id string yes The Apollo person ID (e.g., "63f3b1c2XXXXXXXXXXXX").

apollo_enrich

Enrich a contact by matching on email address and/or name. Returns enriched profile data including title, company, social profiles, and contact details. Provide at least an email or a name.

Operation
Read read
Full name
apollo.apollo_enrich
ParameterTypeRequiredDescription
email string no Email address to match (e.g., "[email protected]").
name string no Full name to match (e.g., "John Smith").

apollo_list_organizations

List organizations from your Apollo account. Returns paginated results with company details including name, website, industry, employee count, and revenue.

Operation
Read read
Full name
apollo.apollo_list_organizations
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of results per page (default: 25, max: 100).

apollo_get_organization

Retrieve full details for a specific organization in Apollo by its ID. Returns comprehensive company data including industry, employee count, revenue, tech stack, locations, and key contacts.

Operation
Read read
Full name
apollo.apollo_get_organization
ParameterTypeRequiredDescription
id string yes The Apollo organization ID (e.g., "63f3b1c2XXXXXXXXXXXX").

apollo_get_current_user

Retrieve the authenticated Apollo user's profile. Returns account information including name, email, plan type, and credit usage.

Operation
Read read
Full name
apollo.apollo_get_current_user
ParameterTypeRequiredDescription
No parameters.