v1.0.0
OpenAPI 3.1.0

Update a collection

US region

Client Libraries

Update a collection

Update the name or replace the contents of a collection. Updating the data or url for your collection fully replaces the contents of the collection.

Note:

  • If you reference your collection by name in active campaign messages, changing the name of the collection will cause references to the previous name to return an empty data set.
  • A collection cannot be more than 10 MB in size. No individual row in the collection can be more than 10 KB.
Path Parameters
  • collection_id
    Type: integer
    required

    The identifier for a collection.

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

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

    • name
      Type: string

      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 put/v1/collections/{collection_id}
curl https://api.customer.io/v1/collections/1 \
  --request PUT \
  --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"
    ]
  }
}