Create a collection
Create a new collection and provide the data that you'll access from the collection or the url that you'll download CSV or JSON data from.
Note: A collection can't be larger than 10 MB, and each top-level field in a row can hold up to 10,000 characters. The total size of all collections in your account can't exceed 5 GB. Customer.io rejects a request that would take your account over that limit.
- Type: array object[]datarequired
An array of data objects that you want to reference in this collection.
- Type: stringnamerequired
The name of the collection. This is how you'll reference your collection in messages—
{{collection_name.data-property}}. - Type: stringkey
_field The attribute that holds each row's unique key, like
sku, similar to a primary key in a database table. Set a key field to add, change, delete, or read individual rows without replacing the whole collection. Each row needs a unique, non-empty string or number in this attribute, up to 1,024 bytes.
- application/json
- 400
Your request was malformed.
- application/json
{
"data": [
{
"eventName": "christmas",
"eventDate": {},
"presents": {
"something_you_want": "toys",
"something_you_need": "socks",
"total": 2
}
},
{
"eventName": "birthday",
"eventDate": {},
"presents": {
"something_you_want": "video games",
"something_you_need": "books",
"total": 2
}
}
],
"name": "events"
}
{
"collection": {
"bytes": 296,
"created_at": 1552341937,
"id": 1,
"key_field": "sku",
"name": "upcoming events",
"rows": 2,
"schema": [
"eventDate",
"eventName",
"presents"
],
"updated_at": 1552341937
}
}The collection was created successfully.