Import/Export API

Important: Read the introduction before proceeding.

Bulk Import API


The Bulk Import API allows importing a list of visits into Woopra in a single transaction.





Name Description
website The project name as registered in Woopra

The expected Http body is a list of line-separated JSON strings, each line is a JSON of a visit (or session), each session should have a visitor object and an array of actions.

Each line should match the following schema:

  "visitor": {
    "email": ""
  "actions": [{
    "name": "article view",
    "time": 1450808259000,
    "properties": { 
      "campaign_name": "EN_2014",
      "campaign_medium": "Social",
      "campaign_source": "twitter" 
      "uri": "",
      "title": "welcome!"

And the actual body should look like the snippet below:

{"visitor":{"email":""}, "actions":[{"time":1444077951001, "name":"purchase", "properties":{"price":20, "currency":"$"}]}
{"visitor":{"email":"", "username": "test2"}, "actions":[{"time":1444077951891, "name":"signup", "properties":{"campaign": true}]}

Example (command line):

curl -X PUT --user appID:secretKey '' -d @2015-02-01.log


  • It is possible to bulk update visitor properties; each line in the file should match the following schema:
      "visitor": {
        "email": "",
        "account": "enteprise",
        "custom tag": "custom value"


  • The imported data will be permanently written to the system, and the operation cannot be rolled back.

Export API

Exports the raw list of visits as line-separated JSON visits.



Name Description
website The project name as registered in Woopra
file The log file name – this is also the PST date of the log file having the format yyyy-MM-dd. Ex: 2015-02-01 is the log file for Feb 1st, 2015. Log files are rotated at midnight PST. It is a good practice to send an http HEAD request to the same endpoint to get the current log file name.
pos (Advanced) Used for paging; The position of the log file cursor, required when file is today’s PST date.

Example (command line):

curl --user appID:secretKey '' > two-days-ago.log

Example (browser):


{"date":"2014-03-20","country":"US","os":"Win","city":"Los Angeles","ip":"","language":"English","pid":"rpE...
{"date":"2014-03-20","country":"US","os":"Mac","city":"San Francisco","ip":"","language":"English","pid":"nTu...

Streaming logs (Paging)

It is possible to stream logs by keeping track of the log file and pos of the export requests. The value of the next file and pos parameters are retrieved by reading the http Headers X-Woopra-NextFile and X-Woopra-NextPos from the previous Http request.


The JSON parser should be able to parse a line-separated response; JSON records/lines have to be processed based on the “type” property, which can be visit, identify and delete.

  • ‘visit’ records return a JSON formatted visit/session, along with the timestamp, all visit specific data, and the list of actions committed during that visit.
  • ‘delete’ records imply that the visitor with the attached profile Id (pid) should no longer be counted in stats. All associated meta data and actions should be deleted/ignored.
  • ‘identify’ records imply that only visitor properties were udated, without recording any action.

Do you know what your customers are doing?
Find out in 5 minutes.

Try Woopra for free. No credit cards. No obligations.