v1.0.0
OpenAPI 3.1.0

Lookup collection contents

US region

Client Libraries

Lookup collection contents

​

Retrieve the rows of a collection.

Without query parameters, this request returns the whole collection as JSON Lines: each line of the response is one row, as a JSON object. If a collection is too large to return whole, Customer.io responds with a 400, and you need to page through it instead. Use keys to read specific rows from a collection with a key field, or limit and cursor to page through the collection. Both return a JSON object with a rows array instead.

Path Parameters
  • collection_id
    Type: integer
    required

    The identifier for a collection.

Query Parameters
  • keys
    Type: array string[] …1000

    The keys of the rows you want, separated by commas. The collection needs a key field. Customer.io returns rows in the order of your keys, and leaves out keys that don't match a row. One read can return up to 16 MB of rows.

  • limit
    Type: integer
    min:  
    1
    max:  
    1000

    The number of rows to return in a page. A page holds up to 4 MB of rows, so it can have fewer rows than your limit.

  • cursor
    Type: string

    The next_cursor from the previous page. Leave it out to get the first page. Rows you change while you page show up in later pages. If you replace the collection's rows while you page, the cursor can expire, and you need to start over.

Responses
  • application/json
  • 400

    The collection is too large to return whole. Use limit and cursor to read it a page at a time.

  • 404

    The collection id does not exist.

  • 409

    The collection's rows were replaced since you read the cursor. Start again without one.

  • application/json
Request Example for get/v1/collections/{collection_id}/content
curl https://api.customer.io/v1/collections/1/content \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{"sku":"A-100","price":19}
{"sku":"A-101","price":24}
{"sku":"A-102","price":12}