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.


GET/v1/customer-insights

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

GET
/v1/customer-insights
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"
      // ...
    }
  ]
}

POST/v1/customer-insights

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

POST
/v1/customer-insights'
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
}

GET/v1/customer-insights/:id

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

GET
/v1/customer-insights/xgQQXg3hrtjh7AvZ
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
}

PUT/v1/customer-insights/:id

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

PUT
/v1/customer-insights/xgQQXg3hrtjh7AvZ
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/v1/customer-insights/:id

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

DELETE
/v1/customer-insights/xgQQXg3hrtjh7AvZ
curl -X DELETE https://api.finx.ai/v1/customer-insights/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Was this page helpful?