Skip to main content
The Import API allows you to import historical user data from other platforms into Userpilot. With this API, you can migrate data related to user and company identification, page views, and custom events. This enables a seamless transition and continuity of insights, providing a comprehensive view of user interactions.
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

  1. Data Migration: Migrate historical data from other analytics platforms to Userpilot, ensuring no loss of valuable insights.
  2. Retrospective Analysis: Analyze historical user behavior and feature engagement by importing past data on user actions, page views, and events.
PII Data NoticeBefore passing any Personally Identifiable Information (PII) such as names, emails, or other sensitive user data to Userpilot:
  • Security & Compliance: Verify internally with your legal, security, and compliance teams that doing so aligns with your organization’s data privacy policies and applicable regulations (e.g., GDPR, CCPA).
  • Data Type Mapping: Ensure correct data type mapping for all properties. Userpilot supports String, Numeric, and Date types. Make sure dates are in ISO8601 format and numeric values are properly formatted. Incorrect type mapping can cause issues with segmentation, analytics, and debugging.
  • Debugging: Proper data formatting is crucial for effective debugging and troubleshooting. Verify that your data maps correctly to Userpilot’s expected formats before implementation.
If you’re migrating from another provider, complete the import process before installing the SDK. This ensures historical data is ready for analysis once Userpilot starts tracking live events.
The Import API does not merge with a user’s or company’s existing (or live) property state, unlike real-time Identify calls. Each imported event is written as-is, so it’s meant for one-time historical backfill, not ongoing updates to current property values. If a user is later identified in real time, that identify can overwrite properties you imported. To keep current property values in sync, use the Bulk Update API instead.

Authorization

See the Authentication and Environment pages for details on API key usage and endpoint URLs. Authentication Method: Include your API key in the Authorization header:
All API requests must be made over HTTPS.
Your API key carries many privileges, so be sure to keep it secure! Do not share your secret API keys in publicly accessible areas.

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 token
  • 409 Conflict: Returned when attempting to create a new import job while another is in progress
  • 413 Payload Too Large: Returned when file size exceeds 1 GB

Best Practices

Check Job Status First: Always verify no existing import jobs are running before initiating a new one.Implement Retry Logic: When encountering a 409 Conflict error, wait for the current job to complete before retrying.Monitor Job Progress: Use the job status endpoints to track import progress and avoid conflicts.Optimize File Sizes: For very large datasets, consider splitting files to stay within the 1 GB limit.

Endpoints

For most users, the HTTP API endpoint URL is https://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

file.ndjson
Uploading the File

Response


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 its job_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.
For best practices on importing user and company data, see Best Practices for Accumulative Properties.