Objects

Learn how to create, edit, or delete objects.

 Before you can create an object, you must create an object type.

Create an object

Remember that an object type is the kind of non-people grouping that you want to track in Customer.io — like Companies, Online classes, or Accounts. An object is an individual thing — a single company, online class, or account — that you want to relate to one or more people.

You can create objects programmatically by integrating your systems with your Customer.io workspace or manually through your workspace’s interface.

Programmatically create objects:

Manually create objects:

You can set relationships between objects and people programmatically, using the same methods above, as well as through our UI.

We don’t currently offer object-to-object relationships.

Create an object in the UI

In the UI, you can create objects by going to your objects page(s) under People.

  1. Select your object type under People in the left hand nav.
  2. Set the object_id: this is the value you use when you set relationships between objects and people.
  3. Set a name and any other attributes you want the object to contain. In general, we suggest that you set a name to help you recognize objects in the UI. Other attributesA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages. Attributes are analogous to traits in Data Pipelines. are values that you want to associate with people related to the object.

     You cannot use relationship as an object attribute name. relationship is reserved for referencing relationship attributes (coming January 2024) in Liquid.

  4. Click Save Changes to finish creating your object.
    create an object in the UI
    create an object in the UI

Now you can set relationships between your new object and people.

Create an object in the API

Creating an object works just like identifying a person: you can send an identify request to create a new object or update an existing object’s attributesA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages. Attributes are analogous to traits in Data Pipelines.. Any request that passes a new object ID will automatically create that object.

In general, it makes sense to create your custom object type first. But you can create a new type when you create a new object, simply by passing an object_type_id that doesn’t already exist. If you’re not sure if a type exists, check in your workspace under People—if you see the object type you want to create, then pass that id.

You can create objects using the Track v2 or v1 APIs, but you can only set and update attributes using the v2 API.

 You cannot use relationship as an object attribute name. relationship is reserved for referencing relationship attributes (coming January 2024) in Liquid.

In the v2 API, you’ll specify a type and an action. The object type lets you modify objects, and the identify action lets you create an object, set its attributes, and relate it to multiple people. You can create objects and set relationships with other action types, but you can only set attributes through our API with the identify action. (You can also update object attributes in the UI.)

curl --request POST \
  --url https://track.customer.io/api/v2/entity \
  --header "Authorization: Basic $(echo -n site_id:api_key | base64)" \
  --header 'content-type: application/json' \
  --data-raw '
{
    "type": "object",
    "identifiers": {
        "object_type_id": "1",
        "object_id": "acme"
    },
    "action": "identify",
    "attributes": {
        "name": "acme",
        "bill_day": 15,
        "monthly_due": 100.00,
    },
    "cio_relationships": [
        {
            "identifiers": {
                "id": "42"
            }
        },
        {
            "identifiers": {
                "email": "billing-contact@example.com"
            }
        }
    ]
}'

In our original Track API, you can set cio_relationships to relate a person to one or more objects. If an object_type_id or object_id doesn’t exist, we’ll create it.

curl --request POST \
  --url https://track.customer.io/api/v1/customer/billing-contact@example.com \
  --header "Authorization: Basic $(echo -n site_id:api_key | base64)" \
  --header 'content-type: application/json' \
  --data-raw '
{
    "plan": "basic",
    "role": "accountant"
    "cio_relationships": [
        {
            "identifiers": {
                "object_type_id": "1",
                "object_id": "acme"
            }
        },
        {
            "identifiers": {
                "object_type_id": "1",
                "object_id": "globex"
            }
        }
    ]

}'

 An object’s attributes cannot exceed 100kb

You can keep setting relationships on an object, but the total attributes for an object can’t take up more than 100kb.

Import objects and relationships

You can import objects and relationships through:

  1. Data Pipelines
  2. Reverse ETL integrations
  3. Segment group calls
  4. CSV imports

Data Pipelines reshapes data from sources to fit your destinations. It’s our version of a CDP (Customer Data Platform). Check out group calls to learn how to import objects and relationships.

You can sync objects (like companies, accounts, or online classes) and relate them to people as a part of our Reverse ETL database integrations - MySQL, BigQuery, Snowflake, and so on. This helps you add objects and relationships on a regular interval based on business logic and data that you store outside of Customer.io.

If you use Segment as a CDP, import objects and relationships through Segment group calls.

You can import objects and relationships via CSV, as well. This is a good option if you’re just getting started and want to quickly add objects or relationships to your workspace. You can also import via CSV if your data isn’t available through an integration.

Edit or remove object attributes

You can set attributes for an object through our UI or you can update them using the same API calls that you used to create objects. Go here to learn how to edit object attributes through Segment group calls.

In our Track v2 API, use attributes to modify an object’s data. Set an attribute value to null or an empty string to remove attributes.

 You cannot use relationship as an object attribute name. relationship is reserved for referencing relationship attributes (coming January 2024) in Liquid.

To update object attributes in our UI:

  1. Select your object type from the left hand nav under People. Then click the object you want to modify.
  2. Click Manage under Attributes.
    find your object and see all its attributes
    find your object and see all its attributes
  3. Set attributes for the object or click the trash can icon to remove attributes. Then click Save.
    modify your object's attributes
    modify your object's attributes

Delete objects

You can delete objects in the UI, API or through Segment group calls.

Deleting an object permanently removes the relationship from people.

To delete objects in the UI:

  1. Select your object type from the left hand nav.

  2. If applicable, filter by object attributes to locate the ones you want to remove. Check the box next to each object you want to delete.

    Two objects are checked. A delete button appears at the top of the table.
    Two objects are checked. A delete button appears at the top of the table.
  3. Select Delete at the top of the table, and confirm your selection.

To delete, you can also select the object name to navigate to its landing page. Then in the top right, select Options > Delete and confirm your selection.

Copied to clipboard!
  Contents
Is this page helpful?