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
support@userpilot.co.
Authorization
Userpilot API uses an API key to authenticate requests. You can find your API key on the Environment Page. Authentication Method: Include your API key in theAuthorization
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 Export API enforces rate limiting to ensure reliable data export operations and maintain system performance for all users. These limits help balance resource usage while enabling comprehensive analytics data retrieval.Rate Limit Details
- Job Limitation: One export job at a time per application token
Error Responses
The API returns specific error codes when limits are exceeded:409 Conflict
: Returned when attempting to create a new export job while another is in progress
Best Practices
Verify Job Status: Always check for existing export jobs before initiating a new one to avoid conflicts.Handle Conflicts Gracefully: When encountering a 409 Conflict error, wait for the current job to complete before retrying.Track Export Progress: Use job status endpoints to monitor export completion and download files promptly.Optimize Export Requests: Use specific date ranges and filters to reduce data volume and improve performance.
Data Restrictions
- Job Status Availability: Once an export job is created, the job status and related information will be available for 3 days. After this period, the job status will no longer be accessible via the API.
- File Download Expiry: The URLs generated to download the exported data files will expire after 2 days. Ensure you download the files within this time frame, as the links will no longer be valid afterward.
Providing a valid email address in the request is recommended. You’ll receive
a notification with download links when the export is ready, eliminating the
need to manually check job status.
For the schema of exported events and data, see the Event
Schema page.
For details on available lookup endpoints and how to use them, see the Data
Lookups page.
Data Schema Reference
The data exported via the Userpilot Export Analytics Data API follows the Userpilot Event Data Schema. This schema defines the structure, attributes, and relationships of all events, users, and companies included in your export. Key points:- Each exported event will include fields such as
app_token
,event_type
,event_name
,user_id
,company_id
,source
,inserted_at
, and more. - Auto-captured attributes (e.g.,
hostname
,device_type
,browser
, etc.) and custom attributes (in the metadata object) are included as described in the schema. - The schema covers all event types (
identify_user
,identify_company
,track
,track_feature
,page_view
,interaction
, etc.) and their specific attribute structures.
Your exported data may include new or additional fields as the schema evolves.
Please ensure your data processing pipelines can handle unexpected fields
gracefully.
API Endpoints
1. Trigger an Export Job
Endpoint
The endpoint URL uses the
appex
environment. For EU data residency, use
appex-eu
instead. See Environment
Settings for your specific endpoint.Description
Creates an export job to extract analytics data based on the specified parameters.Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
from | string | Yes | Start date of the export in YYYY-MM-DD format. | ”2024-05-02” |
to | string | Yes | End date of the export in YYYY-MM-DD format. | ”2024-09-30” |
emails | string[] | No | List of email addresses to receive the exported data. If omitted, no email is sent. | [“example@work.com”] |
event_type | string[] | No | List of event types to filter. Defaults: see below. | [“track”, “page_view”] |
user_id | string[] | No | Specific user IDs to filter. If omitted, all users are included. | [“123456”] |
company_id | string[] | No | Specific company IDs to filter. If omitted, all companies are included. | [“13162551529”] |
segment_id | string | No | Filter data based on a specific segment. | ”987654” |
format | string | No | Format of the exported data. Options: json (default) or csv . | ”csv” |
exclusions | boolean | No | Exclude users/companies set in the web app. Default: false . | true |
event_type
defaults to["identify_user", "identify_company", "page_view", "track", "track_feature", "interaction"]
if not provided.user_id
andcompany_id
default to empty arrays ([]
), meaning all users or companies are included by default.- The default export
format
isjson
.
Example Request
2. Show Jobs
Endpoint
Description
Retrieves a list of all export jobs triggered by your API token.Example Request
3. Show Job by Job ID
Endpoint
Description
Retrieves detailed information about a specific export job identified by itsjob_id
.
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
job_id | String | Yes | The unique identifier of the export job |
Example Request
- Ensure you retrieve job details within the 3-day availability window to effectively monitor ongoing jobs. - Download links for exported data will expire after 2 days, so make sure to download your data promptly.