Get User Profiles

Prev Next

The Get User Profiles API lets you look up a user’s data record, and it returns selected attributes and events for a single user identified by a unique identifier. It accepts the identifier along with an attribute list, event list, and date range, and responds with the requested data. 

This API supports use cases such as personalizing content for external providers or connecting user profiles to services like call centers.

Endpoint and Headers

POST https://unification.useinsider.com/api/user/v1/profile

Visit our Postman collection to test this request.

Header

Sample Value

Description

X-PARTNER-NAME

mybrand

This is your partner name. Navigate to Inone Settings > Account Settings to copy your partner name. The partner name should be lowercase.

X-REQUEST-TOKEN

1a2b3c4d5e6f

This key is required to authorize your request. Refer to API Authentication Tokens to generate your token.

Content-Type

application/json

This header specifies the media type of the resource.

Body Parameters

Each POST body must have an identifiers object. 

Each request must include an attribute or an event object to return the corresponding user profiles. If the events object is used, its required keys must be provided as outlined in the table below.

Parameter

Description

Data Type

Required

identifiers

Identifier key

Object

Required

attributes

Array of wanted attributes

Array (of string)

Yes (if the body does not have the events object)

events

Object of events

Object

Yes (if the body does not have the attributes object)

start_date

Beginning of the date range for the wanted events

Number (Epoch Timestamp)

Yes (if the body has the events object)

end_date

End of the date range for the wanted events

Number (Epoch Timestamp)

Yes (if the body has the events object)

wanted

Object of the wanted events

Array

Yes (if the body has the events object)

event_name

Name of the event

String

Yes (if the body has the events object)

params

Wanted event parameters of the event

Array (of string)

Yes (if the body has the events object)

quota

Flag to display quota usage

Boolean

No

Refer to Default Events for the events list.

For this API, use journey_campaign_name as the journey event's name parameter.

Sample Request

Concept reference:

To look up a profile reliably, including when to query by insider_id versus an email/phone/UUID identifier, see How Identifiers Work in Insider One.

The sample below shows a request to fetch user data by identifier. Attributes and events can be specified to control the response. For multi-word names, use an underscore (_) (e.g., email_optin, homepage_view).

curl --location --request POST 'https://unification.useinsider.com/api/user/v1/profile' \
--header 'X-REQUEST-TOKEN: 1a2b3c4d5e6f' \
--header 'X-PARTNER-NAME: mybrand' \
--header 'Content-Type: application/json' \
--data-raw '{
   "identifiers":{
      "email":"example@insiderone.com"
   },
   "attributes":[
      "email",
      "name",
      "surname"
   ],
   "events":{
      "start_date":1606311893,
      "end_date":1611582293,
      "wanted":[
         {
            "event_name":"email_click",
            "params":[
               "campaign_id",
               "timestamp"
            ]
         },
         {
            "event_name":"item_added_to_cart",
            "params":[
               "product_id",
               "name",
               "timestamp"
            ]
         },
         {
            "event_name":"journey_entered",
            "params":[
               "journey_id",
               "timestamp"
            ]
         }
      ]
   },
   "quota": true
}'

The sample below displays a request to fetch user data with a custom attribute. For custom attributes, add a c_ prefix (e.g., c_member_code).

curl --location --request POST 'https://unification.useinsider.com/api/user/v1/profile' \
--header 'X-REQUEST-TOKEN: 1a2b3c4d5e6f' \
--header 'X-PARTNER-NAME: mybrand' \
--header 'Content-Type: application/json' \
--data-raw '{
    "identifiers": {
        "email": "example@insiderone.com"
    },
    "attributes": [
        "email",
        "name",
        "surname",
        "c_member_code"
    ],
    "events": {
        "start_date": 1606311893,
        "end_date": 1611582293,
        "wanted": [
            {
                "event_name": "email_click",
                "params": [
                    "campaign_id",
                    "timestamp"
                ]
            },
            {
                "event_name": "item_added_to_cart",
                "params": [
                    "product_id",
                    "name",
                    "timestamp"
                ]
            },
            {
                "event_name": "journey_entered",
                "params": [
                    "journey_id",
                    "timestamp"
                ]
            }
        ]
    },
    "quota": true
}'

The sample below shows a request to retrieve user data using the insider_id, an internal ID maintained by Insider One for each user. You can find the insider_id as the Profile ID on the User Profiles page.

curl --location --request POST 'https://unification.useinsider.com/api/user/v1/profile' \
--header 'X-REQUEST-TOKEN: 1a2b3c4d5e6f' \
--header 'X-PARTNER-NAME: mybrand' \
--header 'Content-Type: application/json' \
--data-raw '{
  "insider_id": "sampleinsiderid",
  "attributes": [
    "email",
    "name",
    "surname"
  ],
  "events": {
    "start_date": 1606311893,
    "end_date": 1611582293,
    "wanted": [
      {
        "event_name": "email_click",
        "params": [
          "campaign_id",
          "timestamp"
        ]
      },
      {
        "event_name": "item_added_to_cart",
        "params": [
          "product_id",
          "name",
          "timestamp"
        ]
      },
      {
        "event_name": "journey_entered",
        "params": [
          "journey_id",
          "timestamp"
        ]
      }
    ]
  },
  "quota": true
}'

Sample Responses

200 OK

{
  "attributes": {
    "email": "example@insiderone.com",
    "name": "John",
    "surname": "Doe",
    "iid": "insider-id-user-1"
  },
  "events": {
    "email_click": [
      {
        "campaign_id": 1456,
        "created_date": "2021-01-06T23:34:09Z"
      },
      {
        "campaign_id": 1245,
        "created_date": "2021-01-01T12:56:21Z"
      }
    ],
    "item_added_to_cart": [
      {
        "product_id": "3254634",
        "name": "Blue Shirt",
        "created_date": "2021-01-04T15:04:34Z"
      }
    ]
  },
  "quota": {
    "cost": 2.5,
    "used": 2.5,
    "total": 1000
  }
}

404 Not Found

{"error":"no such user for these identifiers: no data"}

429 Too Many Requests

If you exceed the rate limits, you receive an error shown below:

{
    "error": "rejected: too many requests"
}

Error reference

Use this table to identify and resolve the errors this endpoint returns. Each row shows the status code, the response body you receive, what causes it, and how to fix it.

Status

JSON response

Cause

Fix

404 Not Found

{"error": "no such user for these identifiers: no data"}

No profile matches the identifier you sent, or the identifier type is not one of the supported types.

Confirm the identifier value is correct and formatted as stored, for example, a phone number in E.164 format. Use one of the supported identifier types. If the profile should exist, send it through the Upsert User Data API first.

429 Too Many Requests

{"error": "rejected: too many requests"}

You exceeded the quota of 1,000 units per minute. Quota consumption is driven by the size of your user base and the number of event types requested, not by request count alone, so a small number of wide requests can exhaust the quota.

Set Quota=true in your payload to see how many units each request consumes. Reduce the number of event types per request, or set limit_per_source to cap the events returned per source. Retry with exponential backoff.

403 Forbidden

{ "success": false, "message": "Access Denied. You do not have sufficient access to perform this action." }

X-REQUEST-TOKEN is invalid, revoked, or does not belong to the partner in X-PARTNER-NAME

Confirm that X-PARTNER-NAME is lowercase and matches your panel name, and that X-REQUEST-TOKEN is active. Generate a new token if the current one was revoked.

Limitations

  • All functions must be executed with a simple HTTPS POST request.

  • Only new data can be retrieved via this API. No data can be inserted.

  • The request token should be provided in the request header. If the token is incorrect, the operation will not be executed.

  • The API can prepare data for only one user specified by the identifier. 

  • If the limit_per_source value is set, then only that many events are assigned from every source. For example, if the limit_per_source value is set to 1 for the purchase event, then one purchase event is acquired from email, web, and other sources.

  • To view payload quota usage, set Quota=true.

  • The quota is limited to 1000 units per minute.

  • Quota usage depends on the size of the user base and the number of event types. The attribute number or set of attributes doesn't matter.

  • The value of X-PARTNER-NAME header should be lowercase.

The default limit shown here is a standard baseline. If your use case requires higher capacity, feel free to reach out to the Insider One team. We can adjust it to fit your needs.