A profile has three main parts, namely, "Sessions", "Attributes" and "Services". Each of these in turn have their own structures. The structure of a profile can be represented by the following JSON structure. Please read the Profile Format Specification document for more details about the profile.


Profile JSON structure
{
   "id":"<profileId>",
   "version":"1.0",
   "createdAt":<timestamp milliseconds>,
   "sessions":[
    {
            "id":"<sessionId>",
            "createdAt":<timestamp milliseconds>,
            "collectApp":"<collect app name>",
            "section":"<section name>",
            "data":{
                "key":"value"
            },
            "services":[
               {
                  "id":"geo",
                  "data":{
                     "countryCode":0,
                     "countryName":"<a country>",
                     "region":"<a region>",
                     "city":"<a city>",
                     "postalCode":null,
                     "latitude":0.0,
                     "longitude":0.0,
                     "dmaCode":0,
                     "areaCode":0,
                     "metroCode":0
                  }
               }
            ],
            "events":[
               {
                  "id":"<eventId>",
                  "createdAt":<Timestamp milliseconds>,
                  "definitionId":"<definitionId>",
                  "data":{
                    "key":"value"
                  },
                  "services":[
                     
                  ]
               }
            ]
         }
   ],
   "attributes":[
      {
        "collectApp": "<collect app name>",
        "section": "<section name>",
        "data": {
          "key": "value"
        }
        "services": [
  
        ]
      }
   ],
   "services":[
 
   ]
}


The table below describes the profile in further detail

Key

Type

Required

Description

attributesArray of attributesNoAn array of attributes
createdAtNumberNoRepresents the time this profile was created. createdAt can be specified by the client. If no createdAt is specified, the server will add a createdAt value. The createdAt value can never be modified and all future createdAt values will be ignored. This value will be interpreted in milliseconds.
idStringYesRepresents a profile. The API expects the "id" to be created by the caller. The "id" should be unique
mergedProfilesArray of stringsNoId of profiles merged into this profile. Profile merging is a special function that combines multiple temporary profiles into a single canonical profile. Please read the Merge section for more details.
servicesArray of servicesNoAn array of services. Some services such as "geo location" will be included in the profile by the API.
sessionsArray of sessionsNoAn array of sessions.
versionStringNoRepresents the version of profile JSON. The API does not expect it from the caller and will ignore it if supplied.