KosmoKrator

marketing

HubSpot Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write Manual OAuth token auth

Lua Namespace

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

Client for the HubSpot REST API v1 covering contacts, companies, and deals — Lua API Reference

hubspot3_list_contacts

List HubSpot contacts. Returns contact IDs, emails, names, and associated company IDs. Use limit and offset for pagination, and properties to select specific fields.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of contacts to return (default 20, max 100).
offsetintegernoPagination offset (vid offset for continuing results).
propertiesstringnoComma-separated list of contact properties to include (e.g. “email,firstname,lastname,company”).

Example

local result = app.integrations.hubspot3.hubspot3_list_contacts({
  limit = 20
  offset = 0
  properties = "email,firstname,lastname,company"
})

hubspot3_get_contact

Retrieve a HubSpot contact by its ID (vid). Returns the full contact profile including all properties, form submissions, and lists.

Parameters

NameTypeRequiredDescription
contact_idstringyesHubSpot contact ID (vid).

Example

local result = app.integrations.hubspot3.hubspot3_get_contact({
  contact_id = "12345"
})

hubspot3_create_contact

Create a new HubSpot contact. Requires an email address. Optionally set first name, last name, phone, company, and other properties. Returns the created contact with its ID.

Parameters

NameTypeRequiredDescription
emailstringyesContact email address.
first_namestringnoContact first name.
last_namestringnoContact last name.
phonestringnoContact phone number.
companystringnoContact company name.
propertiesobjectnoAdditional custom properties as key-value pairs.

Example

local result = app.integrations.hubspot3.hubspot3_create_contact({
  email = "[email protected]"
  first_name = "Jane"
  last_name = "Smith"
  company = "Acme Corp"
})

hubspot3_list_companies

List HubSpot companies. Returns company IDs, names, domains, and other properties. Use limit and offset for pagination.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of companies to return (default 20, max 100).
offsetintegernoPagination offset (company ID offset for continuing results).
propertiesstringnoComma-separated list of company properties to include (e.g. “name,domain,industry”).

Example

local result = app.integrations.hubspot3.hubspot3_list_companies({
  limit = 20
  offset = 0
  properties = "name,domain,industry"
})

hubspot3_get_company

Retrieve a HubSpot company by its ID. Returns the full company profile including name, domain, industry, and other properties.

Parameters

NameTypeRequiredDescription
company_idstringyesHubSpot company ID.

Example

local result = app.integrations.hubspot3.hubspot3_get_company({
  company_id = "67890"
})

hubspot3_list_deals

List HubSpot deals. Returns deal IDs, names, stages, amounts, and associated contacts/companies. Use limit and offset for pagination.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of deals to return (default 20, max 100).
offsetintegernoPagination offset (deal ID offset for continuing results).
propertiesstringnoComma-separated list of deal properties to include (e.g. “dealname,amount,dealstage”).

Example

local result = app.integrations.hubspot3.hubspot3_list_deals({
  limit = 20
  offset = 0
  properties = "dealname,amount,dealstage"
})

hubspot3_get_current_user

Retrieve the currently authenticated HubSpot user’s information. Returns the user’s ID, email, name, and portal information. Useful for identifying which account or token is in use.

Example

local result = app.integrations.hubspot3.hubspot3_get_current_user({
})

Multi-Account Usage

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

-- Default account (always works)
app.integrations.hubspot3.function_name({...})

-- Explicit default (portable across setups)
app.integrations.hubspot3.default.function_name({...})

-- Named accounts
app.integrations.hubspot3.production.function_name({...})
app.integrations.hubspot3.sandbox.function_name({...})

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

Raw agent markdown
# Client for the HubSpot REST API v1 covering contacts, companies, and deals — Lua API Reference

## hubspot3_list_contacts

List HubSpot contacts.
Returns contact IDs, emails, names, and associated company IDs.
Use limit and offset for pagination, and properties to select specific fields.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of contacts to return (default 20, max 100). |
| `offset` | integer | no | Pagination offset (vid offset for continuing results). |
| `properties` | string | no | Comma-separated list of contact properties to include (e.g. "email,firstname,lastname,company"). |

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_list_contacts({
  limit = 20
  offset = 0
  properties = "email,firstname,lastname,company"
})
```

## hubspot3_get_contact

Retrieve a HubSpot contact by its ID (vid).
Returns the full contact profile including all properties, form submissions, and lists.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `contact_id` | string | yes | HubSpot contact ID (vid). |

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_get_contact({
  contact_id = "12345"
})
```

## hubspot3_create_contact

Create a new HubSpot contact.
Requires an email address. Optionally set first name, last name, phone, company, and other properties.
Returns the created contact with its ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `email` | string | yes | Contact email address. |
| `first_name` | string | no | Contact first name. |
| `last_name` | string | no | Contact last name. |
| `phone` | string | no | Contact phone number. |
| `company` | string | no | Contact company name. |
| `properties` | object | no | Additional custom properties as key-value pairs. |

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_create_contact({
  email = "[email protected]"
  first_name = "Jane"
  last_name = "Smith"
  company = "Acme Corp"
})
```

## hubspot3_list_companies

List HubSpot companies.
Returns company IDs, names, domains, and other properties.
Use limit and offset for pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of companies to return (default 20, max 100). |
| `offset` | integer | no | Pagination offset (company ID offset for continuing results). |
| `properties` | string | no | Comma-separated list of company properties to include (e.g. "name,domain,industry"). |

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_list_companies({
  limit = 20
  offset = 0
  properties = "name,domain,industry"
})
```

## hubspot3_get_company

Retrieve a HubSpot company by its ID.
Returns the full company profile including name, domain, industry, and other properties.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `company_id` | string | yes | HubSpot company ID. |

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_get_company({
  company_id = "67890"
})
```

## hubspot3_list_deals

List HubSpot deals.
Returns deal IDs, names, stages, amounts, and associated contacts/companies.
Use limit and offset for pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of deals to return (default 20, max 100). |
| `offset` | integer | no | Pagination offset (deal ID offset for continuing results). |
| `properties` | string | no | Comma-separated list of deal properties to include (e.g. "dealname,amount,dealstage"). |

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_list_deals({
  limit = 20
  offset = 0
  properties = "dealname,amount,dealstage"
})
```

## hubspot3_get_current_user

Retrieve the currently authenticated HubSpot user's information.
Returns the user's ID, email, name, and portal information.
Useful for identifying which account or token is in use.

### Example

```lua
local result = app.integrations.hubspot3.hubspot3_get_current_user({
})
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.hubspot3.function_name({...})

-- Explicit default (portable across setups)
app.integrations.hubspot3.default.function_name({...})

-- Named accounts
app.integrations.hubspot3.production.function_name({...})
app.integrations.hubspot3.sandbox.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.hubspot3.hubspot3_list_contacts({
  limit = 1,
  offset = 1,
  properties = "example_properties"
})
print(result)

Functions

hubspot3_list_contacts

List HubSpot contacts. Returns contact IDs, emails, names, and associated company IDs. Use limit and offset for pagination, and properties to select specific fields.

Operation
Read read
Full name
hubspot3.hubspot3_list_contacts
ParameterTypeRequiredDescription
limit integer no Maximum number of contacts to return (default 20, max 100).
offset integer no Pagination offset (vid offset for continuing results).
properties string no Comma-separated list of contact properties to include (e.g. "email,firstname,lastname,company").

hubspot3_get_contact

Retrieve a HubSpot contact by its ID (vid). Returns the full contact profile including all properties, form submissions, and lists.

Operation
Read read
Full name
hubspot3.hubspot3_get_contact
ParameterTypeRequiredDescription
contact_id string yes HubSpot contact ID (vid).

hubspot3_create_contact

Create a new HubSpot contact. Requires an email address. Optionally set first name, last name, phone, company, and other properties. Returns the created contact with its ID.

Operation
Write write
Full name
hubspot3.hubspot3_create_contact
ParameterTypeRequiredDescription
email string yes Contact email address.
first_name string no Contact first name.
last_name string no Contact last name.
phone string no Contact phone number.
company string no Contact company name.
properties object no Additional custom properties as key-value pairs.

hubspot3_list_companies

List HubSpot companies. Returns company IDs, names, domains, and other properties. Use limit and offset for pagination.

Operation
Read read
Full name
hubspot3.hubspot3_list_companies
ParameterTypeRequiredDescription
limit integer no Maximum number of companies to return (default 20, max 100).
offset integer no Pagination offset (company ID offset for continuing results).
properties string no Comma-separated list of company properties to include (e.g. "name,domain,industry").

hubspot3_get_company

Retrieve a HubSpot company by its ID. Returns the full company profile including name, domain, industry, and other properties.

Operation
Read read
Full name
hubspot3.hubspot3_get_company
ParameterTypeRequiredDescription
company_id string yes HubSpot company ID.

hubspot3_list_deals

List HubSpot deals. Returns deal IDs, names, stages, amounts, and associated contacts/companies. Use limit and offset for pagination.

Operation
Read read
Full name
hubspot3.hubspot3_list_deals
ParameterTypeRequiredDescription
limit integer no Maximum number of deals to return (default 20, max 100).
offset integer no Pagination offset (deal ID offset for continuing results).
properties string no Comma-separated list of deal properties to include (e.g. "dealname,amount,dealstage").

hubspot3_get_current_user

Retrieve the currently authenticated HubSpot user's information. Returns the user's ID, email, name, and portal information. Useful for identifying which account or token is in use.

Operation
Read read
Full name
hubspot3.hubspot3_get_current_user
ParameterTypeRequiredDescription
No parameters.