v1.0.0
OpenAPI 3.1.0

Create a collection

US region

Client Libraries

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 cannot be more than 10 MB in size. No individual row in the collection can be more than 10 KB.

Body
application/json
    • data
      Type: array object[]
      required

      An array of data objects that you want to reference in this collection.

    • name
      Type: string
      required

      The name of the collection. This is how you'll reference your collection in messages—{{collection_name.data-property}}.

Responses
  • application/json
  • 400

    Your request was malformed.

  • 429

    Your request is over the 10-per-second limit.

Request Example for post/v1/collections
curl https://api.customer.io/v1/collections \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "events",
  "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
      }
    }
  ]
}'
{
  "collection": {
    "bytes": 296,
    "created_at": 1552341937,
    "updated_at": 1552341937,
    "id": 1,
    "name": "upcoming events",
    "rows": 2,
    "schema": [
      "eventDate",
      "eventName",
      "presents"
    ]
  }
}