π Create a New Lead Using API
API usage example for creating a Lead with Agency Handy API
Prerequisites
Review the steps in the Getting Started guide before updating an order. It walks through configuring your API token, and selecting the correct companyid, which are all required for the instructions below.
Step 1: Get Client Role ID
π Endpoint:
{{URL}}/roles?type=company
π οΈ Set Headers:
x-api-key: <API_KEY>
companyid: <COMPANY_ID>π₯ Response Example:
{
"roles": [
{
"_id": "6525994184e9ddd798534535",
"role": {
"_id": "6525994184e9ddd79853451e",
"responsibility": "",
"name": "client"
},
"company": "6525994184e9ddd79853450e",
"createdAt": "2023-10-10T18:34:41.567Z",
"updatedAt": "2024-10-01T07:28:48.340Z",
"__v": 0,
"type": "company"
}
]
}π What to Do:
Find the role where
roles[0].role.name === "client".Extract and store the Client Role ID:
Important: Ensure you do not copy
_idfromroles[0].role, but fromroles[0]itself.
Step 2: Create a New Lead
π Endpoint:
{{URL}}/company/{{companyId}}/members/bulk-client
π οΈ Set Headers:
π¦ Request Body:
β
Success Response:
β Important Tips:
Ensure
"isConvertedClient": falseis set in the request.Use the correct Role ID from Step 3.
Last updated
Was this helpful?