Leads

GET

Retrieves all leads for the authenticated user's team.

get
Responses
curl -L \
  --url '/leads'
{
  "count": 10,
  "leads": [
    {
      "id": 1,
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com",
      "phoneNumber": [
        "123-456-7890"
      ],
      "status": "New",
      "business": [
        {
          "id": 1,
          "name": "Business Name"
        }
      ]
    }
  ]
}
get
Responses
curl -L \
  --url '/leads/search'
[
  {
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com",
    "phoneNumber": [
      "123-456-7890"
    ],
    "status": "New",
    "business": [
      {
        "id": 1,
        "name": "Business Name"
      }
    ]
  }
]

Retrieves a lead by its ID.

get
Path parameters
idstringrequired
Responses
curl -L \
  --url '/leads/{id}'
{
  "id": 1,
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@example.com",
  "phoneNumber": [
    "123-456-7890"
  ],
  "status": "New",
  "business": [
    {
      "id": 1,
      "name": "Business Name"
    }
  ]
}

Retrieves lead statuses for the authenticated user's team.

get
Responses
curl -L \
  --url '/leads/statuses'
{
  "statuses": [
    {
      "id": 1,
      "name": "New",
      "primaryColor": "blue",
      "secondaryColor": "lightblue"
    }
  ],
  "colors": [
    "blue"
  ]
}

Retrieves the volume of leads per business per day.

get
Responses
curl -L \
  --url '/leads/leads-volume'
{
  "labels": [
    "2023-01-01",
    "2023-01-02"
  ],
  "data": {
    "ANY_ADDITIONAL_PROPERTY": {
      "ANY_ADDITIONAL_PROPERTY": 10
    }
  },
  "totalLeadsAmount": 100,
  "percentageChange": 10
}

Counts the total number of leads over a specified period.

get
Responses
curl -L \
  --url '/leads/total-leads'
{
  "name": "New",
  "current": 10,
  "percentageChange": 10,
  "color": "blue",
  "backgroundColor": "lightblue"
}

Finds the five most recent leads over a specified period.

get
Responses
curl -L \
  --url '/leads/recent-leads'
[
  {
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com",
    "phoneNumber": [
      "123-456-7890"
    ],
    "status": "New",
    "business": [
      {
        "id": 1,
        "name": "Business Name"
      }
    ]
  }
]

Retrieves the number of leads per business over a specified period.

get
Responses
curl -L \
  --url '/leads/leads-per-business'
{
  "ANY_ADDITIONAL_PROPERTY": 10
}

Retrieves a photo for a lead by its file name.

get
Path parameters
fileNamestringrequired
Responses
curl -L \
  --url '/leads/get-photo/{fileName}'
binary

Retrieves logs for a lead by its ID.

get
Path parameters
idnumberrequired
Responses
curl -L \
  --url '/leads/logs/{id}'
{
  "count": 5,
  "logs": [
    {
      "id": 1,
      "action": "CreateLead",
      "entityType": "Lead",
      "user": {
        "id": 1,
        "email": "user@example.com"
      },
      "createdAt": "2023-01-01T00:00:00Z"
    }
  ]
}

Retrieves logs and comments for a lead by its ID.

get
Path parameters
idnumberrequired
Responses
curl -L \
  --url '/leads/logs-and-comments/{id}'
{
  "logsAndComments": [
    {
      "id": 1,
      "action": "CreateLead",
      "entityType": "Lead",
      "user": {
        "id": 1,
        "email": "user@example.com"
      },
      "content": "This is a comment.",
      "createdAt": "2023-01-01T00:00:00Z"
    }
  ],
  "logsCount": 5,
  "commentsCount": 5
}

POST

Creates a new lead.

post
Body
firstNamestringrequiredExample: John
lastNamestringrequiredExample: Doe
businessnumber[]requiredExample: [1,2,3]
photostringrequiredExample: photo.jpg
statestring · enumrequiredExample: ActiveAvailable options:
statusIdnumberrequiredExample: 1
sourcestringrequiredExample: Referral
phoneNumberstring[]requiredExample: ["123-456-7890"]
emailstringrequiredExample: john.doe@example.com
descriptionstringrequiredExample: Lead description
locationstringrequiredExample: New York
socialMediaobjectrequired

positionstringrequiredExample: Manager
companystringrequiredExample: Company Name
Responses
curl -L \
  --request POST \
  --url '/leads' \
  --header 'Content-Type: application/json' \
  --data '{
    "firstName": "John",
    "lastName": "Doe",
    "business": [
      1,
      2,
      3
    ],
    "photo": "photo.jpg",
    "state": "Active",
    "statusId": 1,
    "source": "Referral",
    "phoneNumber": [
      "123-456-7890"
    ],
    "email": "john.doe@example.com",
    "description": "Lead description",
    "location": "New York",
    "socialMedia": {
      "youtube": "youtube.com/lead",
      "facebook": "facebook.com/lead",
      "instagram": "instagram.com/lead",
      "twitter": "twitter.com/lead"
    },
    "position": "Manager",
    "company": "Company Name"
  }'
{
  "id": 1,
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@example.com",
  "phoneNumber": [
    "123-456-7890"
  ],
  "status": "New",
  "business": [
    {
      "id": 1,
      "name": "Business Name"
    }
  ]
}

Creates a new lead status for the authenticated user's team.

post
Body
namestringrequiredExample: New
primaryColorstring · enumrequiredExample: blueAvailable options:
Responses
curl -L \
  --request POST \
  --url '/leads/status' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New",
    "primaryColor": "blue"
  }'
{
  "id": 1,
  "name": "New",
  "primaryColor": "blue",
  "secondaryColor": "lightblue"
}

Uploads a photo for a lead.

post
Body
idnumberoptionalExample: 1
photostring · binaryoptional
Responses
curl -L \
  --request POST \
  --url '/leads/upload-photo' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": 1,
    "photo": "binary"
  }'
formatted_file_name.jpg

Leaves a comment on a lead.

post
Path parameters
idnumberrequired
Body
contentstringoptionalExample: This is a comment.
Responses
curl -L \
  --request POST \
  --url '/leads/comments/{id}' \
  --header 'Content-Type: application/json' \
  --data '{
    "content": "This is a comment."
  }'
{
  "id": 1,
  "content": "This is a comment.",
  "user": {
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "user@example.com"
  },
  "createdAt": "2023-01-01T00:00:00Z"
}

PATCH

Archives multiple leads.

patch
Body
idsnumber[]optionalExample: [1,2,3]
Responses
curl -L \
  --request PATCH \
  --url '/leads/archive' \
  --header 'Content-Type: application/json' \
  --data '{
    "ids": [
      1,
      2,
      3
    ]
  }'
{
  "message": "Leads archived successfully",
  "description": "The leads have been archived successfully."
}

Restores multiple archived leads.

patch
Body
idsnumber[]optionalExample: [1,2,3]
Responses
curl -L \
  --request PATCH \
  --url '/leads/restore' \
  --header 'Content-Type: application/json' \
  --data '{
    "ids": [
      1,
      2,
      3
    ]
  }'
{
  "message": "Leads restored successfully",
  "description": "The leads have been restored successfully."
}

PUT

Updates a lead by its ID.

put
Path parameters
idstringrequired
Body
firstNamestring | nullablerequiredExample: John
lastNamestring | nullablerequiredExample: Doe
businessnumber[]requiredExample: [1,2,3]
photostring | nullablerequiredExample: photo.jpg
statestring · enum | nullablerequiredExample: ActiveAvailable options:
statusIdnumber | nullablerequiredExample: 1
sourcestring | nullablerequiredExample: Referral
phoneNumberstring[] | nullablerequiredExample: ["123-456-7890"]
emailstring | nullableoptionalExample: john.doe@example.com
descriptionstring | nullablerequiredExample: Lead description
locationstring | nullablerequiredExample: New York
socialMediaobjectrequired

positionstring | nullablerequiredExample: Manager
companystring | nullablerequiredExample: Company Name
Responses
curl -L \
  --request PUT \
  --url '/leads/{id}' \
  --header 'Content-Type: application/json' \
  --data '{
    "firstName": "John",
    "lastName": "Doe",
    "business": [
      1,
      2,
      3
    ],
    "photo": "photo.jpg",
    "state": "Active",
    "statusId": 1,
    "source": "Referral",
    "phoneNumber": [
      "123-456-7890"
    ],
    "email": "john.doe@example.com",
    "description": "Lead description",
    "location": "New York",
    "socialMedia": {
      "youtube": "youtube.com/lead",
      "facebook": "facebook.com/lead",
      "instagram": "instagram.com/lead",
      "twitter": "twitter.com/lead"
    },
    "position": "Manager",
    "company": "Company Name"
  }'
{
  "id": 1,
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@example.com",
  "phoneNumber": [
    "123-456-7890"
  ],
  "status": "Updated Status",
  "business": [
    {
      "id": 1,
      "name": "Business Name"
    }
  ]
}

Changes the status of multiple leads.

put
Body
idsnumber[]requiredExample: [1,2,3]
statusIdnumberrequiredExample: 1
Responses
curl -L \
  --request PUT \
  --url '/leads/change-status' \
  --header 'Content-Type: application/json' \
  --data '{
    "ids": [
      1,
      2,
      3
    ],
    "statusId": 1
  }'
[
  {
    "id": 1,
    "status": "Updated Status"
  }
]

Updates a lead status by its ID.

put
Path parameters
idstringrequired
Body
namestring | nullablerequiredExample: New
primaryColorstring · enum | nullablerequiredExample: blueAvailable options:
Responses
curl -L \
  --request PUT \
  --url '/leads/status/{id}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New",
    "primaryColor": "blue"
  }'
{
  "id": 1,
  "name": "Updated Status",
  "primaryColor": "green",
  "secondaryColor": "lightgreen"
}

Updates the order of lead statuses.

put
Body
idnumberoptionalExample: 1
statusOrdernumberoptionalExample: 1
Responses
curl -L \
  --request PUT \
  --url '/leads/statuses/order' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": 1,
    "statusOrder": 1
  }'
[
  {
    "id": 1,
    "statusOrder": 1
  }
]

Edits a comment on a lead.

put
Path parameters
idnumberrequired
Body
contentstringoptionalExample: This is an edited comment.
Responses
curl -L \
  --request PUT \
  --url '/leads/comments/{id}' \
  --header 'Content-Type: application/json' \
  --data '{
    "content": "This is an edited comment."
  }'
{
  "id": 1,
  "content": "This is an edited comment.",
  "user": {
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "user@example.com"
  },
  "createdAt": "2023-01-01T00:00:00Z"
}

DELETE

Deletes multiple leads.

delete
Body
idsnumber[]optionalExample: [1,2,3]
Responses
curl -L \
  --request DELETE \
  --url '/leads' \
  --header 'Content-Type: application/json' \
  --data '{
    "ids": [
      1,
      2,
      3
    ]
  }'
{
  "message": "Leads deleted successfully",
  "description": "The leads have been deleted successfully."
}

Deletes a photo for a lead by its file name.

delete
Path parameters
fileNamestringrequired
Responses
curl -L \
  --request DELETE \
  --url '/leads/delete-photo/{fileName}'
{
  "message": "Photo deleted successfully",
  "description": "The photo has been deleted successfully."
}

Deletes a lead status by its ID.

delete
Path parameters
idstringrequired
Responses
curl -L \
  --request DELETE \
  --url '/leads/status/{id}'
{
  "message": "Lead status deleted successfully",
  "description": "The lead status has been deleted successfully."
}

Last updated