List the contacts
POST
/contact/list
const url = 'https://api.aelyst.ai/v1/contact/list?limit=10';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"search":"","filter":{"$and":[]},"timezone":"Asia/Kuala_Lumpur"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.aelyst.ai/v1/contact/list?limit=10' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "search": "", "filter": { "$and": [] }, "timezone": "Asia/Kuala_Lumpur" }'List all available contacts. You can use filters in the request body to limit the results to only records with matching contact field values.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”limit
integer
Number of contacts to return i.e. page size.
cursorId
integer
Pointer to the contact id from where the next batch of records should start from.
Request Body
Section titled “Request Body”Media typeapplication/json
object
search
string
timezone
string
filter
One of: discriminator: pet_type
$and
object
$and
Array<object>
object
category
string
field
string
operator
string
value
One of:
string
Array<string>
object
to
string
from
string
$or
object
$or
Array<object>
object
category
string
field
string
operator
string
value
One of:
string
Array<string>
object
to
string
from
string
Examples
{ "search": "", "filter": { "$and": [] }, "timezone": "Asia/Kuala_Lumpur"}{ "search": "", "filter": { "$and": [ { "category": "contactField", "field": "assigneeUserId", "operator": "isEqualTo", "value": null } ] }, "timezone": "Asia/Kuala_Lumpur"}{ "search": "", "filter": { "$and": [ { "category": "contactField", "field": "assigneeUserId", "operator": "isEqualTo", "value": "User Id" } ] }, "timezone": "Asia/Kuala_Lumpur"}{ "search": "", "filter": { "$and": [ { "category": "contactTag", "field": null, "operator": "hasAnyOf", "value": [ "B" ] } ] }, "timezone": "Asia/Kuala_Lumpur"}{ "search": "john@gmail.com", "filter": { "$and": [] }, "timezone": "Asia/Kuala_Lumpur"}{ "search": "", "filter": { "$and": [ { "category": "lifecycle", "field": null, "operator": "isEqualTo", "value": "New Lead" } ] }, "timezone": "Asia/Kuala_Lumpur"}Responses
Section titled “Responses”Media typeapplication/json
object
items
required
Array
object
id
Contact ID
integer
Any of:
object
firstName
required
string
lastName
string
phone
string
email
string
language
Following the ISO 639-1 standard.
string
profilePic
string
countryCode
Following the ISO 3166-1 alpha-2 standard.
string
custom_fields
Array<object>
object
name
required
string
value
Formatting rules
- Text: “string” (use quotation marks for the string value)
- Number: Number (without any quotation marks)
- Email: “email” (format: user@domain.com)
- URL: “url” (format: www.website.com, https://www.website.com, website.com, http://website.com)
- List: “string” (the string value must match one of the list options)
- Date: “yyyy-mm-dd” (must follow this format)
- Time: “HH:MM” (must follow 24H format, 1PM => 13:00)
- Checkbox: “true/false” (must be true for checked, false for unchecked)
string
status
Conversation status of the contact
string
tags
Array<string>
assignee
User
User to whom the contact is assigned
object
id
required
User ID
integer
firstName
required
string
lastName
required
string
email
required
string format: email
lifecycle
string
created_at
Unix timestamp in seconds representing when the contact was created.
integer
isBlocked
boolean
pagination
object
next
required
string
previous
required
string
Examples
Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 400, "message": "Validation error."}Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 401, "message": "UN_AUTHORIZED"}Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 429, "message": "Too Many Requests"}Headers
Section titled “Headers”Retry-After
number
Example
1Number of seconds until you can retry the request
X-RateLimit-Limit
number
Example
10Number of request allowed for this end point
X-RateLimit-Remaining
number
Example
5Number of request remaining for this end point
Media typeapplication/json
object
code
integer
message
string
Example
{ "code": 500, "message": "Unexpected error occurred"}