openapi: 3.0.2 info: title: Event Export API description: Export events as JSON. license: name: MIT url: https://opensource.org/licenses/MIT version: 1.0.0 contact: url: https://mixpanel.com/get-support servers: - $ref: ./common/export-api.yaml#/server security: - ProjectSecret: [] tags: - name: Export description: Export events as JSON. paths: /export: get: operationId: raw-event-export tags: - Export summary: Download Data description: >- Every data point sent to Mixpanel is stored as JSON in our data store. The raw export API allows you to download your event data as it is received and stored within Mixpanel, complete with all event properties (including distinct_id) and the exact timestamp the event was fired. The raw export API has a rate limit of 60 queries per hour, 3 queries per second, and a maximum of 100 concurrent queries. If you exceed the rate limit, a 429 error will be returned. parameters: - in: query name: project_id schema: type: integer description: >- Required if using service account to authenticate request. - in: query name: from_date schema: type: string description: >- The date in yyyy-mm-dd format to begin querying from. This date is inclusive and interpreted as UTC timezone for projects created after 1 January 2023 and current project timezone for projects created before 11 January 2023. required: true - in: query name: to_date schema: type: string description: >- The date in yyyy-mm-dd format to query to. This date is inclusive and interpreted as UTC timezone for projects created after 1 January 2023 and current project timezone for projects created before 11 January 2023. required: true - in: query name: limit schema: type: integer description: Use this parameter if you want to limit the max number of events to be returned. Value cannot be over 100000. - in: query name: event schema: type: string description: >- The event or events that you wish to get data for, encoded as a JSON array. - in: query name: where schema: type: string description: >- An expression to filter events by. More info on expression sequence structure can be found [here](ref:segmentation-expressions) - in: query name: time_in_ms schema: type: boolean description: >- Defaults to `false` which will export event timestamps with second-precision. Set to `true` to export event timestamps with millisecond-precision. - in: header name: Accept-Encoding description: If set to `gzip` and the response body is > 1400 bytes, the response will be compressed with gzip, and `Content-Encoding` will be set to `gzip`. schema: type: string enum: - "gzip" responses: "200": description: >- Success. The returned format is one event per line where each line is a valid JSON object, but the full return itself is JSONL. content: # We actually want this to be newline delimited json. More work is needed to figure out how to support it. # application/x-ndjson: # schema: # type: string # properties: # event: # type: string # description: The name of the event # example: Viewed report # properties: # type: object # description: The properties of the event # example: # time: 1518393599 # distinct_id: test-email@mixpanel.com # $browser: Chrome # report_name: Funnels text/plain: schema: type: string example: | {"event":"Signed up","properties":{"time":1602611311,"$insert_id":"hpuDqcvpltpCjBsebtxwadtEBDnFAdycabFb","mp_processing_time_ms":1602625711874}} {"event":"Signed up","properties":{"time":1602787121,"$insert_id":"jajcebutltmvhbbholfhxtCcycwnBjDtndha","mp_processing_time_ms":1602801521561}} description: Newline delimited JSON ([JSONL](http://jsonlines.org)) # TODO: Build "x-hidden: true" like pattern to hide endpoints # /export-upload: # post: # operationId: event-export-to-bucket # tags: # - Export # summary: Upload Data to Bucket # description: >- # An alternative to `/export`. This endpoint allows you to specify where # you would like the output to go, which can be especially helpful when # you expect a lot of events to be returned. # requestBody: # content: # application/x-www-form-urlencoded: # examples: # s3: # summary: AWS S3 # value: # from_date: '2018-02-11' # to_date: '2018-02-11' # s3_bucket: mixpanel-events # s3_region: us-west-1 # s3_prefix: /folder1/sub1/ # where: 'properties["$os"]=="Linux"' # gcs: # summary: Google Cloud Storge # value: # from_date: '2018-02-11' # to_date: '2018-02-11' # gcs_bucket: mixpanel-events # gcs_prefix: /folder1/sub1/ # where: 'properties["$os"]=="Linux"' # schema: # oneOf: # - $ref: '#/components/schemas/s3RequestProperties' # - $ref: '#/components/schemas/gcsRequestProperties' # responses: # '200': # description: Success. # content: # application/json: # schema: # type: object # properties: # status: # type: string # example: ok # prefix: # type: string # example: folder1/sub1 components: securitySchemes: $ref: ./common/securitySchemes.yaml # schemas: # s3RequestProperties: # title: AWS S3 # required: # - from_date # - to_date # - s3_bucket # - s3_region # properties: # from_date: # type: string # description: >- # The date in yyyy-mm-dd format from which to begin querying for the # event from. This date is inclusive. # to_date: # type: string # description: >- # The date in yyyy-mm-dd format from which to stop querying for the # event from. This date is inclusive. # s3_bucket: # type: string # description: The name of your s3 bucket # s3_region: # type: string # description: The region of your s3 bucket # s3_prefix: # type: string # description: 'The string between a bucket name and an object name,' # where: # type: string # description: >- # An expression to filter events by. More info on expression sequence # structure can be found # [here](ref:segmentation-expressions) # gcsRequestProperties: # title: Google Cloud Storage # required: # - from_date # - to_date # - gcs_bucket # properties: # from_date: # type: string # description: >- # The date in yyyy-mm-dd format from which to begin querying for the # event from. This date is inclusive. # to_date: # type: string # description: >- # The date in yyyy-mm-dd format from which to stop querying for the # event from. This date is inclusive. # gcs_bucket: # type: string # description: The name of your GCS bucket # gcs_prefix: # type: string # description: 'The string between a bucket name and an object name,' # where: # type: string # description: >- # An expression to filter events by. More info on expression sequence # structure can be found # [here](ref:segmentation-expressions) x-explorer-enabled: true x-proxy-enabled: true x-samples-enabled: true x-samples-languages: - curl - node - ruby - javascript - python