KosmoKrator

other

Outreach Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write Manual OAuth token auth

Lua Namespace

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

Outreach — Lua API Reference

outreach_list_prospects

List prospects in Outreach with optional filtering, sorting, and pagination.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of prospects per page (default: 25, max: 100).
page_numberintegernoPage number to retrieve (1-based).
sortstringnoSort field, prefix with - for descending (e.g., "createdAt", "-updatedAt").
filterarraynoJSON:API filter parameters.

Example

local result = app.integrations.outreach.list_prospects({
  page_size = 10,
  page_number = 1,
  sort = "-createdAt"
})

for _, prospect in ipairs(result.data) do
  print(prospect.attributes.firstName .. " " .. prospect.attributes.lastName)
end

outreach_get_prospect

Get a single prospect by ID.

Parameters

NameTypeRequiredDescription
idintegeryesThe prospect ID.

Example

local result = app.integrations.outreach.get_prospect({ id = 12345 })
local attrs = result.data.attributes
print(attrs.firstName .. " " .. attrs.lastName)
print("Emails: " .. table.concat(attrs.emails or {}, ", "))

outreach_create_prospect

Create a new prospect in Outreach.

Parameters

NameTypeRequiredDescription
first_namestringnoThe prospect’s first name.
last_namestringnoThe prospect’s last name.
emailsarraynoArray of email addresses.
companystringnoThe prospect’s company name.

Example

local result = app.integrations.outreach.create_prospect({
  first_name = "Jane",
  last_name = "Doe",
  emails = { "[email protected]" },
  company = "Acme Corp"
})

print("Created prospect ID: " .. result.data.id)

outreach_list_sequences

List sales sequences in Outreach.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of sequences per page (default: 25, max: 100).
page_numberintegernoPage number to retrieve (1-based).

Example

local result = app.integrations.outreach.list_sequences({
  page_size = 20,
  page_number = 1
})

for _, seq in ipairs(result.data) do
  print(seq.attributes.name)
end

outreach_get_sequence

Get a single sequence by ID.

Parameters

NameTypeRequiredDescription
idintegeryesThe sequence ID.

Example

local result = app.integrations.outreach.get_sequence({ id = 42 })
print("Sequence: " .. result.data.attributes.name)

outreach_list_accounts

List accounts (organizations) in Outreach.

Parameters

NameTypeRequiredDescription
page_sizeintegernoNumber of accounts per page (default: 25, max: 100).
page_numberintegernoPage number to retrieve (1-based).

Example

local result = app.integrations.outreach.list_accounts({
  page_size = 50
})

for _, account in ipairs(result.data) do
  print(account.attributes.name .. " (" .. (account.attributes.domain or "no domain") .. ")")
end

outreach_get_current_user

Get the currently authenticated Outreach user.

Parameters

None.

Example

local result = app.integrations.outreach.get_current_user({})
local user = result.data.attributes
print("Logged in as: " .. user.firstName .. " " .. user.lastName)
print("Email: " .. (user.email or "N/A"))

Multi-Account Usage

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

-- Default account (always works)
app.integrations.outreach.list_prospects({ page_size = 10 })

-- Explicit default (portable across setups)
app.integrations.outreach.default.list_prospects({ page_size = 10 })

-- Named accounts
app.integrations.outreach.production.list_prospects({ page_size = 10 })
app.integrations.outreach.staging.list_prospects({ page_size = 10 })

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

Raw agent markdown
# Outreach — Lua API Reference

## outreach_list_prospects

List prospects in Outreach with optional filtering, sorting, and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of prospects per page (default: 25, max: 100). |
| `page_number` | integer | no | Page number to retrieve (1-based). |
| `sort` | string | no | Sort field, prefix with `-` for descending (e.g., `"createdAt"`, `"-updatedAt"`). |
| `filter` | array | no | JSON:API filter parameters. |

### Example

```lua
local result = app.integrations.outreach.list_prospects({
  page_size = 10,
  page_number = 1,
  sort = "-createdAt"
})

for _, prospect in ipairs(result.data) do
  print(prospect.attributes.firstName .. " " .. prospect.attributes.lastName)
end
```

---

## outreach_get_prospect

Get a single prospect by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The prospect ID. |

### Example

```lua
local result = app.integrations.outreach.get_prospect({ id = 12345 })
local attrs = result.data.attributes
print(attrs.firstName .. " " .. attrs.lastName)
print("Emails: " .. table.concat(attrs.emails or {}, ", "))
```

---

## outreach_create_prospect

Create a new prospect in Outreach.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `first_name` | string | no | The prospect's first name. |
| `last_name` | string | no | The prospect's last name. |
| `emails` | array | no | Array of email addresses. |
| `company` | string | no | The prospect's company name. |

### Example

```lua
local result = app.integrations.outreach.create_prospect({
  first_name = "Jane",
  last_name = "Doe",
  emails = { "[email protected]" },
  company = "Acme Corp"
})

print("Created prospect ID: " .. result.data.id)
```

---

## outreach_list_sequences

List sales sequences in Outreach.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of sequences per page (default: 25, max: 100). |
| `page_number` | integer | no | Page number to retrieve (1-based). |

### Example

```lua
local result = app.integrations.outreach.list_sequences({
  page_size = 20,
  page_number = 1
})

for _, seq in ipairs(result.data) do
  print(seq.attributes.name)
end
```

---

## outreach_get_sequence

Get a single sequence by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The sequence ID. |

### Example

```lua
local result = app.integrations.outreach.get_sequence({ id = 42 })
print("Sequence: " .. result.data.attributes.name)
```

---

## outreach_list_accounts

List accounts (organizations) in Outreach.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_size` | integer | no | Number of accounts per page (default: 25, max: 100). |
| `page_number` | integer | no | Page number to retrieve (1-based). |

### Example

```lua
local result = app.integrations.outreach.list_accounts({
  page_size = 50
})

for _, account in ipairs(result.data) do
  print(account.attributes.name .. " (" .. (account.attributes.domain or "no domain") .. ")")
end
```

---

## outreach_get_current_user

Get the currently authenticated Outreach user.

### Parameters

None.

### Example

```lua
local result = app.integrations.outreach.get_current_user({})
local user = result.data.attributes
print("Logged in as: " .. user.firstName .. " " .. user.lastName)
print("Email: " .. (user.email or "N/A"))
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.outreach.list_prospects({ page_size = 10 })

-- Explicit default (portable across setups)
app.integrations.outreach.default.list_prospects({ page_size = 10 })

-- Named accounts
app.integrations.outreach.production.list_prospects({ page_size = 10 })
app.integrations.outreach.staging.list_prospects({ page_size = 10 })
```

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

Metadata-Derived Lua Example

local result = app.integrations.outreach.outreach_list_prospects({
  page_size = 1,
  page_number = 1,
  sort = "example_sort",
  filter = "example_filter"
})
print(result)

Functions

outreach_list_prospects

List prospects in Outreach with optional filtering, sorting, and pagination. Returns prospect records including names, emails, and company info.

Operation
Read read
Full name
outreach.outreach_list_prospects
ParameterTypeRequiredDescription
page_size integer no Number of prospects to return per page (default: 25, max: 100).
page_number integer no Page number to retrieve (1-based).
sort string no Sort field and direction (e.g., "createdAt" or "-createdAt" for descending).
filter array no JSON:API filter parameters (e.g., {"email": "[email protected]"}).

outreach_get_prospect

Get a single prospect from Outreach by ID. Returns full prospect details including contact info, custom fields, and related data.

Operation
Read read
Full name
outreach.outreach_get_prospect
ParameterTypeRequiredDescription
id integer yes The prospect ID.

outreach_create_prospect

Create a new prospect in Outreach. Provide first name, last name, emails, and optional company to add a contact to your prospect database.

Operation
Write write
Full name
outreach.outreach_create_prospect
ParameterTypeRequiredDescription
first_name string no The prospect's first name.
last_name string no The prospect's last name.
emails array no Array of email addresses for the prospect (e.g., ["[email protected]"]).
company string no The prospect's company name.

outreach_list_sequences

List sales sequences in Outreach with optional pagination. Returns sequence details including name, status, and creation date.

Operation
Read read
Full name
outreach.outreach_list_sequences
ParameterTypeRequiredDescription
page_size integer no Number of sequences to return per page (default: 25, max: 100).
page_number integer no Page number to retrieve (1-based).

outreach_get_sequence

Get a single sales sequence from Outreach by ID. Returns full sequence details including steps, settings, and associated metadata.

Operation
Read read
Full name
outreach.outreach_get_sequence
ParameterTypeRequiredDescription
id integer yes The sequence ID.

outreach_list_accounts

List accounts (organizations) in Outreach with optional pagination. Returns account details including name, domain, and company information.

Operation
Read read
Full name
outreach.outreach_list_accounts
ParameterTypeRequiredDescription
page_size integer no Number of accounts to return per page (default: 25, max: 100).
page_number integer no Page number to retrieve (1-based).

outreach_get_current_user

Get the currently authenticated Outreach user. Returns user profile details including name, email, and role.

Operation
Read read
Full name
outreach.outreach_get_current_user
ParameterTypeRequiredDescription
No parameters.