productivity
Hootsuite Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Hootsuite KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.hootsuite.*.
Use lua_read_doc("integrations.hootsuite") 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
Hootsuite workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.hootsuite.list_messages({startTime = "example_startTime", endTime = "example_endTime", limit = 1, socialProfileIds = "example_socialProfileIds"}))' --json kosmo integrations:lua --eval 'print(docs.read("hootsuite"))' --json
kosmo integrations:lua --eval 'print(docs.read("hootsuite.list_messages"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local hootsuite = app.integrations.hootsuite
local result = hootsuite.list_messages({startTime = "example_startTime", endTime = "example_endTime", limit = 1, socialProfileIds = "example_socialProfileIds"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.hootsuite, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.hootsuite.default.* or app.integrations.hootsuite.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Hootsuite, 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.
Hootsuite — Lua API Reference
list_messages
List scheduled and past messages in Hootsuite.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
startTime | string | no | Start of time range (ISO 8601, e.g., "2025-01-01T00:00:00Z") |
endTime | string | no | End of time range (ISO 8601, e.g., "2025-01-31T23:59:59Z") |
limit | integer | no | Maximum number of messages to return |
socialProfileIds | array | no | Array of social profile IDs to filter by |
Example
local result = app.integrations.hootsuite.list_messages({
startTime = "2025-01-01T00:00:00Z",
endTime = "2025-01-31T23:59:59Z",
limit = 20
})
for _, msg in ipairs(result.data) do
print(msg.id .. ": " .. msg.text)
end
get_message
Get details of a specific message by ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messageId | string | yes | The message ID to retrieve |
Example
local result = app.integrations.hootsuite.get_message({
messageId = "123456789"
})
print(result.data.text)
print(result.data.state)
create_message
Schedule a new social media message.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text | string | yes | The message text content |
socialProfileIds | array | yes | Social profile IDs to publish to |
scheduledSendTime | string | yes | ISO 8601 timestamp (e.g., "2025-02-01T09:00:00Z") |
Example
local result = app.integrations.hootsuite.create_message({
text = "Check out our latest blog post!",
socialProfileIds = {"12345", "67890"},
scheduledSendTime = "2025-02-01T09:00:00Z"
})
print("Created message: " .. result.data[1].id)
list_social_profiles
List all social media profiles connected to the Hootsuite account.
Parameters
None.
Example
local result = app.integrations.hootsuite.list_social_profiles()
for _, profile in ipairs(result.data) do
print(profile.id .. ": " .. profile.socialNetworkUsername .. " (" .. profile.type .. ")")
end
get_social_profile
Get details of a specific social profile.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | The social profile ID |
Example
local result = app.integrations.hootsuite.get_social_profile({
profileId = "12345"
})
print(result.data.socialNetworkUsername)
print(result.data.type)
list_members
List members of the Hootsuite organization.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of members to return |
Example
local result = app.integrations.hootsuite.list_members({
limit = 50
})
for _, member in ipairs(result.data) do
print(member.id .. ": " .. (member.firstName or "") .. " " .. (member.lastName or ""))
end
get_current_user
Get the currently authenticated Hootsuite user profile.
Parameters
None.
Example
local result = app.integrations.hootsuite.get_current_user()
print("Logged in as: " .. (result.data.firstName or "") .. " " .. (result.data.lastName or ""))
print("Email: " .. (result.data.email or ""))
Multi-Account Usage
If you have multiple Hootsuite accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.hootsuite.function_name({...})
-- Explicit default (portable across setups)
app.integrations.hootsuite.default.function_name({...})
-- Named accounts
app.integrations.hootsuite.client_acct.function_name({...})
app.integrations.hootsuite.agency.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Hootsuite — Lua API Reference
## list_messages
List scheduled and past messages in Hootsuite.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `startTime` | string | no | Start of time range (ISO 8601, e.g., `"2025-01-01T00:00:00Z"`) |
| `endTime` | string | no | End of time range (ISO 8601, e.g., `"2025-01-31T23:59:59Z"`) |
| `limit` | integer | no | Maximum number of messages to return |
| `socialProfileIds` | array | no | Array of social profile IDs to filter by |
### Example
```lua
local result = app.integrations.hootsuite.list_messages({
startTime = "2025-01-01T00:00:00Z",
endTime = "2025-01-31T23:59:59Z",
limit = 20
})
for _, msg in ipairs(result.data) do
print(msg.id .. ": " .. msg.text)
end
```
---
## get_message
Get details of a specific message by ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `messageId` | string | yes | The message ID to retrieve |
### Example
```lua
local result = app.integrations.hootsuite.get_message({
messageId = "123456789"
})
print(result.data.text)
print(result.data.state)
```
---
## create_message
Schedule a new social media message.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `text` | string | yes | The message text content |
| `socialProfileIds` | array | yes | Social profile IDs to publish to |
| `scheduledSendTime` | string | yes | ISO 8601 timestamp (e.g., `"2025-02-01T09:00:00Z"`) |
### Example
```lua
local result = app.integrations.hootsuite.create_message({
text = "Check out our latest blog post!",
socialProfileIds = {"12345", "67890"},
scheduledSendTime = "2025-02-01T09:00:00Z"
})
print("Created message: " .. result.data[1].id)
```
---
## list_social_profiles
List all social media profiles connected to the Hootsuite account.
### Parameters
None.
### Example
```lua
local result = app.integrations.hootsuite.list_social_profiles()
for _, profile in ipairs(result.data) do
print(profile.id .. ": " .. profile.socialNetworkUsername .. " (" .. profile.type .. ")")
end
```
---
## get_social_profile
Get details of a specific social profile.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `profileId` | string | yes | The social profile ID |
### Example
```lua
local result = app.integrations.hootsuite.get_social_profile({
profileId = "12345"
})
print(result.data.socialNetworkUsername)
print(result.data.type)
```
---
## list_members
List members of the Hootsuite organization.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of members to return |
### Example
```lua
local result = app.integrations.hootsuite.list_members({
limit = 50
})
for _, member in ipairs(result.data) do
print(member.id .. ": " .. (member.firstName or "") .. " " .. (member.lastName or ""))
end
```
---
## get_current_user
Get the currently authenticated Hootsuite user profile.
### Parameters
None.
### Example
```lua
local result = app.integrations.hootsuite.get_current_user()
print("Logged in as: " .. (result.data.firstName or "") .. " " .. (result.data.lastName or ""))
print("Email: " .. (result.data.email or ""))
```
---
## Multi-Account Usage
If you have multiple Hootsuite accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.hootsuite.function_name({...})
-- Explicit default (portable across setups)
app.integrations.hootsuite.default.function_name({...})
-- Named accounts
app.integrations.hootsuite.client_acct.function_name({...})
app.integrations.hootsuite.agency.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.hootsuite.list_messages({startTime = "example_startTime", endTime = "example_endTime", limit = 1, socialProfileIds = "example_socialProfileIds"})
print(result) Functions
list_messages Read
List scheduled and past messages in Hootsuite. Filter by time range, social profiles, and limit. Returns message IDs, text, scheduled send times, and status.
- Lua path
app.integrations.hootsuite.list_messages- Full name
hootsuite.hootsuite_list_messages
| Parameter | Type | Required | Description |
|---|---|---|---|
startTime | string | no | Start of time range in ISO 8601 format (e.g., "2025-01-01T00:00:00Z"). |
endTime | string | no | End of time range in ISO 8601 format (e.g., "2025-01-31T23:59:59Z"). |
limit | integer | no | Maximum number of messages to return. |
socialProfileIds | array | no | Array of social profile IDs to filter messages by. |
get_message Read
Get details of a specific Hootsuite message by its ID. Returns the message text, scheduled send time, social profiles, and delivery status.
- Lua path
app.integrations.hootsuite.get_message- Full name
hootsuite.hootsuite_get_message
| Parameter | Type | Required | Description |
|---|---|---|---|
messageId | string | yes | The message ID to retrieve. |
create_message Write
Schedule a new social media message in Hootsuite. Provide the text content, target social profile IDs, and the scheduled send time.
- Lua path
app.integrations.hootsuite.create_message- Full name
hootsuite.hootsuite_create_message
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | yes | The message text content to post. |
socialProfileIds | array | yes | Array of social profile IDs to publish the message to. |
scheduledSendTime | string | yes | ISO 8601 timestamp for when the message should be sent (e.g., "2025-02-01T09:00:00Z"). |
list_social_profiles Read
List all social media profiles connected to the Hootsuite account. Returns profile IDs, types (e.g., Twitter, Facebook, LinkedIn), and display names.
- Lua path
app.integrations.hootsuite.list_social_profiles- Full name
hootsuite.hootsuite_list_social_profiles
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_social_profile Read
Get details of a specific social media profile in Hootsuite by its ID. Returns profile type, display name, and account metadata.
- Lua path
app.integrations.hootsuite.get_social_profile- Full name
hootsuite.hootsuite_get_social_profile
| Parameter | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | The social profile ID to retrieve. |
list_members Read
List members of the Hootsuite organization. Returns member IDs, names, emails, and roles. Use limit to control page size.
- Lua path
app.integrations.hootsuite.list_members- Full name
hootsuite.hootsuite_list_members
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of members to return. |
get_current_user Read
Get the currently authenticated Hootsuite user profile. Returns the member name, email, and organization info.
- Lua path
app.integrations.hootsuite.get_current_user- Full name
hootsuite.hootsuite_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||