> For the complete documentation index, see [llms.txt](https://docs-vnext.kiflo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-vnext.kiflo.com/developers/api-reference/leads/create-lead.md).

# Create lead

Create a new lead.

You can assigned the lead with an existing partner using the `partnerId` property. You will be the source of the lead and the partner will have to accept or refuse the lead.

You can set the source of the lead using the `sourcePartnerId` property. By doing that, you create the lead on behalf of the partner. He won't have to accept or refuse the lead, the lead will be automatically accepted.

Use the `note` property to add a new note on create lead.

If the lead comes from your website via a referral link shared by a partner and you want to associate it with the correct partner, use the HTTP header:\
`Kiflo-Tracking-Code: AABBCCDDEEFF+=`

The\*\* tracking code\*\* can be retrieved in javascript from your website using the JS SDK.Please referer to the[JS SDK documentation](https://docs.kiflo.com/category/26-js-sdk).

The `status` property is optional and can be used only in conjunction with the header parameter `Kiflo-Tracking-Code`. It can be one of the following value:

* **Pending**: the lead is assigned to the source partner and must be validated by you
* **Accepted**: the lead is assigned to the source partner and is automatically accepted
* **Unassigned**: the lead is not assigned to any partner, but the source partner is set correctly. it can be shared to another partner manually

```json
{"openapi":"3.0.1","info":{"title":"Kiflo Public API v3","version":"v3"},"security":[{"oauth2":["Lead.Create","Api"]}],"components":{"securitySchemes":{},"schemas":{"LeadCreateRequestDto":{"type":"object","properties":{"properties":{"type":"object","additionalProperties":{"nullable":true},"nullable":true},"currency":{"type":"string","nullable":true},"ownerUserId":{"type":"integer","format":"int32","nullable":true},"partnerId":{"type":"integer","description":"The partner to whom the lead is assigned.","format":"int32","nullable":true},"sourcePartnerId":{"type":"integer","description":"The partner to who declared the lead.","format":"int32","nullable":true},"userPartnerOwnerId":{"type":"integer","description":"The user partner assigned to the lead.","format":"int32","nullable":true},"assignedContactEmail":{"type":"string","description":"The email of the user partner assigned to the lead. PartnerId must be specified.","nullable":true},"deadLine":{"type":"string","format":"date-time","nullable":true},"note":{"type":"string","description":"Optional note to add to the lead after its creation.","nullable":true},"status":{"$ref":"#/components/schemas/LeadStatus"},"assignToPartnerOwner":{"type":"boolean","description":"If true, the Lead OwnerUserId will be the same as the Partner OwnerUserId","nullable":true}},"additionalProperties":false},"LeadStatus":{"enum":["Unknown","Unassigned","Pending","Accepted","Refused","Reassigned","Converted","Abandoned"],"type":"string"},"LeadDto":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"creationDate":{"type":"string","format":"date-time"},"properties":{"type":"object","additionalProperties":{"nullable":true},"nullable":true},"partnerId":{"type":"integer","format":"int32","nullable":true},"sourcePartnerId":{"type":"integer","format":"int32","nullable":true},"userPartnerOwnerId":{"type":"integer","format":"int32","nullable":true},"dealId":{"type":"integer","format":"int32","nullable":true},"customerId":{"type":"integer","format":"int32","nullable":true},"deadLine":{"type":"string","format":"date-time","nullable":true},"assignedDate":{"type":"string","format":"date-time","nullable":true},"acceptedDate":{"type":"string","format":"date-time","nullable":true},"refusedDate":{"type":"string","format":"date-time","nullable":true},"convertedDate":{"type":"string","format":"date-time","nullable":true},"abandonedDate":{"type":"string","format":"date-time","nullable":true},"status":{"$ref":"#/components/schemas/LeadStatus"},"partnerName":{"type":"string","nullable":true},"dealName":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"source":{"$ref":"#/components/schemas/DataSource"},"transferredLeadId":{"type":"integer","format":"int32","nullable":true},"currency":{"type":"string","nullable":true},"ownerUserId":{"type":"integer","format":"int32","nullable":true},"owner":{"$ref":"#/components/schemas/UserDto"}},"additionalProperties":false},"DataSource":{"enum":["Unknown","Website","Partner","Api","Zapier","Tenant","System","HubSpot","Stripe","PartnerDirectory","Salesforce","Mcp"],"type":"string"},"UserDto":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"email":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/v3/leads":{"post":{"tags":["Leads"],"summary":"Create lead","description":"Create a new lead.\r\n   \r\nYou can assigned the lead with an existing partner using the `partnerId` property. You will be the source of the lead and the partner will have to\r\naccept or refuse the lead.\r\n  \r\nYou can set the source of the lead using the `sourcePartnerId` property. By doing that, you create the lead on behalf of the partner.\r\nHe won't have to accept or refuse the lead, the lead will be automatically accepted.\r\n \r\nUse the `note` property to add a new note on create lead.\r\n  \r\nIf the lead comes from your website via a referral link shared by a partner and you want to associate it with the correct partner, use the HTTP header:  \r\n`Kiflo-Tracking-Code: AABBCCDDEEFF+=`  \r\n \r\nThe** tracking code** can be retrieved in javascript from your website using the JS SDK.Please referer to the[JS SDK documentation](https://docs.kiflo.com/category/26-js-sdk).\r\n \r\nThe `status` property is optional and can be used only in conjunction with the header parameter `Kiflo-Tracking-Code`.\r\nIt can be one of the following value:\r\n- **Pending**: the lead is assigned to the source partner and must be validated by you\r\n- **Accepted**: the lead is assigned to the source partner and is automatically accepted\r\n- **Unassigned**: the lead is not assigned to any partner, but the source partner is set correctly. it can be shared to another partner manually","requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/LeadCreateRequestDto"}},"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreateRequestDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/LeadCreateRequestDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/LeadCreateRequestDto"}}}},"responses":{"200":{"description":"Lead created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadDto"}}}},"400":{"description":"Invalid request"},"403":{"description":"Partner program settings do not grant access to leads"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-vnext.kiflo.com/developers/api-reference/leads/create-lead.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
