productivity
SurveyMonkey Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the SurveyMonkey KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.surveymonkey.*.
Use lua_read_doc("integrations.surveymonkey") 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
SurveyMonkey workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.surveymonkey.list({page = 1, per_page = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("surveymonkey"))' --json
kosmo integrations:lua --eval 'print(docs.read("surveymonkey.list"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local surveymonkey = app.integrations.surveymonkey
local result = surveymonkey.list({page = 1, per_page = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.surveymonkey, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.surveymonkey.default.* or app.integrations.surveymonkey.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need SurveyMonkey, use the narrower 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.
SurveyMonkey — Lua API Reference
list_surveys
List all surveys in your SurveyMonkey account.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1) |
per_page | integer | no | Number of surveys per page (default: 50, max: 100) |
Examples
local result = app.integrations.surveymonkey.list_surveys({
page = 1,
per_page = 10
})
for _, survey in ipairs(result.data) do
print(survey.id .. ": " .. survey.title)
end
get_survey
Get details of a specific survey by ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID |
Examples
local result = app.integrations.surveymonkey.get_survey({
survey_id = "123456789"
})
print("Title: " .. result.title)
print("Questions: " .. #result.pages)
create_survey
Create a new blank survey with a given title.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
title | string | yes | The title for the new survey |
Examples
local result = app.integrations.surveymonkey.create_survey({
title = "Customer Satisfaction Q1"
})
print("Created survey: " .. result.id)
list_responses
List all bulk responses for a survey.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID |
page | integer | no | Page number for pagination (default: 1) |
per_page | integer | no | Number of responses per page (default: 50, max: 100) |
Examples
local result = app.integrations.surveymonkey.list_responses({
survey_id = "123456789",
per_page = 25
})
for _, response in ipairs(result.data) do
print(response.id .. " - " .. response.date_modified)
end
get_response
Get a single response for a survey by response ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID |
response_id | string | yes | The response ID |
Examples
local result = app.integrations.surveymonkey.get_response({
survey_id = "123456789",
response_id = "987654321"
})
print("Respondent: " .. (result.recipient_email or "anonymous"))
for _, page in ipairs(result.pages) do
for _, answer in ipairs(page.answers) do
print("Q" .. answer.question_id .. ": " .. (answer.text or "selected"))
end
end
list_collectors
List all collectors for a survey.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID |
Examples
local result = app.integrations.surveymonkey.list_collectors({
survey_id = "123456789"
})
for _, collector in ipairs(result.data) do
print(collector.id .. ": " .. collector.name .. " (" .. collector.type .. ")")
end
create_collector
Create a collector for distributing a survey.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID |
type | string | yes | Collector type: "weblink" or "email" |
name | string | no | A display name for the collector |
Examples
local result = app.integrations.surveymonkey.create_collector({
survey_id = "123456789",
type = "weblink",
name = "Website Feedback Link"
})
print("Collector URL: " .. result.url)
get_current_user
Get details of the currently authenticated SurveyMonkey user.
Parameters
None.
Examples
local result = app.integrations.surveymonkey.get_current_user({})
print("User: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)
print("Plan: " .. (result.group_type or "free"))
Multi-Account Usage
If you have multiple SurveyMonkey accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.surveymonkey.function_name({...})
-- Explicit default (portable across setups)
app.integrations.surveymonkey.default.function_name({...})
-- Named accounts
app.integrations.surveymonkey.work.function_name({...})
app.integrations.surveymonkey.personal.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# SurveyMonkey — Lua API Reference
## list_surveys
List all surveys in your SurveyMonkey account.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Number of surveys per page (default: 50, max: 100) |
### Examples
```lua
local result = app.integrations.surveymonkey.list_surveys({
page = 1,
per_page = 10
})
for _, survey in ipairs(result.data) do
print(survey.id .. ": " .. survey.title)
end
```
---
## get_survey
Get details of a specific survey by ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `survey_id` | string | yes | The survey ID |
### Examples
```lua
local result = app.integrations.surveymonkey.get_survey({
survey_id = "123456789"
})
print("Title: " .. result.title)
print("Questions: " .. #result.pages)
```
---
## create_survey
Create a new blank survey with a given title.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | The title for the new survey |
### Examples
```lua
local result = app.integrations.surveymonkey.create_survey({
title = "Customer Satisfaction Q1"
})
print("Created survey: " .. result.id)
```
---
## list_responses
List all bulk responses for a survey.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `survey_id` | string | yes | The survey ID |
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Number of responses per page (default: 50, max: 100) |
### Examples
```lua
local result = app.integrations.surveymonkey.list_responses({
survey_id = "123456789",
per_page = 25
})
for _, response in ipairs(result.data) do
print(response.id .. " - " .. response.date_modified)
end
```
---
## get_response
Get a single response for a survey by response ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `survey_id` | string | yes | The survey ID |
| `response_id` | string | yes | The response ID |
### Examples
```lua
local result = app.integrations.surveymonkey.get_response({
survey_id = "123456789",
response_id = "987654321"
})
print("Respondent: " .. (result.recipient_email or "anonymous"))
for _, page in ipairs(result.pages) do
for _, answer in ipairs(page.answers) do
print("Q" .. answer.question_id .. ": " .. (answer.text or "selected"))
end
end
```
---
## list_collectors
List all collectors for a survey.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `survey_id` | string | yes | The survey ID |
### Examples
```lua
local result = app.integrations.surveymonkey.list_collectors({
survey_id = "123456789"
})
for _, collector in ipairs(result.data) do
print(collector.id .. ": " .. collector.name .. " (" .. collector.type .. ")")
end
```
---
## create_collector
Create a collector for distributing a survey.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `survey_id` | string | yes | The survey ID |
| `type` | string | yes | Collector type: `"weblink"` or `"email"` |
| `name` | string | no | A display name for the collector |
### Examples
```lua
local result = app.integrations.surveymonkey.create_collector({
survey_id = "123456789",
type = "weblink",
name = "Website Feedback Link"
})
print("Collector URL: " .. result.url)
```
---
## get_current_user
Get details of the currently authenticated SurveyMonkey user.
### Parameters
None.
### Examples
```lua
local result = app.integrations.surveymonkey.get_current_user({})
print("User: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)
print("Plan: " .. (result.group_type or "free"))
```
---
## Multi-Account Usage
If you have multiple SurveyMonkey accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.surveymonkey.function_name({...})
-- Explicit default (portable across setups)
app.integrations.surveymonkey.default.function_name({...})
-- Named accounts
app.integrations.surveymonkey.work.function_name({...})
app.integrations.surveymonkey.personal.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.surveymonkey.list({page = 1, per_page = 1})
print(result) Functions
list Read
List all surveys in your SurveyMonkey account. Returns survey IDs, titles, and creation dates.
- Lua path
app.integrations.surveymonkey.list- Full name
surveymonkey.surveymonkey_list_surveys
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
per_page | integer | no | Number of surveys per page (default: 50, max: 100). |
get Read
Get details of a specific SurveyMonkey survey by ID, including title, language, and question count.
- Lua path
app.integrations.surveymonkey.get- Full name
surveymonkey.surveymonkey_get_survey
| Parameter | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID. |
create Write
Create a new blank survey in SurveyMonkey with a given title.
- Lua path
app.integrations.surveymonkey.create- Full name
surveymonkey.surveymonkey_create_survey
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | yes | The title for the new survey. |
list_responses Read
List all bulk responses for a SurveyMonkey survey. Returns response IDs, timestamps, and answer data.
- Lua path
app.integrations.surveymonkey.list_responses- Full name
surveymonkey.surveymonkey_list_responses
| Parameter | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID. |
page | integer | no | Page number for pagination (default: 1). |
per_page | integer | no | Number of responses per page (default: 50, max: 100). |
get_response Read
Get a single response for a SurveyMonkey survey by response ID, including all answers and metadata.
- Lua path
app.integrations.surveymonkey.get_response- Full name
surveymonkey.surveymonkey_get_response
| Parameter | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID. |
response_id | string | yes | The response ID. |
list_collectors Read
List all collectors for a SurveyMonkey survey. Collectors are distribution channels (e.g., weblink, email).
- Lua path
app.integrations.surveymonkey.list_collectors- Full name
surveymonkey.surveymonkey_list_collectors
| Parameter | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID. |
create_collector Write
Create a collector for a SurveyMonkey survey to distribute it. Collector types include "weblink" (shareable URL) and "email" (email invitation).
- Lua path
app.integrations.surveymonkey.create_collector- Full name
surveymonkey.surveymonkey_create_collector
| Parameter | Type | Required | Description |
|---|---|---|---|
survey_id | string | yes | The survey ID. |
type | string | yes | Collector type: "weblink" or "email". |
name | string | no | A display name for the collector. |
get_current_user Read
Get details of the currently authenticated SurveyMonkey user, including name, email, and plan info.
- Lua path
app.integrations.surveymonkey.get_current_user- Full name
surveymonkey.surveymonkey_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||