Leads

Get all leads for a specific chatflow

Retrieve all leads associated with a specific chatflow

GET/leads/{id}
Authorization
Path parameters
id*string

Chatflow ID

Response

Successful operation

Body
idstring (uuid)

Unique identifier for the lead

Example: "cfd531e0-82fc-11e9-bc42-526af7764f64"
namestring

Name of the lead

Example: "John Doe"
emailstring

Email address of the lead

Example: "john.doe@example.com"
phonestring

Phone number of the lead

Example: "+1234567890"
chatflowidstring

ID of the chatflow the lead is associated with

Example: "7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02"
chatIdstring

ID of the chat session the lead is associated with

Example: "d7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b"
createdDatestring (date-time)

Date and time when the lead was created

Example: "2024-08-24T14:15:22Z"
Request
const response = await fetch('/leads/{id}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer JWT"
    },
});
const data = await response.json();
Response
[
  {
    "id": "cfd531e0-82fc-11e9-bc42-526af7764f64",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+1234567890",
    "chatflowid": "7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02",
    "chatId": "d7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b",
    "createdDate": "2024-08-24T14:15:22Z"
  }
]

Create a new lead in a chatflow

Create a new lead associated with a specific chatflow

POST/leads
Authorization
Body
idstring (uuid)

Unique identifier for the lead

Example: "cfd531e0-82fc-11e9-bc42-526af7764f64"
namestring

Name of the lead

Example: "John Doe"
emailstring

Email address of the lead

Example: "john.doe@example.com"
phonestring

Phone number of the lead

Example: "+1234567890"
chatflowidstring

ID of the chatflow the lead is associated with

Example: "7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02"
chatIdstring

ID of the chat session the lead is associated with

Example: "d7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b"
createdDatestring (date-time)

Date and time when the lead was created

Example: "2024-08-24T14:15:22Z"
Response

Lead created successfully

Body
idstring (uuid)

Unique identifier for the lead

Example: "cfd531e0-82fc-11e9-bc42-526af7764f64"
namestring

Name of the lead

Example: "John Doe"
emailstring

Email address of the lead

Example: "john.doe@example.com"
phonestring

Phone number of the lead

Example: "+1234567890"
chatflowidstring

ID of the chatflow the lead is associated with

Example: "7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02"
chatIdstring

ID of the chat session the lead is associated with

Example: "d7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b"
createdDatestring (date-time)

Date and time when the lead was created

Example: "2024-08-24T14:15:22Z"
Request
const response = await fetch('/leads', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "id": "cfd531e0-82fc-11e9-bc42-526af7764f64",
  "name": "John Doe",
  "email": "john.doe@example.com",
  "phone": "+1234567890",
  "chatflowid": "7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02",
  "chatId": "d7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b",
  "createdDate": "2024-08-24T14:15:22Z"
}

Last updated