KosmoKrator

communication

Gong Lua API for KosmoKrator Agents

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

8 functions 8 read 0 write API key auth

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.

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

NameTypeRequiredDescription
fromDateTimestringnoStart of date range in ISO 8601 (e.g., "2025-01-01T00:00:00Z")
toDateTimestringnoEnd of date range in ISO 8601 (e.g., "2025-01-31T23:59:59Z")
workspaceIdstringnoWorkspace ID to filter calls by
userIdarraynoArray of user IDs to filter calls by
cursorstringnoPagination cursor from a previous response
limitintegernoMaximum number of calls to return (default: 100)

Response

Returns an object with:

FieldTypeDescription
callsarrayArray of call objects
countintegerNumber of calls returned
totalRecordsintegerTotal matching records (if available)
cursorstringCursor 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

NameTypeRequiredDescription
callIdstringyesThe 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

NameTypeRequiredDescription
cursorstringnoPagination cursor from a previous response
limitintegernoMaximum number of users to return (default: 100)

Response

Returns an object with:

FieldTypeDescription
usersarrayArray of user objects
countintegerNumber of users returned
totalRecordsintegerTotal matching records (if available)
cursorstringCursor 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

NameTypeRequiredDescription
fromDateTimestringnoStart of date range in ISO 8601
toDateTimestringnoEnd of date range in ISO 8601
pipelineIdstringnoPipeline ID to filter deals by
stageIdsarraynoArray of stage IDs to filter by
cursorstringnoPagination cursor from a previous response
limitintegernoMaximum number of deals to return (default: 100)

Response

Returns an object with:

FieldTypeDescription
dealsarrayArray of deal objects
countintegerNumber of deals returned
totalRecordsintegerTotal matching records (if available)
cursorstringCursor 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

NameTypeRequiredDescription
fromDateTimestringnoStart of date range in ISO 8601
toDateTimestringnoEnd of date range in ISO 8601
activityTypesarraynoActivity types to filter by (e.g., {"call", "email", "meeting"})
cursorstringnoPagination cursor from a previous response
limitintegernoMaximum number of interactions to return (default: 100)

Response

Returns an object with:

FieldTypeDescription
interactionsarrayArray of interaction objects
countintegerNumber of interactions returned
totalRecordsintegerTotal matching records (if available)
cursorstringCursor 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

NameTypeRequiredDescription
pageintegernoPage number for pagination (starting from 1)
limitintegernoMaximum number of transcripts to return per page
download_datestringnoFilter by download date in ISO 8601 (e.g., "2025-01-15")
call_typestringnoFilter by call type (e.g., "conference", "webinar", "phone")
statusstringnoFilter by processing status (e.g., "completed", "processing", "failed")

Response

Returns an object with:

FieldTypeDescription
transcriptsarrayArray of transcript objects
countintegerNumber of transcripts returned
totalRecordsintegerTotal matching records (if available)
cursorstringCursor 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

NameTypeRequiredDescription
transcript_idstringyesThe 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.

Metadata-Derived Lua Example

local result = app.integrations.gong.gong_list_calls({
  fromDateTime = "example_fromDateTime",
  toDateTime = "example_toDateTime",
  workspaceId = "example_workspaceId",
  userId = "example_userId",
  cursor = "example_cursor",
  limit = 1
})
print(result)

Functions

gong_list_calls

List call recordings from Gong. Filter by date range, participants, or other criteria. Returns call metadata including title, duration, participants, and timestamps.

Operation
Read read
Full name
gong.gong_list_calls
ParameterTypeRequiredDescription
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).

gong_get_call

Get detailed information about a specific call in Gong, including metadata, participants, and tracking data.

Operation
Read read
Full name
gong.gong_get_call
ParameterTypeRequiredDescription
callId string yes The unique call identifier.

gong_list_transcripts

List call transcripts from Gong. Filter by download date, call type, or status. Returns transcript metadata including call ID, language, and processing status.

Operation
Read read
Full name
gong.gong_list_transcripts
ParameterTypeRequiredDescription
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").

gong_get_transcript

Get the full transcript of a specific call in Gong, including speaker turns, timestamps, and transcript metadata.

Operation
Read read
Full name
gong.gong_get_transcript
ParameterTypeRequiredDescription
transcript_id string yes The unique transcript identifier.

gong_list_users

List users in the Gong workspace. Returns user details including name, email, title, and manager.

Operation
Read read
Full name
gong.gong_list_users
ParameterTypeRequiredDescription
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).

gong_list_deals

List deals tracked in Gong. Filter by date range or pipeline stage. Returns deal metadata including name, stage, amount, and associated users.

Operation
Read read
Full name
gong.gong_list_deals
ParameterTypeRequiredDescription
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).

gong_list_interactions

List customer interactions tracked in Gong. Filter by date range, activity type, or participants. Returns interaction metadata including type, duration, and parties involved.

Operation
Read read
Full name
gong.gong_list_interactions
ParameterTypeRequiredDescription
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).

gong_get_current_user

Get the currently authenticated Gong user profile. Useful for verifying credentials and understanding whose data is being accessed.

Operation
Read read
Full name
gong.gong_get_current_user
ParameterTypeRequiredDescription
No parameters.