Skip to main content
PUT
/
users
/
{user_guid}
/
insights
/
{insight_guid}
Update insight
curl --request PUT \
  --url https://int-api.mx.com/users/{user_guid}/insights/{insight_guid} \
  --header 'Accept-Version: <accept-version>' \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "insight": {
    "has_been_displayed": false,
    "is_dismissed": false
  }
}
'
import requests

url = "https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}"

payload = { "insight": {
"has_been_displayed": False,
"is_dismissed": False
} }
headers = {
"Accept-Version": "<accept-version>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {
'Accept-Version': '<accept-version>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({insight: {has_been_displayed: false, is_dismissed: false}})
};

fetch('https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'insight' => [
'has_been_displayed' => false,
'is_dismissed' => false
]
]),
CURLOPT_HTTPHEADER => [
"Accept-Version: <accept-version>",
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}"

payload := strings.NewReader("{\n \"insight\": {\n \"has_been_displayed\": false,\n \"is_dismissed\": false\n }\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Accept-Version", "<accept-version>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}")
.header("Accept-Version", "<accept-version>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"insight\": {\n \"has_been_displayed\": false,\n \"is_dismissed\": false\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Accept-Version"] = '<accept-version>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"insight\": {\n \"has_been_displayed\": false,\n \"is_dismissed\": false\n }\n}"

response = http.request(request)
puts response.read_body
{
  "active_at": "2022-01-07T12:00:00Z",
  "client_guid": "CLT-abcd-1234",
  "created_at": "2025-02-13T18:08:00+00:00",
  "cta_clicked_at": "2022-01-13T18:13:51Z",
  "description": "Gold's Gym charged you $36.71 more this month than normal. Did you upgrade your service?",
  "guid": "BET-abcd-1234",
  "has_associated_accounts": false,
  "has_associated_categories": false,
  "has_associated_merchants": false,
  "has_associated_scheduled_payments": false,
  "has_associated_transactions": true,
  "has_been_displayed": true,
  "is_dismissed": false,
  "micro_call_to_action": "Learn more",
  "micro_description": "Netflix charged you $5.00 more this month than normal.",
  "micro_title": "Price Increase",
  "template": "SubscriptionPriceIncrease",
  "title": "Price increase",
  "updated_at": "2025-02-13T18:09:00+00:00",
  "user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54",
  "user_id": "u-1234"
}
Use this endpoint to update the attributes of an insight according to its unique GUID.

Authorizations

Authorization
string
header
required

The MX Platform API requires basic access authentication using your client_id and api_key. These credentials must be Base64 encoded and included in the Authorization header of each API request to ensure secure access.

Here's an example using curl to access v20250224. Replace https://int-api.mx.com/endpoint with the actual API endpoint you wish to access and your Base64 encoded client_id and api_key.

curl -L -X POST `https://int-api.mx.com/endpoint' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Accept-Version: v20250224'
-H 'Authorization: Basic BASE_64_ENCODING_OF{client_id:api_key}'

Headers

Accept-Version
string
default:v20250224
required

MX Platform API version.

Example:

"v20250224"

Path Parameters

user_guid
string
required

The unique identifier for a user, beginning with the prefix USR-.

insight_guid
string
required

The unique identifier for the insight. Defined by MX.

Body

application/json

The insight to be updated (None of these parameters are required, but the user object cannot be empty.)

insight
object

Response

200 - application/json

OK

active_at
string | null

The date and time when the insight was activated, represented in ISO 8601 format with a timestamp.

Example:

"2022-01-07T12:00:00Z"

client_guid
string

The unique identifier for the client associated with the insight. Defined by MX.

Example:

"CLT-abcd-1234"

created_at
string | null

The date and time the insight was created, represented in ISO 8601 format with a timestamp.

Example:

"2025-02-13T18:08:00+00:00"

cta_clicked_at
string | null

The date and time when a call-to-action was clicked, represented in ISO 8601 format with a timestamp.

Example:

"2022-01-13T18:13:51Z"

description
string | null

The human-readable information being delivered to the end user.

Example:

"Gold's Gym charged you $36.71 more this month than normal. Did you upgrade your service?"

guid
string | null

The unique identifier for the insight. Defined by MX.

Example:

"BET-abcd-1234"

has_associated_accounts
boolean | null

Indicates whether there are accounts associated with the insight.

Example:

false

has_associated_categories
boolean | null

Indicates whether there are categories associated with the insight.

Example:

false

has_associated_merchants
boolean | null

Indicates whether there are merchants associated with the insight.

Example:

false

has_associated_scheduled_payments
boolean | null

Indicates whether there are scheduled payments associated with the insight.

Example:

false

has_associated_transactions
boolean | null

Indicates whether there are transactions associated with the insight.

Example:

true

has_been_displayed
boolean | null

Indicates whether the insight has been shown to the end user.

Example:

true

is_dismissed
boolean | null

Indicates whether the insight has been dismissed by the user.

Example:

false

micro_call_to_action
string | null

A short call-to-action text for prompting user engagement.

Example:

"Learn more"

micro_description
string | null

A shorter version (300 characters or less) of description. This is the insight's description we display to the end user in the Micro Widget

Example:

"Netflix charged you $5.00 more this month than normal."

micro_title
string | null

A shorter version (60 characters or less) of title. This is the insight's title we display to the end user in the Micro Widget. For example, Price Increase or Paycheck Deposit.

Example:

"Price Increase"

template
string | null

A short label for the type of insight being delivered, for example, SubscriptionPriceIncrease or MonthlyCategoryTotal.

Example:

"SubscriptionPriceIncrease"

title
string | null

The title for the specific insight, for example, Price Increase or Paycheck Deposit.

Example:

"Price increase"

updated_at
string | null

The date and time the resource was last updated in ISO 8601 format with a timestamp.

For categories, this field will always be null when is_default is true.

Example:

"2025-02-13T18:09:00+00:00"

user_guid
string

The unique identifier for the user. Defined by MX.

Example:

"USR-fa7537f3-48aa-a683-a02a-b18940482f54"

user_id
string

The unique partner-defined identifier for the user.

Example:

"u-1234"