---
updatedAt: 2025-07-11T10:23:03.000Z
agentTools:
  projectIndex: https://developers.kommo.com/llms.txt
---

# Add incoming leads from the type form

This method allows adding multiple or singular incoming leads

**Limitations**\
The method is available in correspondence to the user rights.

**Authorization type**\
OAuth 2.0 with Access Token/Long-lived token.

**Data type header when the request is successful**\
Content-Type: application/hal+json

**Data type header in case of an error**\
Content-Type: application/problem+json

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "kommo-api-references",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://{subdomain}.kommo.com",
      "variables": {
        "subdomain": {
          "default": "subdomain"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/v4/leads/unsorted/forms": {
      "post": {
        "summary": "Adding incoming leads from the type form",
        "description": "This method allows adding multiple or singular incoming leads",
        "operationId": "incoming-leads-form",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "Request header",
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "source_uid": {
                          "type": "string",
                          "description": "Incoming lead source UID. Generated by the integration"
                        },
                        "source_name": {
                          "type": "string",
                          "description": "Incoming lead source name"
                        },
                        "pipeline_id": {
                          "type": "integer",
                          "description": "The ID of the pipeline to which the incoming lead will be added",
                          "format": "int32"
                        },
                        "created_at": {
                          "type": "integer",
                          "description": "Incoming lead creation date in the format of Unix Timestamp.",
                          "format": "int32"
                        },
                        "metadata": {
                          "type": "object",
                          "description": "Incoming lead metadata.  Required field.",
                          "properties": {
                            "form_id": {
                              "type": "string",
                              "description": "Integration’s form ID"
                            },
                            "form_name": {
                              "type": "string",
                              "description": "Form name"
                            },
                            "form_page": {
                              "type": "string",
                              "description": "Webpage where the form is installed"
                            },
                            "ip": {
                              "type": "string",
                              "description": "The IP address of the request"
                            },
                            "form_sent_at": {
                              "type": "integer",
                              "description": "Form submission date and time in Unix Timestamp format",
                              "format": "int32"
                            },
                            "referer": {
                              "type": "string",
                              "description": "Webpage the applicant was redirected from to the form page"
                            }
                          }
                        },
                        "_embedded": {
                          "type": "object",
                          "description": "Embedded entities data",
                          "properties": {
                            "contacts": {
                              "type": "array",
                              "description": "Data related to the contact of the incoming lead. Always consists of one object",
                              "items": {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Contact ID"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Contact full name"
                                  },
                                  "first_name": {
                                    "type": "string",
                                    "description": "Contact first name"
                                  },
                                  "last_name": {
                                    "type": "string",
                                    "description": "Contact last name"
                                  },
                                  "responsible_user_id": {
                                    "type": "integer",
                                    "description": "Contact responsible user ID",
                                    "format": "int32"
                                  },
                                  "created_by": {
                                    "type": "integer",
                                    "description": "ID of the user who created the contact",
                                    "format": "int32"
                                  },
                                  "updated_by": {
                                    "type": "integer",
                                    "description": "ID of the user who updated the contact last",
                                    "format": "int32"
                                  },
                                  "created_at": {
                                    "type": "integer",
                                    "description": "Contact creation date in the format of Unix Timestamp",
                                    "format": "int32"
                                  },
                                  "updated_at": {
                                    "type": "integer",
                                    "description": "Contact update date in the format of Unix Timestamp",
                                    "format": "int32"
                                  },
                                  "custom_fields_values": {
                                    "type": "string",
                                    "description": "An array of the current contact custom fields’ values",
                                    "format": "json"
                                  },
                                  "tags_to_add": {
                                    "type": "array",
                                    "description": "Array of tags to add. You need to pass either name or ID of the tag.",
                                    "items": {
                                      "properties": {
                                        "id": {
                                          "type": "integer",
                                          "description": "Tag ID",
                                          "format": "int32"
                                        },
                                        "name": {
                                          "type": "string",
                                          "description": "Tag name"
                                        }
                                      },
                                      "type": "object"
                                    }
                                  },
                                  "request_id": {
                                    "type": "string",
                                    "description": "The field will be returned unchanged in the response and will not be saved."
                                  }
                                },
                                "type": "object"
                              }
                            },
                            "companies": {
                              "type": "array",
                              "description": "Data related to the company of the incoming lead. Always consists of one object",
                              "items": {
                                "properties": {
                                  "id": {
                                    "type": "integer",
                                    "description": "Company ID",
                                    "format": "int32"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Company name"
                                  },
                                  "responsible_user_id": {
                                    "type": "integer",
                                    "description": "Company responsible user ID",
                                    "format": "int32"
                                  },
                                  "created_by": {
                                    "type": "integer",
                                    "description": "The ID of the user who created the company",
                                    "format": "int32"
                                  },
                                  "updated_by": {
                                    "type": "integer",
                                    "description": "The ID of the user who updated the company last",
                                    "format": "int32"
                                  },
                                  "created_at": {
                                    "type": "integer",
                                    "description": "Company creation date in the format of Unix Timestamp",
                                    "format": "int32"
                                  },
                                  "updated_at": {
                                    "type": "integer",
                                    "description": "Company update date in the format of Unix Timestamp",
                                    "format": "int32"
                                  },
                                  "custom_fields_values": {
                                    "type": "string",
                                    "description": "An array of the current company custom fields’ values.",
                                    "format": "json"
                                  },
                                  "_embedded": {
                                    "type": "object",
                                    "properties": {
                                      "tags": {
                                        "type": "array",
                                        "items": {
                                          "properties": {
                                            "id": {
                                              "type": "integer",
                                              "description": "Tag ID",
                                              "format": "int32"
                                            },
                                            "name": {
                                              "type": "string",
                                              "description": "Tag name"
                                            }
                                          },
                                          "type": "object"
                                        }
                                      }
                                    }
                                  },
                                  "request_id": {
                                    "type": "string",
                                    "description": "The field will be returned unchanged in the response and will not be saved."
                                  },
                                  "tags_to_add": {
                                    "type": "array",
                                    "description": "Array of tags to add. You need to pass either name or ID of the tag.",
                                    "items": {
                                      "properties": {
                                        "id": {
                                          "type": "integer",
                                          "description": "Tag ID",
                                          "format": "int32"
                                        },
                                        "name": {
                                          "type": "string",
                                          "description": "Tag name"
                                        }
                                      },
                                      "type": "object"
                                    }
                                  }
                                },
                                "type": "object"
                              }
                            },
                            "leads": {
                              "type": "array",
                              "description": "Data related to the lead to which the incoming lead is connected . Always consists of one object",
                              "items": {
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "description": "Lead name"
                                  },
                                  "price": {
                                    "type": "integer",
                                    "description": "Lead sale",
                                    "format": "int32"
                                  },
                                  "status_id": {
                                    "type": "integer",
                                    "description": "Stage ID the lead is added to. The first stage of the main pipeline by default",
                                    "format": "int32"
                                  },
                                  "pipeline_id": {
                                    "type": "integer",
                                    "description": "Pipeline ID the lead is added to.",
                                    "format": "int32"
                                  },
                                  "created_by": {
                                    "type": "integer",
                                    "description": "The ID of the user creating the lead. When passing the value 0, the lead will be considered as created by the robot.",
                                    "format": "int32"
                                  },
                                  "updated_by": {
                                    "type": "integer",
                                    "description": "The ID of the user updating the lead. When passing the value 0, the lead will be considered as created by the robot.",
                                    "format": "int32"
                                  },
                                  "created_at": {
                                    "type": "integer",
                                    "description": "Lead creation date in the format of Unix Timestamp.",
                                    "format": "int32"
                                  },
                                  "updated_at": {
                                    "type": "integer",
                                    "description": "Lead update date in the format of Unix Timestamp.",
                                    "format": "int32"
                                  },
                                  "closed_at": {
                                    "type": "integer",
                                    "description": "Lead closure date in the format of Unix Timestamp.",
                                    "format": "int32"
                                  },
                                  "loss_reason_id": {
                                    "type": "integer",
                                    "description": "Lead loss reason ID.",
                                    "format": "int32"
                                  },
                                  "responsible_user_id": {
                                    "type": "integer",
                                    "description": "Lead responsible user ID.",
                                    "format": "int32"
                                  },
                                  "custom_fields_values": {
                                    "type": "string",
                                    "description": "An array of the current lead custom fields’ values.",
                                    "format": "json"
                                  },
                                  "_embedded": {
                                    "type": "object",
                                    "description": "Embedded entities of the lead",
                                    "properties": {
                                      "tags": {
                                        "type": "array",
                                        "description": "Tags attached to the lead.",
                                        "items": {
                                          "properties": {
                                            "id": {
                                              "type": "integer",
                                              "description": "Tag ID",
                                              "format": "int32"
                                            },
                                            "name": {
                                              "type": "string",
                                              "description": "Tag name"
                                            }
                                          },
                                          "type": "object"
                                        }
                                      },
                                      "contacts": {
                                        "type": "array",
                                        "description": "Contacts attached to the lead.",
                                        "items": {
                                          "properties": {
                                            "id": {
                                              "type": "integer",
                                              "description": "Contact ID.",
                                              "format": "int32"
                                            },
                                            "is_main": {
                                              "type": "boolean",
                                              "description": "Indicates whether the contact is the main or not."
                                            }
                                          },
                                          "type": "object"
                                        }
                                      },
                                      "companies": {
                                        "type": "array",
                                        "description": "Company attached to the lead. you can assign only 1 company.",
                                        "items": {
                                          "properties": {
                                            "id": {
                                              "type": "integer",
                                              "description": "Company ID.",
                                              "format": "int32"
                                            }
                                          },
                                          "type": "object"
                                        }
                                      },
                                      "source": {
                                        "type": "object",
                                        "description": "Source of the lead",
                                        "properties": {
                                          "external_id": {
                                            "type": "string",
                                            "description": "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": {
                                            "type": "string",
                                            "description": "Source type. For leads added by integrations, only the widget is supported."
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "tags_to_add": {
                                    "type": "array",
                                    "description": "Array of tags to add. You need to pass either name or ID of the tag.",
                                    "items": {
                                      "properties": {
                                        "id": {
                                          "type": "integer",
                                          "description": "Tag ID",
                                          "format": "int32"
                                        },
                                        "name": {
                                          "type": "string",
                                          "description": "Tag name"
                                        }
                                      },
                                      "type": "object"
                                    }
                                  },
                                  "tags_to_delete": {
                                    "type": "array",
                                    "description": "Array of tags to delete. You need to pass either name or ID of the tag.",
                                    "items": {
                                      "properties": {
                                        "id": {
                                          "type": "integer",
                                          "description": "Tag ID",
                                          "format": "int32"
                                        },
                                        "name": {
                                          "type": "string",
                                          "description": "Tag name"
                                        }
                                      },
                                      "type": "object"
                                    }
                                  }
                                },
                                "type": "object"
                              }
                            }
                          }
                        },
                        "request_id": {
                          "type": "string",
                          "description": "The field that will be returned unchanged in the response and will not be saved."
                        }
                      },
                      "required": [
                        "source_uid",
                        "source_name"
                      ],
                      "type": "object"
                    }
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": [
                    {
                      "request_id": "456",
                      "source_name": "Asme Co.",
                      "source_uid": "a1fee7c0fc436088e64ba2e8822ba2b3",
                      "pipeline_id": 6950551,
                      "created_at": 1510261200,
                      "_embedded": {
                        "leads": [
                          {
                            "name": "Tech maintenance",
                            "price": 5500,
                            "custom_fields_values": [
                              {
                                "field_id": 184994,
                                "values": [
                                  {
                                    "value": true
                                  }
                                ]
                              }
                            ],
                            "_embedded": {
                              "tags": [
                                {
                                  "id": 2164
                                }
                              ]
                            }
                          }
                        ],
                        "contacts": [
                          {
                            "name": "Example 2 contact"
                          }
                        ],
                        "companies": [
                          {
                            "name": "Atme Co."
                          }
                        ]
                      },
                      "metadata": {
                        "ip": "123.222.2.22",
                        "form_id": "a1fee7c0fc436088e64ba2e8822ba2b3ewrw",
                        "form_sent_at": 1590830520,
                        "form_name": "Application form",
                        "form_page": "https://example.com",
                        "referer": "https://www.google.com"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Incoming leads added successfully": {
                    "value": {
                      "_total_items": 1,
                      "_embedded": {
                        "unsorted": [
                          {
                            "uid": "400c5eb65b9fa7bbfa813cf593b49d4942f325c7c3fbbcf3acf3bee79b63",
                            "account_id": 31361463,
                            "request_id": "123",
                            "_links": {
                              "self": {
                                "href": "LINK"
                              }
                            },
                            "_embedded": {
                              "contacts": [
                                {
                                  "id": 583294,
                                  "_links": {
                                    "self": {
                                      "href": "https://devteam.kommo.com/api/v4/contacts/583294"
                                    }
                                  }
                                }
                              ],
                              "leads": [
                                {
                                  "id": 236724,
                                  "_links": {
                                    "self": {
                                      "href": "https://devteam.kommo.com/api/v4/leads/236724"
                                    }
                                  }
                                }
                              ],
                              "companies": []
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_total_items": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "_embedded": {
                      "type": "object",
                      "properties": {
                        "unsorted": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "uid": {
                                "type": "string",
                                "example": "5af9dedb6f2c6a29eaac4b60de71ddd5d2ec7d9f4867a83f73616a51bc76"
                              },
                              "account_id": {
                                "type": "integer",
                                "example": 31361463,
                                "default": 0
                              },
                              "request_id": {
                                "type": "string",
                                "example": "456"
                              },
                              "_links": {
                                "type": "object",
                                "properties": {
                                  "self": {
                                    "type": "object",
                                    "properties": {
                                      "href": {
                                        "type": "string",
                                        "example": "LINK"
                                      }
                                    }
                                  }
                                }
                              },
                              "_embedded": {
                                "type": "object",
                                "properties": {
                                  "contacts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "integer",
                                          "example": 597518,
                                          "default": 0
                                        },
                                        "_links": {
                                          "type": "object",
                                          "properties": {
                                            "self": {
                                              "type": "object",
                                              "properties": {
                                                "href": {
                                                  "type": "string",
                                                  "example": "https://devteam.kommo.com/api/v4/contacts/597518"
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "leads": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "integer",
                                          "example": 250286,
                                          "default": 0
                                        },
                                        "_links": {
                                          "type": "object",
                                          "properties": {
                                            "self": {
                                              "type": "object",
                                              "properties": {
                                                "href": {
                                                  "type": "string",
                                                  "example": "https://devteam.kommo.com/api/v4/leads/250286"
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "companies": {
                                    "type": "array"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid data are given. Details are available in the request-response": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "The user is not authorized": {
                    "value": {
                      "title": "Unauthorized",
                      "type": "https://httpstatus.es/401",
                      "status": 401,
                      "detail": "Invalid user name or password"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```