Add or update a customer device
Customers can have more than one device. Use this method to add iOS and Android devices to, or update devices for, a customer profile.
- identifierrequired
The unique value representing a person. The values you use to identify a person may be an
id,emailaddress, or thecio_id(when updating people), depending on your workspace settings. When you reference people bycio_id, you must prefix the value withcio_.You can't reference a person by their
phonenumber here. We determine the identifier type from the shape of the value, so a phone number in the path is treated as anid. To identify people by phone number, use the Track v2 API.- Type: string · id
The unique identifier for a person that you want to create or modify.
Define the device you want to add to the customer profile.
- devicerequired
Device properties collected by Customer.io SDKs unless
autoTrackDeviceAttributesis disabled. You can use these properties in segments and Liquid.- idType: stringrequired
The device token.
- platformType: stringenumrequired
The device/messaging platform.
values- ios
- android
- attributesType: object
Attributes that you can reference to segment your audience—like a person's attributes, but specific to a device. These can be either the attributes defined below or custom key-value attributes.
- lastType: integerFormat: unix timestamp
_used The
timestampwhen you last identified this device. If you don't pass a timestamp when you add or update a device, we use the time of the request itself. Our SDKs identify a device when a person launches their app.
- 200
A successful request returns an empty object response.
- application/json
- 401
Unauthorized request. Make sure that you provided the right credentials.
curl https://track.customer.io/api/v1/customers/12345/devices \
--request PUT \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic username:password' \
--data '{
"device": {
"id": "",
"last_used": 1,
"platform": "ios",
"attributes": {
"device_os": "",
"device_model": "",
"app_version": "",
"cio_sdk_version": "",
"device_locale": "",
"push_enabled": "true",
"Custom Device Attributes": ""
}
}
}'
A successful request returns an empty object response.