Data Subject Request API Version 1 and 2
Data Subject Request API Version 3
Platform API Overview
Accounts
Apps
Audiences
Calculated Attributes
Data Points
Feeds
Field Transformations
Services
Users
Workspaces
Warehouse Sync API Overview
Warehouse Sync API Tutorial
Warehouse Sync API Reference
Data Mapping
Warehouse Sync SQL Reference
Warehouse Sync Troubleshooting Guide
ComposeID
Warehouse Sync API v2 Migration
Bulk Profile Deletion API Reference
Calculated Attributes Seeding API
Custom Access Roles API
Data Planning API
Group Identity API Reference
Pixel Service
Profile API
Events API
mParticle JSON Schema Reference
IDSync
AMP SDK
Initialization
Configuration
Network Security Configuration
Event Tracking
User Attributes
IDSync
Screen Events
Commerce Events
Location Tracking
Media
Kits
Application State and Session Management
Data Privacy Controls
Error Tracking
Opt Out
Push Notifications
WebView Integration
Logger
Preventing Blocked HTTP Traffic with CNAME
Linting Data Plans
Troubleshooting the Android SDK
API Reference
Upgrade to Version 5
Cordova Plugin
Identity
Direct URL Routing FAQ
Web
Android
iOS
Initialization
Configuration
Event Tracking
User Attributes
IDSync
Screen Tracking
Commerce Events
Location Tracking
Media
Kits
Application State and Session Management
Data Privacy Controls
Error Tracking
Opt Out
Push Notifications
Webview Integration
Upload Frequency
App Extensions
Preventing Blocked HTTP Traffic with CNAME
Linting Data Plans
Troubleshooting iOS SDK
Social Networks
iOS 14 Guide
iOS 15 FAQ
iOS 16 FAQ
iOS 17 FAQ
iOS 18 FAQ
API Reference
Upgrade to Version 7
Getting Started
Identity
Upload Frequency
Getting Started
Opt Out
Initialize the SDK
Event Tracking
Commerce Tracking
Error Tracking
Screen Tracking
Identity
Location Tracking
Session Management
Initialization
Configuration
Content Security Policy
Event Tracking
User Attributes
IDSync
Page View Tracking
Commerce Events
Location Tracking
Media
Kits
Application State and Session Management
Data Privacy Controls
Error Tracking
Opt Out
Custom Logger
Persistence
Native Web Views
Self-Hosting
Multiple Instances
Web SDK via Google Tag Manager
Preventing Blocked HTTP Traffic with CNAME
Facebook Instant Articles
Troubleshooting the Web SDK
Browser Compatibility
Linting Data Plans
API Reference
Upgrade to Version 2 of the SDK
Getting Started
Identity
Web
Alexa
Node SDK
Go SDK
Python SDK
Ruby SDK
Java SDK
Overview
Step 1. Create an input
Step 2. Verify your input
Step 3. Set up your output
Step 4. Create a connection
Step 5. Verify your connection
Step 6. Track events
Step 7. Track user data
Step 8. Create a data plan
Step 9. Test your local app
Overview
Step 1. Create an input
Step 2. Verify your input
Step 3. Set up your output
Step 4. Create a connection
Step 5. Verify your connection
Step 6. Track events
Step 7. Track user data
Step 8. Create a data plan
Step 1. Create an input
Step 2. Create an output
Step 3. Verify output
Introduction
Outbound Integrations
Firehose Java SDK
Inbound Integrations
Compose ID
Data Hosting Locations
Glossary
Rules Developer Guide
API Credential Management
The Developer's Guided Journey to mParticle
Create an Input
Start capturing data
Connect an Event Output
Create an Audience
Connect an Audience Output
Transform and Enhance Your Data
The new mParticle Experience
The Overview Map
Introduction
Data Retention
Connections
Activity
Live Stream
Data Filter
Rules
Tiered Events
mParticle Users and Roles
Analytics Free Trial
Troubleshooting mParticle
Usage metering for value-based pricing (VBP)
Introduction
Sync and Activate Analytics User Segments in mParticle
User Segment Activation
Welcome Page Announcements
Project Settings
Roles and Teammates
Organization Settings
Global Project Filters
Portfolio Analytics
Analytics Data Manager Overview
Events
Event Properties
User Properties
Revenue Mapping
Export Data
UTM Guide
Data Dictionary
Query Builder Overview
Modify Filters With And/Or Clauses
Query-time Sampling
Query Notes
Filter Where Clauses
Event vs. User Properties
Group By Clauses
Annotations
Cross-tool Compatibility
Apply All for Filter Where Clauses
Date Range and Time Settings Overview
Understanding the Screen View Event
Analyses Introduction
Getting Started
Visualization Options
For Clauses
Date Range and Time Settings
Calculator
Numerical Settings
Assisted Analysis
Properties Explorer
Frequency in Segmentation
Trends in Segmentation
Did [not] Perform Clauses
Cumulative vs. Non-Cumulative Analysis in Segmentation
Total Count of vs. Users Who Performed
Save Your Segmentation Analysis
Export Results in Segmentation
Explore Users from Segmentation
Getting Started with Funnels
Group By Settings
Conversion Window
Tracking Properties
Date Range and Time Settings
Visualization Options
Interpreting a Funnel Analysis
Group By
Filters
Conversion over Time
Conversion Order
Trends
Funnel Direction
Multi-path Funnels
Analyze as Cohort from Funnel
Save a Funnel Analysis
Explore Users from a Funnel
Export Results from a Funnel
Saved Analyses
Manage Analyses in Dashboards
Dashboards––Getting Started
Manage Dashboards
Dashboard Filters
Organize Dashboards
Scheduled Reports
Favorites
Time and Interval Settings in Dashboards
Query Notes in Dashboards
User Aliasing
The Demo Environment
Keyboard Shortcuts
Analytics for Marketers
Analytics for Product Managers
Compare Conversion Across Acquisition Sources
Analyze Product Feature Usage
Identify Points of User Friction
Time-based Subscription Analysis
Dashboard Tips and Tricks
Understand Product Stickiness
Optimize User Flow with A/B Testing
User Segments
IDSync Overview
Use Cases for IDSync
Components of IDSync
Store and Organize User Data
Identify Users
Default IDSync Configuration
Profile Conversion Strategy
Profile Link Strategy
Profile Isolation Strategy
Best Match Strategy
Aliasing
Overview
Create and Manage Group Definitions
Introduction
Catalog
Live Stream
Data Plans
Blocked Data Backfill Guide
Predictive Attributes Overview
Create Predictive Attributes
Assess and Troubleshoot Predictions
Use Predictive Attributes in Campaigns
Predictive Audiences Overview
Using Predictive Audiences
Introduction
Profiles
Warehouse Sync
Data Privacy Controls
Data Subject Requests
Default Service Limits
Feeds
Cross-Account Audience Sharing
Approved Sub-Processors
Import Data with CSV Files
CSV File Reference
Glossary
Video Index
Single Sign-On (SSO)
Setup Examples
Introduction
Introduction
Introduction
Rudderstack
Google Tag Manager
Segment
Advanced Data Warehouse Settings
AWS Kinesis (Snowplow)
AWS Redshift (Define Your Own Schema)
AWS S3 (Snowplow Schema)
AWS S3 Integration (Define Your Own Schema)
BigQuery (Snowplow Schema)
BigQuery Firebase Schema
BigQuery (Define Your Own Schema)
GCP BigQuery Export
Snowflake (Snowplow Schema)
Snowplow Schema Overview
Snowflake (Define Your Own Schema)
Aliasing
mParticle provides an HTTP-based Events API that can be used to collect data from your backend systems.
The base URL for the Events API varies depending on the data localization region for your mParticle account:
Region | Pod | URL |
---|---|---|
United States | US1 | https://s2s.mparticle.com/v2, https://s2s.us1.mparticle.com/v2 |
United States | US2 | https://s2s.us2.mparticle.com/v2 |
Europe | EU1 | https://s2s.eu1.mparticle.com/v2 |
Australia | AU1 | https://s2s.au1.mparticle.com/v2 |
The mParticle Events API can be authenticated with basic authentication in either of two ways:
You can manually set the Authorization
header in calls to the Events API by including your key and secret encoded together:
example-api-key:example-api-secret
ZXhhbXBsZS1hcGkta2V5OmV4YW1wbGUtYXBpLXNlY3JldA==
Basic ZXhhbXBsZS1hcGkta2V5OmV4YW1wbGUtYXBpLXNlY3JldA==
Authorization: Basic ZXhhbXBsZS1hcGkta2V5OmV4YW1wbGUtYXBpLXNlY3JldA==
The following examples demonstrate how to execute a general request to the Events API, however, the size of an example request body exercising every available property and parameter is too large to include. For a complete reference of the Events API schema that lists each property and parameter, see the JSON reference.
Use the Open API (previously known as Swagger) specification or similar tools to generate helper SDKs (using Swagger Codegen or OpenAPI Generator) for the Events API:
mParticle imposes default service limits on server-to-server data transfers using the Events API. For the specific limits, see Default Service Limits.
When sending large amounts of data to the Events API, use efficient batching strategies to prevent drops in performance.
Remember that one event batch includes an array than can contain one or more events. If you are tracking a large number of events that are all triggered by a single user, combine as many events as possible in a single batch based on a predetermined rate, such as a set number of events per timespan or a set number of events per user. Sending one batch for each event incurs a noticeable drop in performance.
You can further reduce your number of requests by grouping up to 100 event batches for multiple users and sending them to the /bulkevents
endpoint.
Event batches require the following:
/bulkevents
must contain no more than 100 batchesExceeding these limits results in throttling.
POST
https://s2s.{pod}.mparticle.com/v2/events
curl --location --request POST 'https://s2s.{pod}.mparticle.com/v2/events' \
--header 'Authorization: Basic {your-api-key}:{your-api-secret}' --data-raw '{ your-event-batch }'
{
"events" : [
{
"data" : {},
"event_type" : "custom_event"
}
],
"device_info" : {},
"user_attributes" : {},
"deleted_user_attributes" : [],
"user_identities" : {},
"application_info" : {},
"schema_version": 2,
"environment": "production",
"context" : {},
"ip" : "172.217.12.142"
}
A successful request receives a 200 Accepted
response.
POST
https://s2s.{pod}.mparticle.com/v2/bulkevents
This path accepts a JSON array of event batches. See our JSON documentation for additional information.
You may not send more than 100 EVENT DATA items per request.
If some event batches succeed and some event batches fail, you still receive a 202 Accepted
response.
Don’t use this URL to upload historical data older than 30 days, as this could impact downstream processes such as audience calculation. To upload historical data older than 30 days, use the historical endpoint.
curl --location --request POST 'https://s2s.{pod}.mparticle.com/v2/bulkevents' \
--header 'Authorization: Basic {your-api-key}:{your-api-secret}' --data-raw '{ array-of-event-batches }'
[
{
"events" : [
{
"data" : {},
"event_type" : "custom_event"
}
],
"device_info" : {},
"user_attributes" : {},
"deleted_user_attributes" : [],
"user_identities" : {},
"application_info" : {},
"schema_version": 2,
"environment" : "production",
"context" : {},
"ip" : "172.217.12.142"
},
{
"events" : [
{
"data" : {},
"event_type" : "custom_event"
}
],
"device_info" : {},
"user_attributes" : {},
"deleted_user_attributes" : [],
"user_identities" : {},
"application_info" : {},
"schema_version" : 2,
"environment" : "production",
"context" : {},
"ip" : "172.217.12.142"
}
]
A successful request receives a 202 Accepted
response.
POST
https://s2s.{pod}.mparticle.com/v2/bulkevents/historical
This path accepts the same JSON payload as /v2/bulkevents and should be used to upload historical data more than 30 days old. Data forwarded to the historical endpoint is subject to special requirements and is processed differently.
A batch received by the historical data endpoint will not be processed if any of the following are true:
timestamp_unixtime_ms
property,timestamp_unixtime_ms
is less than 72 hours old.The historical
API endpoint behaves nearly identically to the events
and bulkevents
endpoints with one key difference: data is not forwarded to connected event and data warehouses.
mParticle Feature | Effect of historical data |
---|---|
Event and Data Warehouse Outputs | Not forwarded downstream. |
Audience | No change to Real-time or Standard Audiences. Data is subject to existing date-range retention limits. Real-time audiences have a 30 day look-back for most customers. |
User Activity | No change; Events visible in date order. |
Identity and Profiles | No change |
curl --location --request POST 'https://s2s.{pod}.mparticle.com/v2/bulkevents/historical' \
--header 'Authorization: Basic {your-api-key}:{your-api-secret}' --data-raw '{ historical-event-batch }'
{
"events" : [
{
"data" : {},
"event_type" : "custom_event"
}
],
"device_info" : {},
"user_attributes" : {},
"deleted_user_attributes" : [],
"user_identities" : {},
"application_info" : {},
"schema_version": 2,
"environment": "production",
"context" : {},
"ip" : "172.217.12.142"
}
A successful request receives a 202 Accepted
response.
Status | Code | Notes |
---|---|---|
202 | Accepted | The POST was accepted. |
400 | Bad Request | The request JSON was malformed JSON or had missing fields. |
401 | Unauthorized | The authentication header is missing. |
403 | Forbidden | The authentication header is present, but invalid. |
429 | Too Many Requests | You have exceeded your provisioned limit. The v2/events and v2/bulkevents endpoints may return a Retry-After response header with a value containing a non-negative decimal integer indicating the number of seconds to delay. If the header is not present, we recommend retrying your request with exponential backoff and random jitter.. Learn more about API throttling in Default Service Limits. |
503 | Service Unavailable | We recommend retrying your request in an exponential backoff pattern |
5xx | Server Error | A server-side error has occurred, please try your request again. |
In some cases, the server provides additional information in the response body. If no additional information is available, the response body will be omitted and you will only receive the status code and message.
{
"errors" :
[
{
"code" : "BAD_REQUEST",
"message" : "Required event field \"event_type\" is missing or empty."
}
]
}
Was this page helpful?