Customer Insights
Customer insights are critical for understanding customer behavior, preferences, and trends. On this page, we’ll dive into the different customer insights endpoints you can use to manage customer insights programmatically. We'll look at how to query, create, update, and delete customer insights records.
The customer insights model
The customer insights model contains all the information related to customer behavior, preferences, and other valuable insights.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the customer insights record.
- Name
customer_id- Type
- string
- Description
Unique identifier for the customer.
- Name
insight_type- Type
- string
- Description
Type of insight (e.g., purchase behavior, preference).
- Name
details- Type
- string
- Description
Detailed description of the insight.
- Name
created_at- Type
- timestamp
- Description
Timestamp of when the insight was created.
- Name
updated_at- Type
- timestamp
- Description
Timestamp of when the insight was last updated.
List all customer insights
This endpoint allows you to retrieve a paginated list of all your customer insights records. By default, a maximum of ten records are shown per page.
Optional attributes
- Name
limit- Type
- integer
- Description
Limit the number of customer insights records returned.
- Name
customer_id- Type
- string
- Description
Only show records for the specified customer.
- Name
insight_type- Type
- string
- Description
Only show records with the specified insight type.
Request
curl -G https://api.finx.ai/v1/customer-insights \
-H "Authorization: Bearer {token}" \
-d limit=10
Response
{
"has_more": false,
"data": [
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"insight_type": "purchase_behavior",
"details": "Customer frequently purchases electronics.",
"created_at": 705103200,
"updated_at": 705103200
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
}
]
}
Create a customer insight
This endpoint allows you to add a new customer insight. You need to provide the customer ID, insight type, and details to create a customer insight record.
Required attributes
- Name
customer_id- Type
- string
- Description
Unique identifier for the customer.
- Name
insight_type- Type
- string
- Description
Type of insight (e.g., purchase behavior, preference).
- Name
details- Type
- string
- Description
Detailed description of the insight.
Request
curl https://api.finx.ai/v1/customer-insights \
-H "Authorization: Bearer {token}" \
-d 'customer_id'="WAz8eIbvDR60rouK" \
-d 'insight_type'="purchase_behavior" \
-d 'details'="Customer frequently purchases electronics."
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"insight_type": "purchase_behavior",
"details": "Customer frequently purchases electronics.",
"created_at": 705103200,
"updated_at": 705103200
}
Retrieve a customer insight
This endpoint allows you to retrieve a customer insight record by providing the record id. Refer to the list at the top of this page to see which properties are included with customer insight objects.
Request
curl https://api.finx.ai/v1/customer-insights/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}"
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"insight_type": "purchase_behavior",
"details": "Customer frequently purchases electronics.",
"created_at": 705103200,
"updated_at": 705103200
}
Update a customer insight
This endpoint allows you to perform an update on a customer insight record. Examples of updates are changing the insight type, updating the details, or modifying the customer information.
Optional attributes
- Name
insight_type- Type
- string
- Description
Updated type of insight.
- Name
details- Type
- string
- Description
Updated detailed description of the insight.
Request
curl -X PUT https://api.finx.ai/v1/customer-insights/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}" \
-d 'details'="Customer now prefers to purchase home appliances."
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"insight_type": "purchase_behavior",
"details": "Customer now prefers to purchase home appliances.",
"created_at": 705103200,
"updated_at": 705103200
}
Delete a customer insight
This endpoint allows you to delete your customer insight records in Fin X. Note: This will permanently delete the record and all its data — ensure this is the desired action before proceeding.
Request
curl -X DELETE https://api.finx.ai/v1/customer-insights/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}"