How to create Lead via API
π Create a New Lead Using API
Step 1: Generate an API Key
Go to:
Copy
{{workspaceUrl}}/workspace-config?tab=api-keyGenerate and Copy the API key.
Step 2: Get Company ID
π Endpoint:
Copy
{{URL}}/accounts/companiesπ οΈ Set Headers:
Copy
x-api-key = api KeyYou'll get a response like this
Copy
{
"message": "Companies accosiated with API token.",
"companies": [
{
"_id": "6525994184e9ddd79853450e",
"name": "onethread123",
"logo": "",
"extraSmallLogo": "",
"largeLogo": ""
}
]
}π What to Do:
Get the company ID from the response:
Copy
Store the ID for later:
Copy
Step 3: Get Client Role ID
π Endpoint:
Copy
π οΈ Set Headers:
Copy
You'll get a response like this
Copy
π What to Do:
Find the role with "client" name:
Copy
Store the Client Role ID:
Copy
Make sure that you did not copy the _id of roles[0].role object
Step 4: Create a New Lead
π Endpoint:
Copy
π οΈ Headers:
Copy
π¦ Request Body:
Copy
β Success Response:
Copy
β Important Tips:
Make sure
"isConvertedClient": falseis set in the request.Use the correct Role ID from Step 3.
Last updated
Was this helpful?