πŸš€ 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 _id from roles[0].role, but from roles[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": false is set in the request.

  • Use the correct Role ID from Step 3.

Last updated

Was this helpful?