---
title: "Update a collection"
method: PUT
path: "/v1/collections/{collection_id}"
tags: ["Collections"]
---

# Update a collection

`PUT /v1/collections/{collection_id}`

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

## Request body

- union
  - object
    - `name` string — The name of the collection. This is how you'll reference your collection in messages—`{{collection_name.data-property}}`.
    - `data` object[] — An array of data objects that you want to reference in this collection.
  - object
    - `name` string — The name of the collection. This is how you'll reference your collection in messages—`{{collection_name.data-property}}`.
    - `url` string, url — The URL for your CSV or JSON data. If your URL does not return a `Content-Type`, we use the file extension; otherwise, Customer.io assumes your data is JSON.

## Response `200`

The collection was created successfully.

- object
  - `collection` CollectionResponse
    - `bytes` integer — The size of the collection in bytes.
    - `created_at` integer — The date time when the referenced ID was created.
    - `updated_at` integer — The date time when the referenced ID was last updated.
    - `id` integer — The identifier for the collection. This is how you'll reference the collection from the API.
    - `name` string — The name of the collection. This is how you'll reference the collection in liquid, e.g. `{{collection_name.data_property}}`.
    - `rows` integer — Represents the number of objects in the `data` array or CSV rows in your collection schema.
    - `schema` string[] — Lists the top-level keys that you can reference within this collection. Customer.io does not enforce any of these keys as required from your `data`.

## Other responses

- `400` — Your request was malformed.
- `429` — Your request is over the 10-per-second limit.

---

[API](https://skmtc.dev/customer/apis/customer-io-journeys-api-reference.md) · [All operations](https://skmtc.dev/customer/apis/customer-io-journeys-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/customer/customer-io-journeys-api-reference/revisions/4b391af7cb06/schema)
