Leads
GET
Leads retrieved successfully
Access denied
GET /leads HTTP/1.1
Host:
Accept: */*
{
"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"
}
]
}
]
}
Leads retrieved successfully
Access denied
GET /leads/search HTTP/1.1
Host:
Accept: */*
[
{
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": [
"123-456-7890"
],
"status": "New",
"business": [
{
"id": 1,
"name": "Business Name"
}
]
}
]
Lead retrieved successfully
Access denied
Lead not found
GET /leads/{id} HTTP/1.1
Host:
Accept: */*
{
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": [
"123-456-7890"
],
"status": "New",
"business": [
{
"id": 1,
"name": "Business Name"
}
]
}
Lead statuses retrieved successfully
Access denied
GET /leads/statuses HTTP/1.1
Host:
Accept: */*
{
"statuses": [
{
"id": 1,
"name": "New",
"primaryColor": "blue",
"secondaryColor": "lightblue"
}
],
"colors": [
"blue"
]
}
Leads volume retrieved successfully
Access denied
GET /leads/leads-volume HTTP/1.1
Host:
Accept: */*
{
"labels": [
"2023-01-01",
"2023-01-02"
],
"data": {
"ANY_ADDITIONAL_PROPERTY": {
"ANY_ADDITIONAL_PROPERTY": 10
}
},
"totalLeadsAmount": 100,
"percentageChange": 10
}
Total leads counted successfully
Access denied
GET /leads/total-leads HTTP/1.1
Host:
Accept: */*
{
"name": "New",
"current": 10,
"percentageChange": 10,
"color": "blue",
"backgroundColor": "lightblue"
}
Recent leads found successfully
Access denied
GET /leads/recent-leads HTTP/1.1
Host:
Accept: */*
[
{
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": [
"123-456-7890"
],
"status": "New",
"business": [
{
"id": 1,
"name": "Business Name"
}
]
}
]
Logs retrieved successfully
Invalid lead ID
Access denied
Lead not found
GET /leads/logs/{id} HTTP/1.1
Host:
Accept: */*
{
"count": 5,
"logs": [
{
"id": 1,
"action": "CreateLead",
"entityType": "Lead",
"user": {
"id": 1,
"email": "user@example.com"
},
"createdAt": "2023-01-01T00:00:00Z"
}
]
}
Logs and comments retrieved successfully
Invalid lead ID
Access denied
Lead not found
GET /leads/logs-and-comments/{id} HTTP/1.1
Host:
Accept: */*
{
"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
John
Doe
[1,2,3]
photo.jpg
Active
Possible values: 1
Referral
["123-456-7890"]
john.doe@example.com
Lead description
New York
Manager
Company Name
Lead created successfully
Email already exists
No lead status found
Internal server error
POST /leads HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 427
{
"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"
}
]
}
New
blue
Possible values: Lead status created successfully
Lead status already exists
Internal server error
POST /leads/status HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"name": "New",
"primaryColor": "blue"
}
{
"id": 1,
"name": "New",
"primaryColor": "blue",
"secondaryColor": "lightblue"
}
1
Photo uploaded successfully
formatted_file_name.jpg
Invalid file
Access denied
POST /leads/upload-photo HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 25
{
"id": 1,
"photo": "binary"
}
formatted_file_name.jpg
This is a comment.
Comment added successfully
Invalid lead ID
Access denied
Lead not found
POST /leads/comments/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 32
{
"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
[1,2,3]
Leads archived successfully
{"message":"Leads archived successfully","description":"The leads have been archived successfully."}
One or more leads not found
Access denied
Internal server error
PATCH /leads/archive HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}
{
"message": "Leads archived successfully",
"description": "The leads have been archived successfully."
}
[1,2,3]
Leads restored successfully
{"message":"Leads restored successfully","description":"The leads have been restored successfully."}
One or more leads not found
Access denied
Internal server error
PATCH /leads/restore HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}
{
"message": "Leads restored successfully",
"description": "The leads have been restored successfully."
}
PUT
John
Doe
[1,2,3]
photo.jpg
Active
Possible values: 1
Referral
["123-456-7890"]
john.doe@example.com
Lead description
New York
Manager
Company Name
Lead updated successfully
Invalid lead data
Access denied
Lead not found
PUT /leads/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 427
{
"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"
}
]
}
[1,2,3]
1
Lead statuses updated successfully
Invalid status ID
Access denied
Lead not found
PUT /leads/change-status HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"ids": [
1,
2,
3
],
"statusId": 1
}
[
{
"id": 1,
"status": "Updated Status"
}
]
New
blue
Possible values: Lead status updated successfully
Lead status not found
Internal server error
PUT /leads/status/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"name": "New",
"primaryColor": "blue"
}
{
"id": 1,
"name": "Updated Status",
"primaryColor": "green",
"secondaryColor": "lightgreen"
}
1
1
Lead statuses order updated successfully
Internal server error
PUT /leads/statuses/order HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"id": 1,
"statusOrder": 1
}
[
{
"id": 1,
"statusOrder": 1
}
]
This is an edited comment.
Comment edited successfully
Invalid comment ID
Access denied
Comment not found
PUT /leads/comments/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"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
[1,2,3]
Leads deleted successfully
{"message":"Leads deleted successfully","description":"The leads have been deleted successfully."}
One or more leads not found
Access denied
Internal server error
DELETE /leads HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}
{
"message": "Leads deleted successfully",
"description": "The leads have been deleted successfully."
}
Photo deleted successfully
{"message":"Photo deleted successfully","description":"The photo has been deleted successfully."}
Lead not found
DELETE /leads/delete-photo/{fileName} HTTP/1.1
Host:
Accept: */*
{
"message": "Photo deleted successfully",
"description": "The photo has been deleted successfully."
}
Lead status deleted successfully
{"message":"Lead status deleted successfully","description":"The lead status has been deleted successfully."}
Cannot delete status
Internal server error
DELETE /leads/status/{id} HTTP/1.1
Host:
Accept: */*
{
"message": "Lead status deleted successfully",
"description": "The lead status has been deleted successfully."
}
Last updated