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

  • limit
    Type: integer
    min:  
    1
    max:  
    1000

    The number of rows to return in a page.

  • 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 a write rebuilds the collection while you page, like a large replace, the cursor expires and you need to start over.

Responses
  • application/json
  • 404

    The collection id does not exist.

  • 409

    A write rebuilt the collection 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}