openapi: 3.1.0 info: title: Kissmetrics REST API — exports version: '3' description: 'Export endpoints: export a completed query result to CSV or to an S3 bucket, and check export status. Assembled verbatim from the per-operation OpenAPI 3.1.0 documents Kissmetrics publishes on each reference page of support.kissmetrics.io (the `.md` twin of every endpoint page carries a complete `# OpenAPI definition` block). Nothing was authored by API Evangelist; operations were grouped by resource and identical path+method variants merged as `oneOf`.' contact: name: Kissmetrics Support url: https://support.kissmetrics.io/reference/overview-1 servers: - url: https://query.kissmetrics.io/v3 description: Kissmetrics Query API v3 tags: - name: exports description: 'Export endpoints: export a completed query result to CSV or to an S3 bucket, and check export status.' security: - basicAuth: [] paths: /exports: post: summary: Create an Export description: Create an export of a completed query result. Kissmetrics publishes one request body per export target (CSV, S3) on its own reference page, all against `POST /exports`; the accepted bodies are merged here as `oneOf`. operationId: create-export requestBody: content: application/json: schema: oneOf: - type: object required: - export_type - query_id properties: export_type: type: string description: '`csv`' default: csv query_id: type: string options: properties: name: type: string email: type: string required: - name type: object title: Export to CSV description: 'The results of both ad-hoc queries and saved report queries can be exported to CSV. The Kissmetrics Query API requires the type of export (CSV), the ID of the query to export (obtained from running an ad-hoc report or running a saved report), and a name parameter to assign to the CSV file. The response for this endpoint provides an export ID, which can be used to check the status of the export (unstarted/started/completed/error/cancelled) or to obtain the link to the CSV.' - type: object required: - export_type - query_id properties: export_type: type: string description: '`s3`' default: s3 query_id: type: string options: properties: bucket: type: string path: type: string email: type: string required: - bucket - path type: object title: Export to S3 description: 'The results of both ad-hoc queries and saved report queries can be exported to a S3 bucket in CSV format. The Kissmetrics Query API requires S3 bucket details and the ID of the query to export (obtained from running an ad-hoc report or running a saved report). The S3 bucket must be writable or else the export will fail. See the documentation for instructions on how to give write access to Kissmetrics. The response for this endpoint provides an export ID, which can be used to check the status of the export (unstarted/started/completed/error/cancelled). If an error occurs and an email is provided, an error notification will be sent to the specified address.' responses: '200': description: '200' content: text/plain: examples: Result: value: '' '400': description: '400' content: application/json: examples: Result: value: '{}' schema: type: object properties: {} deprecated: false x-published-variants: - operationId: export-to-csv summary: Export to CSV docs: https://support.kissmetrics.io/reference/export-to-csv - operationId: export-to-s3 summary: Export to S3 docs: https://support.kissmetrics.io/reference/export-to-s3 x-source: https://support.kissmetrics.io/reference/export-to-csv tags: - exports /exports/{export_id}: get: summary: Export Status description: This endpoint provides information on the status of active exports and also provides the link to the CSV for completed CSV exports. This endpoint requires the export ID obtained from exporting a query. operationId: export-status parameters: - name: export_id in: path schema: type: string required: true responses: '200': description: '200' content: application/json: examples: Result: value: '{}' schema: type: object properties: {} '400': description: '400' content: application/json: examples: Result: value: '{}' schema: type: object properties: {} deprecated: false x-source: https://support.kissmetrics.io/reference/export-status tags: - exports components: securitySchemes: basicAuth: type: http scheme: basic description: HTTP Basic. Base64 of `username:password` (or of `API_KEY:` with an empty password) in the Authorization header.