# Objects

Learn how to create, edit, or delete objects.

 Before you can create an object, you must create an [object type](/journeys/object-types/).

## Create an object[](#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:

*   via [API](#create-object-api)
*   via [Pipelines API](#import-objects-and-relationships)
*   via [reverse ETL integrations](#import-objects-and-relationships)
*   via [Segment group calls](#import-objects-and-relationships)

Manually create objects:

*   via your [Object page](#create-object-ui)
*   via [CSV import](/journeys/import-objects/)

You can set [relationshipsThe connection between an object and a person in your workspace. For instance, if you have Account objects, people could have relationships to an Account if they’re admins.](/journeys/relationships/) between objects and people [programmatically](/journeys/relationships/#setdelete-relationships-programmatically), using the same methods above, as well as through our [UI](/journeys/relationships/).

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

### Reserved attributes[](#reserved-attributes)

Customer.io has reserved these object and relationship attributes to support core functionality in the platform:

Attribute

Purpose

Required

Data Format

`cio_object_id`

A unique, immutable identifier for objects provided by Customer.io. If this does not yet exist in your workspace, we create a new object.

When importing by `cio_object_id`

`object_id`

A unique identifier for objects. If the `object_id` does not yet exist, we create a new object.

When importing by `object_id`

Our default `id` limit is set to 150 characters. All valid UTF characters are allowed.

`objectId`

String

An analog for `object_id` in some Customer.io integrations.

`relationship`

Used to reference relationships to objects. Cannot be used as the name of an **object** attribute.

[To reference relationships in liquid](/journeys/objects-in-liquid/#relationship-attribute)

`_relationship`

Used in relationship-triggered campaigns to reference audience members who did not trigger the campaign. Cannot be used as the name of a **customer** attribute.

[To reference relationships in liquid](/journeys/objects-in-liquid/#audience-attribute)

`created_at`

Unix timestamp when the object was first created. Used when listing objects in the UI, for example.

No

Unix timestamp

`timezone`

The user’s time zone. Used for [sending localized messages](/journeys/timezone-match/).

No

[Region Format](/journeys/example-timezones/#region-format)

### Create an object in the UI[](#create-object-ui)

In the UI, you can create objects by going to your objects-type pages in the left hand menu 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.](/journeys/attributes/) 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](/journeys/relationships/#update-relationship-attributes) in Liquid.
    
4.  Click **Save Changes** to finish creating your object.
    
    [![create an object in the UI](https://docs.customer.io/images/object-create.png)](#97118d8b06de4394d8d617977ce3fe18-lightbox)
    

Now you can [set relationships between your new object and people](/journeys/relationships/).

### Create an object in the API[](#create-object-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.](/journeys/attributes/). 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](/journeys/object-types/). 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](/journeys/object-types/#define-object-type-api). 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 our SDKs which are mostly built on the [Pipelines API](/integrations/api/cdp/#operation/group) and have `group` methods to help you create objects and relate them to people. If you use our older JavaScript snippet (which references `track.customer.io`), you’ll use our Track V1 API. We also have a [Track v2](/integrations/api/track/#tag/track_v2) API that supports batching.

 You cannot use `relationship` as an object attribute name. `relationship` is reserved for referencing [relationship attributes](/journeys/relationships/#update-relationship-attributes) in Liquid.

 Pipelines API (Recommended)

#### Pipelines API (Recommended)[](#Pipelines API \(Recommended\))

```shell
curl --request POST \
  --url https://cdp.customer.io/v1/group \
  -u api_key: \
  -H 'content-type: application/json' \
  --data-raw '
{
    "userId": "42",
    "groupId": "acme",
    "traits": {
        "objectTypeId": 1,
        "name": "ACME, Inc.",
        "bill_day": 15,
        "monthly_due": 100.00,
        "relationshipAttributes": {
            "role": "primary_contact"
        }
    }
}'
```

 Track API v2

#### Track API v2[](#Track API v2)

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.)

```shell
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"
            }
        }
    ]
}'
```

 Track API v1

#### Track API v1[](#Track API v1)

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.

```shell
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[](#import-objects-and-relationships)

You can import objects and relationships through:

1.  Most of our integration libraries
2.  Reverse ETL integrations
3.  Segment group calls
4.  CSV imports

Our [**integration libraries**](/integrations/data-in/catalog/) use [group calls](/integrations/data-in/source-spec/group-spec/) to help you 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**](/integrations/data-in/connections/reverse-etl/about-reverse-etl/) - 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**](/journeys/segment-destination/#segment-group-calls).

You can [import objects and relationships via **CSV**](/journeys/import-objects/), 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[](#edit-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](#create-an-object). Go [here](/journeys/segment-destination/#group-calls-and-object-attributes) to learn how to edit object attributes through Segment group calls.

In our [Track v2 API](/integrations/api/track/#operation/entity), 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](/journeys/relationships/#update-relationship-attributes) 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](https://docs.customer.io/images/object-attributes-set.png)](#b94887389d16b9eed66f88f4178263c7-lightbox)
    
3.  Set attributes for the object or click the trash can icon to remove attributes. Then click **Save**.
    
    [![modify your object's attributes](https://docs.customer.io/images/object-attributes.png)](#617c4ea03405df4e777fa17a4528408f-lightbox)
    

## Delete objects[](#delete-objects)

You can delete objects in the UI, [API](/integrations/api/track/#operation/entity) or through [Segment group calls](/journeys/segment-destination/#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.](https://docs.customer.io/images/object-delete.png)](#642ab1277a9511dc6093f8858977ed04-lightbox)
    
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.