This feature is available on the Enterprise plan only or as an add-on to the
Growth plan. If interested in adding this feature please contact
sales@userpilot.com or your designated Customer Success Manager (CSM).
Use Cases
- Data Migration: Migrate historical data from other analytics platforms to Userpilot, ensuring no loss of valuable insights.
- Retrospective Analysis: Analyze historical user behavior and feature engagement by importing past data on user actions, page views, and events.
Authorization
See the Authentication and Environment pages for details on API key usage and endpoint URLs. Authentication Method: Include your API key in theAuthorization header:
All API requests must be made over HTTPS.
Rate Limits
The Import API implements rate limiting to maintain system stability and ensure fair resource allocation across all users. These limits help prevent system overload while allowing efficient data migration workflows.Rate Limit Details
- Job Limitation: One import job at a time per application token
- File Size: Up to 1 GB file size for import operations
Error Responses
401 Unauthorized: Returned when the API token is missing, invalid, or isn’t a write/admin token409 Conflict: Returned when attempting to create a new import job while another is in progress413 Payload Too Large: Returned when file size exceeds 1 GB
Best Practices
Endpoints
For most users, the HTTP API endpoint URL ishttps://analytex.userpilot.io. If you are on Enterprise or EU hosting, refer to the Environment page in the application to retrieve your dedicated endpoint.
1. Request Data Import
Endpoint
The endpoint URL uses the
analytex environment. For EU data residency, use
analytex-eu instead. See Environment
Settings for your specific endpoint.Description
Initiates a data import job. Accepts a file in CSV or NDJSON format containing historical data.Headers
Request Parameters
Data Format
The imported data should conform to a list of events. See the Import API Event Schema for details on supported event types and required fields.Required fields vary by
source. For example, source: web-client events require hostname and pathname (or a url field in their place), plus user_agent.Example Import File
- NDJSON
- CSV
file.ndjson
Response
- Success
- Error
2. Get All Import Job Statuses
Endpoint
Description
Fetches the status of all import jobs, allowing users to monitor the progress of multiple imports at once.Headers
Example Request
Response
Returns a list of job objects, each with details such as job_id, status, start_time, end_time, total_rows, and reason_for_failure (if any).status can be queued, pending_refresh (data written, finalizing before completion), completed, or failed.
3. Get Job Status by ID
Endpoint
Description
Fetches the status of a specific import job using itsjob_id, useful for tracking a single import job.
Headers
Path Parameters
Example Request
Response
Returns job details including job_id, status, start_time, end_time, total_rows, and reason_for_failure (if any).For required validation rules for your import file, see the Row Validation
Rules page.