Leads
GET
Responses
200
Leads retrieved successfully
application/json
403
Access denied
application/json
get
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"
}
]
}
]
}
Responses
200
Leads retrieved successfully
application/json
403
Access denied
application/json
get
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"
}
]
}
]
Path parameters
idstringRequired
Responses
200
Lead retrieved successfully
application/json
403
Access denied
application/json
404
Lead not found
application/json
get
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"
}
]
}
Responses
200
Lead statuses retrieved successfully
application/json
403
Access denied
application/json
get
GET /leads/statuses HTTP/1.1
Host:
Accept: */*
{
"statuses": [
{
"id": 1,
"name": "New",
"primaryColor": "blue",
"secondaryColor": "lightblue"
}
],
"colors": [
"blue"
]
}
Responses
200
Leads volume retrieved successfully
application/json
403
Access denied
application/json
get
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
}
Responses
200
Total leads counted successfully
application/json
403
Access denied
application/json
get
GET /leads/total-leads HTTP/1.1
Host:
Accept: */*
{
"name": "New",
"current": 10,
"percentageChange": 10,
"color": "blue",
"backgroundColor": "lightblue"
}
Responses
200
Recent leads found successfully
application/json
403
Access denied
application/json
get
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"
}
]
}
]
Path parameters
idnumberRequired
Responses
200
Logs retrieved successfully
application/json
400
Invalid lead ID
application/json
403
Access denied
application/json
404
Lead not found
application/json
get
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"
}
]
}
Path parameters
idnumberRequired
Responses
200
Logs and comments retrieved successfully
application/json
400
Invalid lead ID
application/json
403
Access denied
application/json
404
Lead not found
application/json
get
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
Body
firstNamestringRequiredExample:
John
lastNamestringRequiredExample:
Doe
businessnumber[]RequiredExample:
[1,2,3]
photostringRequiredExample:
photo.jpg
statestring · enumRequiredExample:
Active
Possible values: statusIdnumberRequiredExample:
1
sourcestringRequiredExample:
Referral
phoneNumberstring[]RequiredExample:
["123-456-7890"]
emailstringRequiredExample:
john.doe@example.com
descriptionstringRequiredExample:
Lead description
locationstringRequiredExample:
New York
positionstringRequiredExample:
Manager
companystringRequiredExample:
Company Name
Responses
201
Lead created successfully
application/json
400
Email already exists
application/json
404
No lead status found
application/json
500
Internal server error
application/json
post
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"
}
]
}
Body
namestringRequiredExample:
New
primaryColorstring · enumRequiredExample:
blue
Possible values: Responses
201
Lead status created successfully
application/json
400
Lead status already exists
application/json
500
Internal server error
application/json
post
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"
}
Body
idnumberOptionalExample:
1
photostring · binaryOptional
Responses
200
Photo uploaded successfully
application/json
ResponsestringExample:
formatted_file_name.jpg
400
Invalid file
application/json
403
Access denied
application/json
post
POST /leads/upload-photo HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 25
{
"id": 1,
"photo": "binary"
}
formatted_file_name.jpg
Path parameters
idnumberRequired
Body
contentstringOptionalExample:
This is a comment.
Responses
201
Comment added successfully
application/json
400
Invalid lead ID
application/json
403
Access denied
application/json
404
Lead not found
application/json
post
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
Body
idsnumber[]OptionalExample:
[1,2,3]
Responses
200
Leads archived successfully
application/json
ResponseanyExample:
{"message":"Leads archived successfully","description":"The leads have been archived successfully."}
400
One or more leads not found
application/json
403
Access denied
application/json
500
Internal server error
application/json
patch
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."
}
Body
idsnumber[]OptionalExample:
[1,2,3]
Responses
200
Leads restored successfully
application/json
ResponseanyExample:
{"message":"Leads restored successfully","description":"The leads have been restored successfully."}
400
One or more leads not found
application/json
403
Access denied
application/json
500
Internal server error
application/json
patch
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
Path parameters
idstringRequired
Body
firstNamestring | nullableRequiredExample:
John
lastNamestring | nullableRequiredExample:
Doe
businessnumber[]RequiredExample:
[1,2,3]
photostring | nullableRequiredExample:
photo.jpg
statestring · enum | nullableRequiredExample:
Active
Possible values: 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
positionstring | nullableRequiredExample:
Manager
companystring | nullableRequiredExample:
Company Name
Responses
200
Lead updated successfully
application/json
400
Invalid lead data
application/json
403
Access denied
application/json
404
Lead not found
application/json
put
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"
}
]
}
Body
idsnumber[]RequiredExample:
[1,2,3]
statusIdnumberRequiredExample:
1
Responses
200
Lead statuses updated successfully
application/json
400
Invalid status ID
application/json
403
Access denied
application/json
404
Lead not found
application/json
put
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"
}
]
Path parameters
idstringRequired
Body
namestring | nullableRequiredExample:
New
primaryColorstring · enum | nullableRequiredExample:
blue
Possible values: Responses
200
Lead status updated successfully
application/json
400
Lead status not found
application/json
500
Internal server error
application/json
put
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"
}
Bodyobject[]
idnumberOptionalExample:
1
statusOrdernumberOptionalExample:
1
Responses
200
Lead statuses order updated successfully
application/json
500
Internal server error
application/json
put
PUT /leads/statuses/order HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"id": 1,
"statusOrder": 1
}
[
{
"id": 1,
"statusOrder": 1
}
]
Path parameters
idnumberRequired
Body
contentstringOptionalExample:
This is an edited comment.
Responses
200
Comment edited successfully
application/json
400
Invalid comment ID
application/json
403
Access denied
application/json
404
Comment not found
application/json
put
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
Body
idsnumber[]OptionalExample:
[1,2,3]
Responses
200
Leads deleted successfully
application/json
ResponseanyExample:
{"message":"Leads deleted successfully","description":"The leads have been deleted successfully."}
400
One or more leads not found
application/json
403
Access denied
application/json
500
Internal server error
application/json
delete
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."
}
Path parameters
fileNamestringRequired
Responses
200
Photo deleted successfully
application/json
ResponseanyExample:
{"message":"Photo deleted successfully","description":"The photo has been deleted successfully."}
404
Lead not found
application/json
delete
DELETE /leads/delete-photo/{fileName} HTTP/1.1
Host:
Accept: */*
{
"message": "Photo deleted successfully",
"description": "The photo has been deleted successfully."
}
Path parameters
idstringRequired
Responses
200
Lead status deleted successfully
application/json
ResponseanyExample:
{"message":"Lead status deleted successfully","description":"The lead status has been deleted successfully."}
400
Cannot delete status
application/json
500
Internal server error
application/json
delete
DELETE /leads/status/{id} HTTP/1.1
Host:
Accept: */*
{
"message": "Lead status deleted successfully",
"description": "The lead status has been deleted successfully."
}
Last updated