# Kommo

> Run your Kommo sales CRM from workflows: create and move leads between pipeline stages, keep contacts and companies, add tasks and notes, tag and link records.

App · 29 actions. Web page: https://docs.lodol.com/docs/integrations/kommo

## Actions

### Complete task

Mark a task as done, with a line on how it went.

**Inputs**

- Task ID (`task_id`, text, required): The task's id, from 'List tasks' or an earlier step.
- Result (`result_text`, text): A line on how it went, kept on the task.

**Outputs**

- `task` (object): The task

**Example output**

```json
{
  "task": {
    "account_id": 0,
    "complete_till": 0,
    "created_at": 0,
    "created_by": 0,
    "duration": 0,
    "entity_id": 0,
    "entity_type": "",
    "group_id": 0,
    "id": 5698123,
    "is_completed": false,
    "request_id": "",
    "responsible_user_id": 0,
    "result": {
      "text": ""
    },
    "task_type_id": 0,
    "text": "",
    "updated_at": 1790000300,
    "updated_by": 0
  }
}
```

### Create company

Create a company with a name, phone and email. The result holds the new company's id.

**Inputs**

- Name (`name`, text, required): The company's name.
- Phone (`phone`, text): A work phone number, like +15555550123. Replaces the phone numbers it has.
- Email (`email`, text): A work email address. Replaces the email addresses it has.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Tags (`tags`, list): Tags to put on the company. New names are created.
- Custom fields (`custom_fields`, object): Other fields to set, each custom field's name as shown in Kommo (or its id) with the value. Dates take a Unix timestamp or an RFC 3339 text, checkboxes true or false, and lists the option's text.

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "_embedded": {
      "contacts": [],
      "leads": [],
      "tags": []
    },
    "account_id": 0,
    "closest_task_at": 0,
    "created_at": 0,
    "created_by": 0,
    "custom_fields_values": [],
    "group_id": 0,
    "id": 7345678,
    "is_deleted": false,
    "name": "",
    "request_id": "0",
    "responsible_user_id": 0,
    "updated_at": 0,
    "updated_by": 0
  }
}
```

### Create contact

Create a contact with a name, phone and email. The result holds the new contact's id.

**Inputs**

- First name (`first_name`, text, required): The contact's first name.
- Last name (`last_name`, text): The contact's last name.
- Phone (`phone`, text): A work phone number, like +15555550123. Replaces the phone numbers it has.
- Email (`email`, text): A work email address. Replaces the email addresses it has.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Tags (`tags`, list): Tags to put on the contact. New names are created.
- Custom fields (`custom_fields`, object): Other fields to set, each custom field's name as shown in Kommo (or its id) with the value. Dates take a Unix timestamp or an RFC 3339 text, checkboxes true or false, and lists the option's text.

**Outputs**

- `contact` (object): The contact

**Example output**

```json
{
  "contact": {
    "_embedded": {
      "companies": [],
      "leads": [],
      "tags": []
    },
    "account_id": 0,
    "closest_task_at": 0,
    "created_at": 0,
    "created_by": 0,
    "custom_fields_values": [],
    "first_name": "",
    "group_id": 0,
    "id": 9234567,
    "is_deleted": false,
    "last_name": "",
    "name": "",
    "request_id": "0",
    "responsible_user_id": 0,
    "updated_at": 0,
    "updated_by": 0
  }
}
```

### Create lead

Create a lead in a pipeline stage, optionally linked to a contact and company. Without a pipeline it goes in the main pipeline's first stage. The result holds the new lead's id.

**Inputs**

- Name (`name`, text, required): The lead's name.
- Sale amount (`price`, number): The lead's sale amount, a whole number in the account's currency. At least 0.
- Pipeline (`pipeline_id`, text): The sales pipeline. Pick one, or give a pipeline id.
- Stage (`status_id`, text): The stage in that pipeline. Pick the pipeline first. Closed stages are listed too.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Contact ID (`contact_id`, text): A contact to link as the main contact, from 'Create contact' or 'List contacts'.
- Company ID (`company_id`, text): A company to link, from 'Create company' or 'List companies'.
- Tags (`tags`, list): Tags to put on the lead. New names are created.
- Custom fields (`custom_fields`, object): Other fields to set, each custom field's name as shown in Kommo (or its id) with the value. Dates take a Unix timestamp or an RFC 3339 text, checkboxes true or false, and lists the option's text.

**Outputs**

- `lead` (object): The lead

**Example output**

```json
{
  "lead": {
    "_embedded": {
      "companies": [],
      "contacts": [],
      "loss_reason": [],
      "tags": []
    },
    "account_id": 0,
    "closed_at": 0,
    "closest_task_at": 0,
    "created_at": 0,
    "created_by": 0,
    "custom_fields_values": [],
    "group_id": 0,
    "id": 8123456,
    "is_deleted": false,
    "loss_reason_id": 0,
    "name": "",
    "pipeline_id": 0,
    "price": 0,
    "request_id": "0",
    "responsible_user_id": 0,
    "score": 0,
    "status_id": 0,
    "updated_at": 0,
    "updated_by": 0
  }
}
```

### Create note

Add a text note to a lead, contact or company. The result holds the new note's id.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text, required): The lead, contact or company to add the note to.
- Note (`text`, text, required): The note's text.

**Outputs**

- `note` (object): The note

**Example output**

```json
{
  "note": {
    "account_id": 0,
    "created_at": 0,
    "created_by": 0,
    "entity_id": 8123456,
    "id": 4276610,
    "note_type": "",
    "params": {
      "text": ""
    },
    "request_id": "0",
    "responsible_user_id": 0,
    "updated_at": 0,
    "updated_by": 0
  }
}
```

### Create tag

Create a tag for leads, contacts or companies.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Name (`name`, text, required): The tag's name.

**Outputs**

- `tag` (object): The tag

**Example output**

```json
{
  "tag": {
    "color": "",
    "id": 263807,
    "name": "VIP",
    "request_id": "0"
  }
}
```

### Create task

Create a task with a deadline, optionally on a lead, contact or company. The result holds the new task's id.

**Inputs**

- Task (`text`, text, required): What needs doing.
- Deadline (`complete_till`, date and time, required): When the task is due.
- Task type (`task_type_id`, text): The kind of task, such as Follow-up or Meeting. Defaults to Follow-up.
- Owner (`responsible_user_id`, text): Who does the task. Defaults to the user who made the token.
- On record type (`entity_type`, text): Put the task on a lead, a contact or a company. Give the record's id too. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text): The lead, contact or company the task is on. Pick the record type too.

**Outputs**

- `task` (object): The task

**Example output**

```json
{
  "task": {
    "account_id": 0,
    "complete_till": 0,
    "created_at": 0,
    "created_by": 0,
    "duration": 0,
    "entity_id": 0,
    "entity_type": "",
    "group_id": 0,
    "id": 5698123,
    "is_completed": false,
    "request_id": "0",
    "responsible_user_id": 0,
    "result": {
      "text": ""
    },
    "task_type_id": 0,
    "text": "",
    "updated_at": 0,
    "updated_by": 0
  }
}
```

### Get account

Get the connected Kommo account: its name, currency and country, and the task types it offers.

**Inputs**: None.

**Outputs**

- `account` (object): The Kommo account
- `task_types` (list): The task types the account has

**Example output**

```json
{
  "account": {
    "country": "US",
    "created_at": 1700000000,
    "created_by": 504141,
    "currency": "USD",
    "currency_symbol": "$",
    "current_user_id": 504141,
    "id": 31361463,
    "is_loss_reason_enabled": true,
    "is_unsorted_on": true,
    "language": "en",
    "name": "Acme",
    "subdomain": "acme",
    "updated_at": 1790000000,
    "updated_by": 504141
  },
  "task_types": [
    {
      "code": "FOLLOW_UP",
      "id": 1,
      "name": "Follow-up"
    },
    {
      "code": "MEETING",
      "id": 2,
      "name": "Meeting"
    }
  ]
}
```

### Get company

Get one company with its linked leads and contacts.

**Inputs**

- Company ID (`company_id`, text, required): The company's id, from 'List companies' or an earlier step.

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "_embedded": {
      "contacts": [],
      "leads": [],
      "tags": []
    },
    "account_id": 31361463,
    "closest_task_at": 0,
    "created_at": 1790000000,
    "created_by": 504141,
    "custom_fields_values": [],
    "group_id": 0,
    "id": 7345678,
    "is_deleted": false,
    "name": "Acme Co.",
    "request_id": "",
    "responsible_user_id": 504141,
    "updated_at": 1790000300,
    "updated_by": 504141
  }
}
```

### Get contact

Get one contact with the leads it is linked to.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.

**Outputs**

- `contact` (object): The contact

**Example output**

```json
{
  "contact": {
    "_embedded": {
      "companies": [],
      "leads": [
        {
          "id": 8123456
        }
      ],
      "tags": []
    },
    "account_id": 31361463,
    "closest_task_at": 0,
    "created_at": 1790000000,
    "created_by": 504141,
    "custom_fields_values": [
      {
        "field_code": "PHONE",
        "field_id": 3,
        "field_name": "Phone",
        "field_type": "multitext",
        "values": [
          {
            "enum_code": "WORK",
            "enum_id": 1,
            "value": "+15555550123"
          }
        ]
      }
    ],
    "first_name": "Jo",
    "group_id": 0,
    "id": 9234567,
    "is_deleted": false,
    "last_name": "Bloggs",
    "name": "Jo Bloggs",
    "request_id": "",
    "responsible_user_id": 504141,
    "updated_at": 1790000300,
    "updated_by": 504141
  }
}
```

### Get lead

Get one lead with its tags, linked contacts and loss reason.

**Inputs**

- Lead ID (`lead_id`, text, required): The lead's id, from 'List leads' or an earlier step.

**Outputs**

- `lead` (object): The lead

**Example output**

```json
{
  "lead": {
    "_embedded": {
      "companies": [],
      "contacts": [
        {
          "id": 9234567,
          "is_main": true
        }
      ],
      "loss_reason": [],
      "tags": [
        {
          "color": "",
          "id": 263807,
          "name": "Website"
        }
      ]
    },
    "account_id": 31361463,
    "closed_at": 0,
    "closest_task_at": 0,
    "created_at": 1790000000,
    "created_by": 504141,
    "custom_fields_values": [],
    "group_id": 0,
    "id": 8123456,
    "is_deleted": false,
    "loss_reason_id": 0,
    "name": "Website enquiry from Acme",
    "pipeline_id": 6950551,
    "price": 5000,
    "request_id": "",
    "responsible_user_id": 504141,
    "score": 0,
    "status_id": 58141807,
    "updated_at": 1790000300,
    "updated_by": 504141
  }
}
```

### Get task

Get one task with its deadline, owner and result.

**Inputs**

- Task ID (`task_id`, text, required): The task's id, from 'List tasks' or an earlier step.

**Outputs**

- `task` (object): The task

**Example output**

```json
{
  "task": {
    "account_id": 31361463,
    "complete_till": 1790086400,
    "created_at": 1790000000,
    "created_by": 504141,
    "duration": 0,
    "entity_id": 8123456,
    "entity_type": "leads",
    "group_id": 0,
    "id": 5698123,
    "is_completed": false,
    "request_id": "",
    "responsible_user_id": 504141,
    "result": {
      "text": ""
    },
    "task_type_id": 1,
    "text": "Call to confirm the quote",
    "updated_at": 1790000300,
    "updated_by": 504141
  }
}
```

### Link records

Link a lead, contact or company to another, for example a contact to a lead.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text, required): The record to link from.
- Other record type (`to_entity_type`, text, required): The kind of record to link with. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Other record ID (`to_entity_id`, text, required): The record to link to.
- Main contact (`is_main`, true/false): When linking a contact, make it the main one.

**Outputs**

- `count` (number): How many links
- `links` (list): The links

**Example output**

```json
{
  "count": 1,
  "links": [
    {
      "entity_id": 8123456,
      "entity_type": "leads",
      "metadata": {
        "catalog_id": 0,
        "is_main": false,
        "main_contact": true,
        "quantity": 0
      },
      "to_entity_id": 9234567,
      "to_entity_type": "contacts"
    }
  ]
}
```

### List companies

List or search companies by name or other field text. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`query`, text): Only companies with this text in their name, phone, email or other fields.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Created on or after (`created_from`, date): Only companies created on or after this date.
- Created on or before (`created_to`, date): Only companies created on or before this date.
- Updated on or after (`updated_from`, date): Only companies changed on or after this date.
- Updated on or before (`updated_to`, date): Only companies changed on or before this date.
- Sort by (`order_by`, text): What to sort by. Leave empty for Kommo's own order. One of: `updated_at` (Date updated), `id`.
- Order (`direction`, text): Ascending is oldest or lowest first. Defaults to ascending. One of: `asc` (Oldest or lowest first), `desc` (Newest or highest first).
- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `companies` (list): The companies
- `count` (number): How many on this page
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `page` (number): The page number of this page

**Example output**

```json
{
  "companies": [
    {
      "_embedded": {
        "contacts": [],
        "leads": [],
        "tags": []
      },
      "account_id": 31361463,
      "closest_task_at": 0,
      "created_at": 1790000000,
      "created_by": 504141,
      "custom_fields_values": [],
      "group_id": 0,
      "id": 7345678,
      "is_deleted": false,
      "name": "Acme Co.",
      "request_id": "",
      "responsible_user_id": 504141,
      "updated_at": 1790000300,
      "updated_by": 504141
    }
  ],
  "count": 1,
  "next_page": 0,
  "page": 1
}
```

### List contacts

List or search contacts by name, phone, email or other field text. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`query`, text): Only contacts with this text in their name, phone, email or other fields.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Updated on or after (`updated_from`, date): Only contacts changed on or after this date.
- Updated on or before (`updated_to`, date): Only contacts changed on or before this date.
- Sort by (`order_by`, text): What to sort by. Leave empty for Kommo's own order. One of: `updated_at` (Date updated), `id`.
- Order (`direction`, text): Ascending is oldest or lowest first. Defaults to ascending. One of: `asc` (Oldest or lowest first), `desc` (Newest or highest first).
- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `contacts` (list): The contacts
- `count` (number): How many on this page
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `page` (number): The page number of this page

**Example output**

```json
{
  "contacts": [
    {
      "_embedded": {
        "companies": [],
        "leads": [
          {
            "id": 8123456
          }
        ],
        "tags": []
      },
      "account_id": 31361463,
      "closest_task_at": 0,
      "created_at": 1790000000,
      "created_by": 504141,
      "custom_fields_values": [
        {
          "field_code": "PHONE",
          "field_id": 3,
          "field_name": "Phone",
          "field_type": "multitext",
          "values": [
            {
              "enum_code": "WORK",
              "enum_id": 1,
              "value": "+15555550123"
            }
          ]
        }
      ],
      "first_name": "Jo",
      "group_id": 0,
      "id": 9234567,
      "is_deleted": false,
      "last_name": "Bloggs",
      "name": "Jo Bloggs",
      "request_id": "",
      "responsible_user_id": 504141,
      "updated_at": 1790000300,
      "updated_by": 504141
    }
  ],
  "count": 1,
  "next_page": 0,
  "page": 1
}
```

### List leads

List leads, filtered by search text, pipeline, stage, owner or dates. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`query`, text): Only leads with this text in their name or fields.
- Pipeline (`pipeline_id`, text): The sales pipeline. Pick one, or give a pipeline id.
- Stage (`status_id`, text): The stage in that pipeline. Pick the pipeline first. Closed stages are listed too.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Created on or after (`created_from`, date): Only leads created on or after this date.
- Created on or before (`created_to`, date): Only leads created on or before this date.
- Updated on or after (`updated_from`, date): Only leads changed on or after this date.
- Updated on or before (`updated_to`, date): Only leads changed on or before this date.
- Sort by (`order_by`, text): What to sort by. Leave empty for Kommo's own order. One of: `created_at` (Date created), `updated_at` (Date updated), `id`.
- Order (`direction`, text): Ascending is oldest or lowest first. Defaults to ascending. One of: `asc` (Oldest or lowest first), `desc` (Newest or highest first).
- Include linked contacts (`include_contacts`, true/false): Also return the ids of the contacts linked to each lead. Default: `false`.
- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `count` (number): How many on this page
- `leads` (list): The leads
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `page` (number): The page number of this page

**Example output**

```json
{
  "count": 1,
  "leads": [
    {
      "_embedded": {
        "companies": [],
        "contacts": [
          {
            "id": 9234567,
            "is_main": true
          }
        ],
        "loss_reason": [],
        "tags": [
          {
            "color": "",
            "id": 263807,
            "name": "Website"
          }
        ]
      },
      "account_id": 31361463,
      "closed_at": 0,
      "closest_task_at": 0,
      "created_at": 1790000000,
      "created_by": 504141,
      "custom_fields_values": [],
      "group_id": 0,
      "id": 8123456,
      "is_deleted": false,
      "loss_reason_id": 0,
      "name": "Website enquiry from Acme",
      "pipeline_id": 6950551,
      "price": 5000,
      "request_id": "",
      "responsible_user_id": 504141,
      "score": 0,
      "status_id": 58141807,
      "updated_at": 1790000300,
      "updated_by": 504141
    }
  ],
  "next_page": 0,
  "page": 1
}
```

### List links

List the leads, contacts and companies a record is linked to.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text, required): The lead, contact or company to read the links of.

**Outputs**

- `count` (number): How many links
- `links` (list): The links

**Example output**

```json
{
  "count": 1,
  "links": [
    {
      "entity_id": 8123456,
      "entity_type": "leads",
      "metadata": {
        "catalog_id": 0,
        "is_main": false,
        "main_contact": true,
        "quantity": 0
      },
      "to_entity_id": 9234567,
      "to_entity_type": "contacts"
    }
  ]
}
```

### List loss reasons

List the reasons a lead can be closed as lost.

**Inputs**: None.

**Outputs**

- `count` (number): How many reasons
- `loss_reasons` (list): The loss reasons

**Example output**

```json
{
  "count": 1,
  "loss_reasons": [
    {
      "id": 21403207,
      "name": "Insufficient budget",
      "sort": 0
    }
  ]
}
```

### List notes

List the notes on one lead, contact or company, or on every record of that kind when no id is given. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text): Only notes on this record. Leave empty for every record of the type.
- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `count` (number): How many on this page
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `notes` (list): The notes
- `page` (number): The page number of this page

**Example output**

```json
{
  "count": 1,
  "next_page": 0,
  "notes": [
    {
      "account_id": 31361463,
      "created_at": 1790000000,
      "created_by": 504141,
      "entity_id": 8123456,
      "id": 4276610,
      "note_type": "common",
      "params": {
        "text": "Spoke to the buyer"
      },
      "request_id": "",
      "responsible_user_id": 504141,
      "updated_at": 1790000300,
      "updated_by": 504141
    }
  ],
  "page": 1
}
```

### List pipelines

List the account's lead pipelines, each with its stages and their ids.

**Inputs**: None.

**Outputs**

- `count` (number): How many pipelines
- `pipelines` (list): The pipelines with their stages

**Example output**

```json
{
  "count": 1,
  "pipelines": [
    {
      "account_id": 31361463,
      "id": 6950551,
      "is_archive": false,
      "is_main": true,
      "is_unsorted_on": true,
      "name": "Sales pipeline",
      "sort": 1,
      "statuses": [
        {
          "color": "#99ccff",
          "id": 58141807,
          "is_editable": true,
          "name": "Initial contact",
          "pipeline_id": 6950551,
          "sort": 20,
          "type": 0
        }
      ]
    }
  ]
}
```

### List tags

List the tags used on leads, contacts or companies. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Search (`query`, text): Only tags with this text in their name.
- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `count` (number): How many on this page
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `page` (number): The page number of this page
- `tags` (list): The tags

**Example output**

```json
{
  "count": 1,
  "next_page": 0,
  "page": 1,
  "tags": [
    {
      "color": "",
      "id": 263807,
      "name": "Website",
      "request_id": ""
    }
  ]
}
```

### List tasks

List tasks, filtered by open or completed, type, owner or the record they are on. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Open or completed (`state`, text): Only open tasks, or only completed ones. Leave empty for both. One of: `open` (Open tasks), `completed` (Completed tasks).
- Task type (`task_type_id`, text): The kind of task, such as Follow-up or Meeting.
- Owner (`responsible_user_id`, text): Only tasks for this Kommo user. Pick one, or give a user id.
- On record type (`entity_type`, text): Only tasks on this kind of record. Give the record's id too. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text): Only tasks on this record. Pick the record type too.
- Sort by (`order_by`, text): What to sort by. Leave empty for Kommo's own order. One of: `complete_till` (Deadline), `created_at` (Date created), `id`.
- Order (`direction`, text): Ascending is oldest or lowest first. Defaults to ascending. One of: `asc` (Oldest or lowest first), `desc` (Newest or highest first).
- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `count` (number): How many on this page
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `page` (number): The page number of this page
- `tasks` (list): The tasks

**Example output**

```json
{
  "count": 1,
  "next_page": 0,
  "page": 1,
  "tasks": [
    {
      "account_id": 31361463,
      "complete_till": 1790086400,
      "created_at": 1790000000,
      "created_by": 504141,
      "duration": 0,
      "entity_id": 8123456,
      "entity_type": "leads",
      "group_id": 0,
      "id": 5698123,
      "is_completed": false,
      "request_id": "",
      "responsible_user_id": 504141,
      "result": {
        "text": ""
      },
      "task_type_id": 1,
      "text": "Call to confirm the quote",
      "updated_at": 1790000300,
      "updated_by": 504141
    }
  ]
}
```

### List users

List the account's users with their ids, names and emails. Needs a token made by an administrator.

**Inputs**

- Page (`page`, number): Which page to return, starting at 1. Defaults to the first. At least 1.
- Page size (`limit`, number): How many to return, 1 to 250. Kommo's default is 50. From 1 to 250.

**Outputs**

- `count` (number): How many on this page
- `next_page` (number): Pass as 'page' for the next page; 0 on the last one
- `page` (number): The page number of this page
- `users` (list): The users

**Example output**

```json
{
  "count": 1,
  "next_page": 0,
  "page": 1,
  "users": [
    {
      "email": "jo@example.com",
      "id": 504141,
      "lang": "en",
      "name": "Jo Bloggs"
    }
  ]
}
```

### Unlink records

Remove the link between two records. Neither record is deleted.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Record ID (`entity_id`, text, required): The record to unlink from.
- Other record type (`to_entity_type`, text, required): The kind of record to link with. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Other record ID (`to_entity_id`, text, required): The record to unlink.

**Outputs**

- `entity_id` (number): The id of the first record
- `entity_type` (text): The type of the first record
- `to_entity_id` (number): The id of the other record
- `to_entity_type` (text): The type of the other record
- `unlinked` (true/false): Always true once unlinked

**Example output**

```json
{
  "entity_id": 8123456,
  "entity_type": "leads",
  "to_entity_id": 9234567,
  "to_entity_type": "contacts",
  "unlinked": true
}
```

### Update company

Change a company's name, phone, email, owner, tags or custom fields. Fields left empty stay as they are.

**Inputs**

- Company ID (`company_id`, text, required): The company's id, from 'List companies' or an earlier step.
- Name (`name`, text): A new name. Leave empty to keep it.
- Phone (`phone`, text): A work phone number, like +15555550123. Replaces the phone numbers it has.
- Email (`email`, text): A work email address. Replaces the email addresses it has.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Add tags (`add_tags`, list): Tags to put on the company. New names are created.
- Remove tags (`remove_tags`, list): Tags to take off the company.
- Custom fields (`custom_fields`, object): Other fields to set, each custom field's name as shown in Kommo (or its id) with the value. Dates take a Unix timestamp or an RFC 3339 text, checkboxes true or false, and lists the option's text.

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "_embedded": {
      "contacts": [],
      "leads": [],
      "tags": []
    },
    "account_id": 0,
    "closest_task_at": 0,
    "created_at": 0,
    "created_by": 0,
    "custom_fields_values": [],
    "group_id": 0,
    "id": 7345678,
    "is_deleted": false,
    "name": "",
    "request_id": "",
    "responsible_user_id": 0,
    "updated_at": 1790000300,
    "updated_by": 0
  }
}
```

### Update contact

Change a contact's name, phone, email, owner, tags or custom fields. Fields left empty stay as they are.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.
- First name (`first_name`, text): A new first name. Leave empty to keep it.
- Last name (`last_name`, text): A new last name. Leave empty to keep it.
- Phone (`phone`, text): A work phone number, like +15555550123. Replaces the phone numbers it has.
- Email (`email`, text): A work email address. Replaces the email addresses it has.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Add tags (`add_tags`, list): Tags to put on the contact. New names are created.
- Remove tags (`remove_tags`, list): Tags to take off the contact.
- Custom fields (`custom_fields`, object): Other fields to set, each custom field's name as shown in Kommo (or its id) with the value. Dates take a Unix timestamp or an RFC 3339 text, checkboxes true or false, and lists the option's text.

**Outputs**

- `contact` (object): The contact

**Example output**

```json
{
  "contact": {
    "_embedded": {
      "companies": [],
      "leads": [],
      "tags": []
    },
    "account_id": 0,
    "closest_task_at": 0,
    "created_at": 0,
    "created_by": 0,
    "custom_fields_values": [],
    "first_name": "",
    "group_id": 0,
    "id": 9234567,
    "is_deleted": false,
    "last_name": "",
    "name": "",
    "request_id": "",
    "responsible_user_id": 0,
    "updated_at": 1790000300,
    "updated_by": 0
  }
}
```

### Update lead

Change a lead: rename it, change the amount or owner, move it to another stage (including closed won or lost), tag it. Fields left empty stay as they are.

**Inputs**

- Lead ID (`lead_id`, text, required): The lead's id, from 'List leads' or an earlier step.
- Name (`name`, text): A new name. Leave empty to keep it.
- Sale amount (`price`, number): A new sale amount, 0 or more. Leave empty to keep it. At least 0.
- Pipeline (`pipeline_id`, text): The sales pipeline. Pick one, or give a pipeline id.
- Stage (`status_id`, text): The stage in that pipeline. Pick the pipeline first. Closed stages are listed too.
- Owner (`responsible_user_id`, text): The Kommo user responsible for it. Pick one, or give a user id.
- Loss reason (`loss_reason_id`, text): Why the lead was lost, when moving it to the closed-lost stage.
- Add tags (`add_tags`, list): Tags to put on the lead. New names are created.
- Remove tags (`remove_tags`, list): Tags to take off the lead.
- Custom fields (`custom_fields`, object): Other fields to set, each custom field's name as shown in Kommo (or its id) with the value. Dates take a Unix timestamp or an RFC 3339 text, checkboxes true or false, and lists the option's text.

**Outputs**

- `lead` (object): The lead

**Example output**

```json
{
  "lead": {
    "_embedded": {
      "companies": [],
      "contacts": [],
      "loss_reason": [],
      "tags": []
    },
    "account_id": 0,
    "closed_at": 0,
    "closest_task_at": 0,
    "created_at": 0,
    "created_by": 0,
    "custom_fields_values": [],
    "group_id": 0,
    "id": 8123456,
    "is_deleted": false,
    "loss_reason_id": 0,
    "name": "",
    "pipeline_id": 0,
    "price": 0,
    "request_id": "",
    "responsible_user_id": 0,
    "score": 0,
    "status_id": 0,
    "updated_at": 1790000300,
    "updated_by": 0
  }
}
```

### Update note

Change the text of a text note.

**Inputs**

- Record type (`entity_type`, text, required): Whether it is on a lead, a contact or a company. One of: `leads` (Lead), `contacts` (Contact), `companies` (Company).
- Note ID (`note_id`, text, required): The note's id, from 'List notes' or 'Create note'.
- Note (`text`, text, required): The note's text.

**Outputs**

- `note` (object): The note

**Example output**

```json
{
  "note": {
    "account_id": 0,
    "created_at": 0,
    "created_by": 0,
    "entity_id": 8123456,
    "id": 4276610,
    "note_type": "",
    "params": {
      "text": ""
    },
    "request_id": "",
    "responsible_user_id": 0,
    "updated_at": 1790000300,
    "updated_by": 0
  }
}
```

### Update task

Change a task's wording, deadline, type or owner. Fields left empty stay as they are.

**Inputs**

- Task ID (`task_id`, text, required): The task's id, from 'List tasks' or an earlier step.
- Task (`text`, text): New wording. Leave empty to keep it.
- Deadline (`complete_till`, date and time): A new deadline. Leave empty to keep it.
- Task type (`task_type_id`, text): The kind of task, such as Follow-up or Meeting.
- Owner (`responsible_user_id`, text): A new owner. Leave empty to keep it.

**Outputs**

- `task` (object): The task

**Example output**

```json
{
  "task": {
    "account_id": 0,
    "complete_till": 0,
    "created_at": 0,
    "created_by": 0,
    "duration": 0,
    "entity_id": 0,
    "entity_type": "",
    "group_id": 0,
    "id": 5698123,
    "is_completed": false,
    "request_id": "",
    "responsible_user_id": 0,
    "result": {
      "text": ""
    },
    "task_type_id": 0,
    "text": "",
    "updated_at": 1790000300,
    "updated_by": 0
  }
}
```
