Dashboard
Settings
- Account Details
- Internationalization
- User Management
- API Apps
- Role-Based Access Control (RBAC)
- Webhooks
Customers
Search for customer
Using this endpoint, you can search for customers based on filter conditions. By specifying offset
and limit
, you can narrow down your search results. In addition, using the isDelete
property in the request body, you can filter for either deleted or non-deleted customers.
curl --request POST \
--url https://api.fabric.inc/v3/customers/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"sort": "+firstName,-createdAt",
"match": {
"id": {
"op": "IN",
"value": "61df41892bf06d00092d0d8a"
},
"firstName": {
"op": "IN",
"value": "Pat"
},
"lastName": {
"op": "IN",
"value": "Kake"
},
"emailAddress": {
"op": "IN",
"value": "pat.kake@example.com"
},
"externalId": {
"op": "IN",
"value": "1231012312-312-31231asda"
},
"createdAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"updatedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"deletedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"status": {
"op": "IN",
"value": "ACTIVE"
},
"additionalAttributes": {
"op": "IN",
"value": "beach",
"key": "gps"
},
"isDeleted": false
},
"offset": 0,
"limit": 10
}'
{
"query": {
"offset": 0,
"limit": 20,
"count": 100
},
"data": [
{
"id": "61df41892bf06d00092d0d8a",
"name": {
"title": "Dr.",
"firstName": "Pat",
"middleName": "E",
"lastName": "Doe",
"suffix": "Jr."
},
"status": "ACTIVE",
"emailAddress": "test@example.com",
"phone": {
"number": 15555551234,
"type": "MOBILE"
},
"externalId": "1231012312-312-31231asda",
"additionalAttributes": {
"middleName": "user"
},
"isDeleted": false,
"deletedAt": "2023-08-30T23:20:42.822Z",
"createdAt": "2023-08-30T23:20:42.822Z",
"updatedAt": "2023-08-30T23:20:42.822Z"
}
]
}
Authorizations
The access token.
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
A UUID of the request.
Body
The criteria to search for customers.
match
The criteria to search for customers based on their first name.
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN
, NOT_IN
, EQUALS
, CONTAINS
, NOT_EQUALS
The customer's first name.
The criteria to search for customers based on their last name.
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN
, NOT_IN
, EQUALS
, CONTAINS
, NOT_EQUALS
The customer's last name.
The criteria to search for customers based on their email.
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN
, NOT_IN
, EQUALS
, CONTAINS
, NOT_EQUALS
The customer's email address.
The criteria to search for customers or their addresses based on a specific creation date or within a creation date range.
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS
, LTE
, GTE
, GT
, LT
, RANGE
The time of creation, in UTC format.
The starting value of the creation date range. This is used with the endCreatedAt
property.
The ending value of the creation date range. This is used with the startCreatedAt
property.
The criteria to search for customers or their addresses based on a specific date or date range in which the record was updated.
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS
, LTE
, GTE
, GT
, LT
, RANGE
The time of last update, in UTC format.
The starting value of the updatedAt
date range. This is used with the endUpdatedAt
property.
The ending value of the updatedAt
date range. This is used with the startUpdatedAt
property.
The criteria to search for customers or their addresses based on a specific deletion date or within a deletion date range.
The type of search operation, such as equals, less than (LT), greater than (GT), less than or equal to (LTE), greater than or equal to (GTE), or within a specified range.
EQUALS
, LTE
, GTE
, GT
, LT
, RANGE
The time of deletion, in UTC format.
The starting value of the deletedAt
date range. This is used with the endDeletedAt
property.
The ending value of the deletedAt
date range. This is used with the startDeletedAt
property.
The criteria to search for customers based on their account status.
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN
, NOT_IN
, EQUALS
, CONTAINS
, NOT_EQUALS
The customer's account status.
ACTIVE
, INACTIVE
, BLOCKED
The criteria to search for customers or their addresses based on additional attributes.
The type of search operation. Multiple values, separated by commas, can be used for the IN and NOT_IN operations, while only a single value can be used for the EQUALS, CONTAINS, and NOT_EQUALS operations.
IN
, NOT_IN
, EQUALS
, CONTAINS
, NOT_EQUALS
The key for the additional attribute. This should be the field name given in the additionalAttributes
schema.
The value of the string.
A flag indicating whether the search results should include only deleted addresses. Set to true
to include only deleted addresses and false
to exclude deleted addresses.
The criteria to sort results, where -
indicates a descending order and +
indicates an ascending order. You can sort the following fields - createdAt
, updatedAt
, firstName
, lastName
, status
, and emailAddress
.
The number of records to skip before returning records. For example, when offset is 20 and limit's 10, this endpoint returns records from 21 to 30.
The maximum number of records in a single page.
Response
The list of customers.
The pagination criteria.
The number of records to skip before returning records. For example, when offset is 20 and limit's 10, you get records from 21 to 30. When they're not specified, you get up to 10 records.
The maximum number of records per page.
The total number of records in the response.
A 24-character system-generated customer ID.
The full name of the customer.
The customer's first name.
The customer's last name.
The customer's title, such as Mr., Mrs, and Dr.
The customer's middle name.
The suffix for the customer's name, such as Jr., PhD, and more.
The customer's email.
A flag indicating whether the customer data is deleted. true
indicates the customer data is deleted and false
indicates otherwise.
The time when the customer was added, in UTC format.
The time when the customer details were last updated, in UTC format.
The status of the customer.
ACTIVE
, INACTIVE
, BLOCKED
A UUID of the customer.
A placeholder for additional info, in key-value pairs.
The time when the customer data was deleted, in UTC format.
Was this page helpful?
curl --request POST \
--url https://api.fabric.inc/v3/customers/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"sort": "+firstName,-createdAt",
"match": {
"id": {
"op": "IN",
"value": "61df41892bf06d00092d0d8a"
},
"firstName": {
"op": "IN",
"value": "Pat"
},
"lastName": {
"op": "IN",
"value": "Kake"
},
"emailAddress": {
"op": "IN",
"value": "pat.kake@example.com"
},
"externalId": {
"op": "IN",
"value": "1231012312-312-31231asda"
},
"createdAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"updatedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"deletedAt": {
"op": "LTE",
"value": "2023-08-30T23:20:42.822Z"
},
"status": {
"op": "IN",
"value": "ACTIVE"
},
"additionalAttributes": {
"op": "IN",
"value": "beach",
"key": "gps"
},
"isDeleted": false
},
"offset": 0,
"limit": 10
}'
{
"query": {
"offset": 0,
"limit": 20,
"count": 100
},
"data": [
{
"id": "61df41892bf06d00092d0d8a",
"name": {
"title": "Dr.",
"firstName": "Pat",
"middleName": "E",
"lastName": "Doe",
"suffix": "Jr."
},
"status": "ACTIVE",
"emailAddress": "test@example.com",
"phone": {
"number": 15555551234,
"type": "MOBILE"
},
"externalId": "1231012312-312-31231asda",
"additionalAttributes": {
"middleName": "user"
},
"isDeleted": false,
"deletedAt": "2023-08-30T23:20:42.822Z",
"createdAt": "2023-08-30T23:20:42.822Z",
"updatedAt": "2023-08-30T23:20:42.822Z"
}
]
}