v1.0.0
OpenAPI 3.1.0

Add or update a customer device

US region

Client Libraries

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.

Path Parameters
  • identifier
    required

    The unique value representing a person. The values you use to identify a person may be an id, email address, or the cio_id (when updating people), depending on your workspace settings. When you reference people by cio_id, you must prefix the value with cio_.

    You can't reference a person by their phone number here. We determine the identifier type from the shape of the value, so a phone number in the path is treated as an id. 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.

Body
application/json

Define the device you want to add to the customer profile.

  • device
    required

    Device properties collected by Customer.io SDKs unless autoTrackDeviceAttributes is disabled. You can use these properties in segments and Liquid.

    • id
      Type: string
      required

      The device token.

    • platform
      Type: stringenum
      required

      The device/messaging platform.

      values
      • ios
      • android
    • attributes
      Type: 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.

    • last_used
      Type: integerFormat: unix timestamp

      The timestamp when 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.

Responses
  • 200

    A successful request returns an empty object response.

  • application/json
  • 401

    Unauthorized request. Make sure that you provided the right credentials.

Request Example for put/api/v1/customers/{identifier}/devices
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": ""
    }
  }
}'
No Body