Create Custom Events
Changed onThe Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones.
Request
- Base URLhttps://api.onesignal.com
- URLhttps://api.onesignal.com/apps/{app_id}/custom_events
- Authnone required
Path parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
Headers
Your app API key with prefix Key . See Keys & IDs.
Request body
Response
Accepted. Events that could not be processed are listed in errors. Other events in the same request were processed. An empty errors array, or a response with no body, means every event was accepted. An individual event fails when its user identifier does not match a OneSignal user (not found), when name is empty (empty event name), when name is longer than 512 bytes (event name too long), or when the app is at its limit of 1,000 unique event names (too many event names).
Example response
{
"errors": [
{
"event_user_id": "abc123",
"error": {
"code": "not found",
"title": "failed to find a onesignal_id for user_id abc123"
}
}
]
}Changes
- breaking
the
headerrequest parameterAuthorizationbecame required - breaking
the response property
//became nullable for the status
- breaking