productivity
Gong Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Gong KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.gong.*.
Use lua_read_doc("integrations.gong") 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
Gong workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.gong.list_calls({fromDateTime = "example_fromDateTime", toDateTime = "example_toDateTime", workspaceId = "example_workspaceId", userId = "example_userId", cursor = "example_cursor", limit = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("gong"))' --json
kosmo integrations:lua --eval 'print(docs.read("gong.list_calls"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local gong = app.integrations.gong
local result = gong.list_calls({fromDateTime = "example_fromDateTime", toDateTime = "example_toDateTime", workspaceId = "example_workspaceId", userId = "example_userId", cursor = "example_cursor", limit = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.gong, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.gong.default.* or app.integrations.gong.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Gong, 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.
Gong — Lua API Reference
list_calls
List call recordings from Gong.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fromDateTime | string | no | Start of date range in ISO 8601 (e.g., "2025-01-01T00:00:00Z") |
toDateTime | string | no | End of date range in ISO 8601 (e.g., "2025-01-31T23:59:59Z") |
workspaceId | string | no | Workspace ID to filter calls by |
userId | array | no | Array of user IDs to filter calls by |
cursor | string | no | Pagination cursor from a previous response |
limit | integer | no | Maximum number of calls to return (default: 100) |
Response
Returns an object with:
| Field | Type | Description |
|---|---|---|
calls | array | Array of call objects |
count | integer | Number of calls returned |
totalRecords | integer | Total matching records (if available) |
cursor | string | Cursor for the next page (if available) |
Example
local result = app.integrations.gong.list_calls({
fromDateTime = "2025-01-01T00:00:00Z",
toDateTime = "2025-01-31T23:59:59Z"
})
for _, call in ipairs(result.calls) do
print(call.title .. " — " .. call.duration .. "s")
end
get_call
Get detailed information about a specific call.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
callId | string | yes | The unique call identifier |
Example
local result = app.integrations.gong.get_call({
callId = "1234567890"
})
print("Title: " .. result.title)
print("Duration: " .. result.duration .. " seconds")
list_users
List users in the Gong workspace.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | no | Pagination cursor from a previous response |
limit | integer | no | Maximum number of users to return (default: 100) |
Response
Returns an object with:
| Field | Type | Description |
|---|---|---|
users | array | Array of user objects |
count | integer | Number of users returned |
totalRecords | integer | Total matching records (if available) |
cursor | string | Cursor for the next page (if available) |
Example
local result = app.integrations.gong.list_users({})
for _, user in ipairs(result.users) do
print(user.firstName .. " " .. user.lastName .. " — " .. user.email)
end
list_deals
List deals tracked in Gong.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fromDateTime | string | no | Start of date range in ISO 8601 |
toDateTime | string | no | End of date range in ISO 8601 |
pipelineId | string | no | Pipeline ID to filter deals by |
stageIds | array | no | Array of stage IDs to filter by |
cursor | string | no | Pagination cursor from a previous response |
limit | integer | no | Maximum number of deals to return (default: 100) |
Response
Returns an object with:
| Field | Type | Description |
|---|---|---|
deals | array | Array of deal objects |
count | integer | Number of deals returned |
totalRecords | integer | Total matching records (if available) |
cursor | string | Cursor for the next page (if available) |
Example
local result = app.integrations.gong.list_deals({
fromDateTime = "2025-01-01T00:00:00Z",
toDateTime = "2025-03-31T23:59:59Z"
})
for _, deal in ipairs(result.deals) do
print(deal.name .. " — Stage: " .. deal.stage .. " — Amount: " .. deal.amount)
end
list_interactions
List customer interactions tracked in Gong.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fromDateTime | string | no | Start of date range in ISO 8601 |
toDateTime | string | no | End of date range in ISO 8601 |
activityTypes | array | no | Activity types to filter by (e.g., {"call", "email", "meeting"}) |
cursor | string | no | Pagination cursor from a previous response |
limit | integer | no | Maximum number of interactions to return (default: 100) |
Response
Returns an object with:
| Field | Type | Description |
|---|---|---|
interactions | array | Array of interaction objects |
count | integer | Number of interactions returned |
totalRecords | integer | Total matching records (if available) |
cursor | string | Cursor for the next page (if available) |
Example
local result = app.integrations.gong.list_interactions({
fromDateTime = "2025-01-01T00:00:00Z",
activityTypes = {"call", "meeting"}
})
for _, interaction in ipairs(result.interactions) do
print(interaction.type .. " — " .. interaction.startTime)
end
list_transcripts
List call transcripts from Gong.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (starting from 1) |
limit | integer | no | Maximum number of transcripts to return per page |
download_date | string | no | Filter by download date in ISO 8601 (e.g., "2025-01-15") |
call_type | string | no | Filter by call type (e.g., "conference", "webinar", "phone") |
status | string | no | Filter by processing status (e.g., "completed", "processing", "failed") |
Response
Returns an object with:
| Field | Type | Description |
|---|---|---|
transcripts | array | Array of transcript objects |
count | integer | Number of transcripts returned |
totalRecords | integer | Total matching records (if available) |
cursor | string | Cursor for the next page (if available) |
Example
local result = app.integrations.gong.list_transcripts({
download_date = "2025-01-15",
status = "completed"
})
for _, transcript in ipairs(result.transcripts) do
print(transcript.callId .. " — " .. transcript.status)
end
get_transcript
Get the full transcript of a specific call in Gong.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
transcript_id | string | yes | The unique transcript identifier |
Example
local result = app.integrations.gong.get_transcript({
transcript_id = "1234567890"
})
print("Call ID: " .. result.callId)
for _, turn in ipairs(result.transcript) do
print(turn.speaker .. ": " .. turn.text)
end
get_current_user
Get the currently authenticated Gong user profile.
Parameters
None.
Example
local result = app.integrations.gong.get_current_user({})
print("Logged in as: " .. result.firstName .. " " .. result.lastName)
print("Email: " .. result.email)
Multi-Account Usage
If you have multiple Gong accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.gong.list_calls({})
-- Explicit default (portable across setups)
app.integrations.gong.default.list_calls({})
-- Named accounts
app.integrations.gong.us_workspace.list_calls({})
app.integrations.gong.eu_workspace.list_calls({})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Gong — Lua API Reference
## list_calls
List call recordings from Gong.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `fromDateTime` | string | no | Start of date range in ISO 8601 (e.g., `"2025-01-01T00:00:00Z"`) |
| `toDateTime` | string | no | End of date range in ISO 8601 (e.g., `"2025-01-31T23:59:59Z"`) |
| `workspaceId` | string | no | Workspace ID to filter calls by |
| `userId` | array | no | Array of user IDs to filter calls by |
| `cursor` | string | no | Pagination cursor from a previous response |
| `limit` | integer | no | Maximum number of calls to return (default: 100) |
### Response
Returns an object with:
| Field | Type | Description |
|-------|------|-------------|
| `calls` | array | Array of call objects |
| `count` | integer | Number of calls returned |
| `totalRecords` | integer | Total matching records (if available) |
| `cursor` | string | Cursor for the next page (if available) |
### Example
```lua
local result = app.integrations.gong.list_calls({
fromDateTime = "2025-01-01T00:00:00Z",
toDateTime = "2025-01-31T23:59:59Z"
})
for _, call in ipairs(result.calls) do
print(call.title .. " — " .. call.duration .. "s")
end
```
---
## get_call
Get detailed information about a specific call.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `callId` | string | yes | The unique call identifier |
### Example
```lua
local result = app.integrations.gong.get_call({
callId = "1234567890"
})
print("Title: " .. result.title)
print("Duration: " .. result.duration .. " seconds")
```
---
## list_users
List users in the Gong workspace.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `cursor` | string | no | Pagination cursor from a previous response |
| `limit` | integer | no | Maximum number of users to return (default: 100) |
### Response
Returns an object with:
| Field | Type | Description |
|-------|------|-------------|
| `users` | array | Array of user objects |
| `count` | integer | Number of users returned |
| `totalRecords` | integer | Total matching records (if available) |
| `cursor` | string | Cursor for the next page (if available) |
### Example
```lua
local result = app.integrations.gong.list_users({})
for _, user in ipairs(result.users) do
print(user.firstName .. " " .. user.lastName .. " — " .. user.email)
end
```
---
## list_deals
List deals tracked in Gong.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `fromDateTime` | string | no | Start of date range in ISO 8601 |
| `toDateTime` | string | no | End of date range in ISO 8601 |
| `pipelineId` | string | no | Pipeline ID to filter deals by |
| `stageIds` | array | no | Array of stage IDs to filter by |
| `cursor` | string | no | Pagination cursor from a previous response |
| `limit` | integer | no | Maximum number of deals to return (default: 100) |
### Response
Returns an object with:
| Field | Type | Description |
|-------|------|-------------|
| `deals` | array | Array of deal objects |
| `count` | integer | Number of deals returned |
| `totalRecords` | integer | Total matching records (if available) |
| `cursor` | string | Cursor for the next page (if available) |
### Example
```lua
local result = app.integrations.gong.list_deals({
fromDateTime = "2025-01-01T00:00:00Z",
toDateTime = "2025-03-31T23:59:59Z"
})
for _, deal in ipairs(result.deals) do
print(deal.name .. " — Stage: " .. deal.stage .. " — Amount: " .. deal.amount)
end
```
---
## list_interactions
List customer interactions tracked in Gong.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `fromDateTime` | string | no | Start of date range in ISO 8601 |
| `toDateTime` | string | no | End of date range in ISO 8601 |
| `activityTypes` | array | no | Activity types to filter by (e.g., `{"call", "email", "meeting"}`) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `limit` | integer | no | Maximum number of interactions to return (default: 100) |
### Response
Returns an object with:
| Field | Type | Description |
|-------|------|-------------|
| `interactions` | array | Array of interaction objects |
| `count` | integer | Number of interactions returned |
| `totalRecords` | integer | Total matching records (if available) |
| `cursor` | string | Cursor for the next page (if available) |
### Example
```lua
local result = app.integrations.gong.list_interactions({
fromDateTime = "2025-01-01T00:00:00Z",
activityTypes = {"call", "meeting"}
})
for _, interaction in ipairs(result.interactions) do
print(interaction.type .. " — " .. interaction.startTime)
end
```
---
## list_transcripts
List call transcripts from Gong.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (starting from 1) |
| `limit` | integer | no | Maximum number of transcripts to return per page |
| `download_date` | string | no | Filter by download date in ISO 8601 (e.g., `"2025-01-15"`) |
| `call_type` | string | no | Filter by call type (e.g., `"conference"`, `"webinar"`, `"phone"`) |
| `status` | string | no | Filter by processing status (e.g., `"completed"`, `"processing"`, `"failed"`) |
### Response
Returns an object with:
| Field | Type | Description |
|-------|------|-------------|
| `transcripts` | array | Array of transcript objects |
| `count` | integer | Number of transcripts returned |
| `totalRecords` | integer | Total matching records (if available) |
| `cursor` | string | Cursor for the next page (if available) |
### Example
```lua
local result = app.integrations.gong.list_transcripts({
download_date = "2025-01-15",
status = "completed"
})
for _, transcript in ipairs(result.transcripts) do
print(transcript.callId .. " — " .. transcript.status)
end
```
---
## get_transcript
Get the full transcript of a specific call in Gong.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `transcript_id` | string | yes | The unique transcript identifier |
### Example
```lua
local result = app.integrations.gong.get_transcript({
transcript_id = "1234567890"
})
print("Call ID: " .. result.callId)
for _, turn in ipairs(result.transcript) do
print(turn.speaker .. ": " .. turn.text)
end
```
---
## get_current_user
Get the currently authenticated Gong user profile.
### Parameters
None.
### Example
```lua
local result = app.integrations.gong.get_current_user({})
print("Logged in as: " .. result.firstName .. " " .. result.lastName)
print("Email: " .. result.email)
```
---
## Multi-Account Usage
If you have multiple Gong accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.gong.list_calls({})
-- Explicit default (portable across setups)
app.integrations.gong.default.list_calls({})
-- Named accounts
app.integrations.gong.us_workspace.list_calls({})
app.integrations.gong.eu_workspace.list_calls({})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.gong.list_calls({fromDateTime = "example_fromDateTime", toDateTime = "example_toDateTime", workspaceId = "example_workspaceId", userId = "example_userId", cursor = "example_cursor", limit = 1})
print(result) Functions
list_calls Read
List call recordings from Gong. Filter by date range, participants, or other criteria. Returns call metadata including title, duration, participants, and timestamps.
- Lua path
app.integrations.gong.list_calls- Full name
gong.gong_list_calls
| Parameter | Type | Required | Description |
|---|---|---|---|
fromDateTime | string | no | Start of date range in ISO 8601 format (e.g., "2025-01-01T00:00:00Z"). |
toDateTime | string | no | End of date range in ISO 8601 format (e.g., "2025-01-31T23:59:59Z"). |
workspaceId | string | no | Workspace ID to filter calls by. |
userId | array | no | Array of user IDs to filter calls by. |
cursor | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
limit | integer | no | Maximum number of calls to return (default: 100). |
get_call Read
Get detailed information about a specific call in Gong, including metadata, participants, and tracking data.
- Lua path
app.integrations.gong.get_call- Full name
gong.gong_get_call
| Parameter | Type | Required | Description |
|---|---|---|---|
callId | string | yes | The unique call identifier. |
list_transcripts Read
List call transcripts from Gong. Filter by download date, call type, or status. Returns transcript metadata including call ID, language, and processing status.
- Lua path
app.integrations.gong.list_transcripts- Full name
gong.gong_list_transcripts
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (starting from 1). |
limit | integer | no | Maximum number of transcripts to return per page. |
download_date | string | no | Filter transcripts by download date in ISO 8601 format (e.g., "2025-01-15"). |
call_type | string | no | Filter by call type (e.g., "conference", "webinar", "phone"). |
status | string | no | Filter by transcript processing status (e.g., "completed", "processing", "failed"). |
get_transcript Read
Get the full transcript of a specific call in Gong, including speaker turns, timestamps, and transcript metadata.
- Lua path
app.integrations.gong.get_transcript- Full name
gong.gong_get_transcript
| Parameter | Type | Required | Description |
|---|---|---|---|
transcript_id | string | yes | The unique transcript identifier. |
list_users Read
List users in the Gong workspace. Returns user details including name, email, title, and manager.
- Lua path
app.integrations.gong.list_users- Full name
gong.gong_list_users
| Parameter | Type | Required | Description |
|---|---|---|---|
cursor | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
limit | integer | no | Maximum number of users to return (default: 100). |
list_deals Read
List deals tracked in Gong. Filter by date range or pipeline stage. Returns deal metadata including name, stage, amount, and associated users.
- Lua path
app.integrations.gong.list_deals- Full name
gong.gong_list_deals
| Parameter | Type | Required | Description |
|---|---|---|---|
fromDateTime | string | no | Start of date range in ISO 8601 format (e.g., "2025-01-01T00:00:00Z"). |
toDateTime | string | no | End of date range in ISO 8601 format (e.g., "2025-01-31T23:59:59Z"). |
pipelineId | string | no | Pipeline ID to filter deals by. |
stageIds | array | no | Array of stage IDs to filter deals by. |
cursor | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
limit | integer | no | Maximum number of deals to return (default: 100). |
list_interactions Read
List customer interactions tracked in Gong. Filter by date range, activity type, or participants. Returns interaction metadata including type, duration, and parties involved.
- Lua path
app.integrations.gong.list_interactions- Full name
gong.gong_list_interactions
| Parameter | Type | Required | Description |
|---|---|---|---|
fromDateTime | string | no | Start of date range in ISO 8601 format (e.g., "2025-01-01T00:00:00Z"). |
toDateTime | string | no | End of date range in ISO 8601 format (e.g., "2025-01-31T23:59:59Z"). |
activityTypes | array | no | Array of activity types to filter by (e.g., ["call", "email", "meeting"]). |
cursor | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
limit | integer | no | Maximum number of interactions to return (default: 100). |
get_current_user Read
Get the currently authenticated Gong user profile. Useful for verifying credentials and understanding whose data is being accessed.
- Lua path
app.integrations.gong.get_current_user- Full name
gong.gong_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||