Is AI recommending you? Ask Contentstack Canoe for free
Is AI recommending your brand? Find out with Contentstack Canoe for free
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Contentstack for Developers
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • The Forrester Wave™: Digital Experience Platforms, Q4 2025
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Lytics API
  4. V1
  5. DataUpload

DataUpload

markdownView as Markdown

APIs for collecting or uploading data. There are two main APIs, one for uploading

Large files (bulk, millions of records) and another for sending real-time, or slightly batched

events (Less than 10MB).

**stream**

A stream name is like a table in database, each stream is a differnt _Type_ of data.

You assign a name to your data uploads to identify each stream/type.

However, it should be consistent across uploads of same type of data.

**Timestamp Fields**

When uploading historical, or event data you may have a time/date at which

an event occured. Normal event uploads get an event timestamp at the server time

but you can over-ride this behavior so the timestamp is defined in the event you upload.

This is a _timestamp_field_ parameter in api's below. The formatting for this is very, very

lenient with over 50 format's supported.

BulkCSVUpload

POSThttps://api.lytics.io/collect/bulk/{stream}

Upload CSV files (may be gzipped). They MUST contain headers: either

in first row (by default) OR in **headers** querystring field.

If the file contains a timestamp field you want us to use

see **timestamp_field** querystring parameter for how we extract it.

*Note Domain* this api is on a different domain *https://bulk.lytics.io* because the *api.lytics.io* domain

is limited to 10MB file uploads.

``sh

# the "user_regdata" is the STREAM (ie Type) of data, if there

# is multiple different types of data (userdata, emaildata, events)

# they would have different streams.

# user data

export LIODATAKEY="YOURKEY"

curl -s -H "Authorization: $LIOKEY" \

-H 'Content-type: application/csv' \

--data-binary @users.csv \

"https://bulk.lytics.io/collect/bulk/user_regdata?timestamp_field=register_date" \

| jq '.'

# only do a dry-run to see if it is formatted correctly

curl -s "https://bulk.lytics.io/collect/bulk/user_regdata?access_token=$LIODATAKEY&timestamp_field=register_date&dryrun=true" \

--data-binary @users.csv -H 'Content-type: application/csv' | jq '.'

# append fields to each row

# where append = urlencode({"source":"crm"})

# often used when file-name contains information

curl -s "https://bulk.lytics.io/collect/bulk/user_regdata?append=%7B%22source%22%3A%22crm%22%7D&access_token=$LIODATAKEY" \

--data-binary @users.csv -H 'Content-type: application/csv' | jq '.'

# full example uploading gzipped file

echo 'user_id,email,reg_date,item_count

7456,[email protected],"2012-10-17T17:29:39.738Z",82

1234,[email protected],"2012-12-11T19:53:31.547Z",82' > users.csv

gzip users.csv

curl -s "https://bulk.lytics.io/collect/bulk/user_regdata?access_token=$LIODATAKEY&timestamp_field=reg_date&dryrun=true&filename=users.csv" \

--data-binary @users.csv.gz \

-H 'Content-type: application/csv' | jq '.'

``

Sample Response
Status|200 OK
12345678910111213
{
  "status": 200,
  "message": "success",
  "data": {
    "message_count": 2,
    "rejected_count": 0,
    "content-type": "application/json",
    "droperrors": false,
    "dryrun": false,
    "timestamp_field": "event_created",
    "filename": "myfile.csv"
  }
}

BulkJSONUpload

POSThttps://api.lytics.io/collect/bulk/{streamname}

JSON formatting info.

This JSON is ok:

``json

{"order_ids":[1,2,3]}

`

This is not valid because it has objects nested inside arrays:

`json

{"orders":[{"id":1,"price":22},{"id":2,"price":23}]}

``

Sample Response
Status|200 OK
12345678910111213
{
  "status": 200,
  "message": "success",
  "data": {
    "message_count": 2,
    "rejected_count": 0,
    "content-type": "application/json",
    "droperrors": false,
    "dryrun": false,
    "timestamp_field": "event_created",
    "filename": "myfile.json"
  }
}

Data JSON Upload

POSThttps://api.lytics.io/collect/json/{stream}


Sample Response
Status|200 OK
12345678910111213
{
  "status": 200,
  "message": "success",
  "data": {
    "message_count": 2,
    "rejected_count": 0,
    "content-type": "application/json",
    "droperrors": false,
    "dryrun": false,
    "timestamp_field": "event_created",
    "filename": "myfile.json"
  }
}
Hide Parameters

URL Parameters

streamrequiredstring

The DataType aka Table of type of data being uploaded. See Data, Streams in web admin.

Example:

user_db

Query Parameters

account_idoptionalstring

Your Lytics account ID.

access_tokenoptionalstring

The Lytics DATA API key. Not the management key. Or use Authorization Header.

dryrunoptionalstring

timestamp_fieldoptionalstring

The name of the column or field in file that contains event timestamp.

headersoptionalstring

CSV only, Comma delimited list of header columns for csv (if not first row)

delimiteroptionalstring

CSV only, if not the default comma, either t=tab, or | may be accepted

appendoptionalstring

CSV only, JSON encoded object of additional name-value pairs to append to each record.

droperrorsoptionalstring

filenameoptionalstring

Just for record-keeping in our event - stream.

Example:

"myfile.csv"

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

streamnamerequiredstring

The DataType, or "Table" of type of data being uploaded

Example:

user_db

Query Parameters

account_idoptionalstring

Your Lytics account ID.

access_tokenoptionalstring

The Lytics DATA API key. Not the management key. Or use Authorization Header.

dryrunoptionalstring

timestamp_fieldoptionalstring

The name of the column or field in file that contains event timestamp.

filenameoptionalstring

Just for record-keeping in our event - stream.

Example:

"myfile.json"

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

streamrequiredstring

The DataType, or "Table" of type of data being uploaded

Example:

user_db

Query Parameters

account_idoptionalstring

Your Lytics account ID.

access_tokenrequiredstring

The Lytics DATA API key (not management key)

dryrunoptionalstring

timestamp_fieldoptionalstring

The name of the column or field in file that contains event timestamp.

filenameoptionalstring

Just for record-keeping in our event - stream.

Example:

"myfile.json"

Headers

Authorizationoptionalstring