---
title: "Adding incoming leads from the type form"
method: POST
path: "/api/v4/leads/unsorted/forms"
---

# Adding incoming leads from the type form

`POST /api/v4/leads/unsorted/forms`

This method allows adding multiple or singular incoming leads

## Headers

- `Content-Type` string

## Request body

- object
  - `RAW_BODY` object[]
    - `source_uid` string, required — Incoming lead source UID. Generated by the integration
    - `source_name` string, required — Incoming lead source name
    - `pipeline_id` integer — The ID of the pipeline to which the incoming lead will be added
    - `created_at` integer — Incoming lead creation date in the format of Unix Timestamp.
    - `metadata` object — Incoming lead metadata. Required field.
      - `form_id` string — Integration’s form ID
      - `form_name` string — Form name
      - `form_page` string — Webpage where the form is installed
      - `ip` string — The IP address of the request
      - `form_sent_at` integer — Form submission date and time in Unix Timestamp format
      - `referer` string — Webpage the applicant was redirected from to the form page
    - `_embedded` object — Embedded entities data
      - `contacts` object[] — Data related to the contact of the incoming lead. Always consists of one object
        - `id` string — Contact ID
        - `name` string — Contact full name
        - `first_name` string — Contact first name
        - `last_name` string — Contact last name
        - `responsible_user_id` integer — Contact responsible user ID
        - `created_by` integer — ID of the user who created the contact
        - `updated_by` integer — ID of the user who updated the contact last
        - `created_at` integer — Contact creation date in the format of Unix Timestamp
        - `updated_at` integer — Contact update date in the format of Unix Timestamp
        - `custom_fields_values` string, json — An array of the current contact custom fields’ values
        - `tags_to_add` object[] — Array of tags to add. You need to pass either name or ID of the tag.
          - `id` integer — Tag ID
          - `name` string — Tag name
        - `request_id` string — The field will be returned unchanged in the response and will not be saved.
      - `companies` object[] — Data related to the company of the incoming lead. Always consists of one object
        - `id` integer — Company ID
        - `name` string — Company name
        - `responsible_user_id` integer — Company responsible user ID
        - `created_by` integer — The ID of the user who created the company
        - `updated_by` integer — The ID of the user who updated the company last
        - `created_at` integer — Company creation date in the format of Unix Timestamp
        - `updated_at` integer — Company update date in the format of Unix Timestamp
        - `custom_fields_values` string, json — An array of the current company custom fields’ values.
        - `_embedded` object
          - `tags` object[]
            - `id` integer — Tag ID
            - `name` string — Tag name
        - `request_id` string — The field will be returned unchanged in the response and will not be saved.
        - `tags_to_add` object[] — Array of tags to add. You need to pass either name or ID of the tag.
          - `id` integer — Tag ID
          - `name` string — Tag name
      - `leads` object[] — Data related to the lead to which the incoming lead is connected . Always consists of one object
        - `name` string — Lead name
        - `price` integer — Lead sale
        - `status_id` integer — Stage ID the lead is added to. The first stage of the main pipeline by default
        - `pipeline_id` integer — Pipeline ID the lead is added to.
        - `created_by` integer — The ID of the user creating the lead. When passing the value 0, the lead will be considered as created by the robot.
        - `updated_by` integer — The ID of the user updating the lead. When passing the value 0, the lead will be considered as created by the robot.
        - `created_at` integer — Lead creation date in the format of Unix Timestamp.
        - `updated_at` integer — Lead update date in the format of Unix Timestamp.
        - `closed_at` integer — Lead closure date in the format of Unix Timestamp.
        - `loss_reason_id` integer — Lead loss reason ID.
        - `responsible_user_id` integer — Lead responsible user ID.
        - `custom_fields_values` string, json — An array of the current lead custom fields’ values.
        - `_embedded` object — Embedded entities of the lead
          - `tags` object[] — Tags attached to the lead.
            - `id` integer — Tag ID
            - `name` string — Tag name
          - `contacts` object[] — Contacts attached to the lead.
            - `id` integer — Contact ID.
            - `is_main` boolean — Indicates whether the contact is the main or not.
          - `companies` object[] — Company attached to the lead. you can assign only 1 company.
            - `id` integer — Company ID.
          - `source` object — Source of the lead
            - `external_id` string — The external ID of the source. A source can be added using the Sources API. If the external_id of the source is passed and the pipeline_id is not passed, the lead will be added to the pipeline where the source is located.
            - `type` string — Source type. For leads added by integrations, only the widget is supported.
        - `tags_to_add` object[] — Array of tags to add. You need to pass either name or ID of the tag.
          - `id` integer — Tag ID
          - `name` string — Tag name
        - `tags_to_delete` object[] — Array of tags to delete. You need to pass either name or ID of the tag.
          - `id` integer — Tag ID
          - `name` string — Tag name
    - `request_id` string — The field that will be returned unchanged in the response and will not be saved.

## Response `200`

200

- object
  - `_total_items` integer
  - `_embedded` object
    - `unsorted` object[]
      - `uid` string
      - `account_id` integer
      - `request_id` string
      - `_links` object
        - `self` object
          - `href` string
      - `_embedded` object
        - `contacts` object[]
          - `id` integer
          - `_links` object
            - `self` object
              - …
        - `leads` object[]
          - `id` integer
          - `_links` object
            - `self` object
              - …
        - `companies` unknown[]
          - unknown

## Other responses

- `400` — 400
- `401` — 401

---

[API](https://skmtc.dev/kommo/apis/kommo-api-references.md) · [All operations](https://skmtc.dev/kommo/apis/kommo-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kommo/kommo-api-references/revisions/f17af4d23c7c/schema)
