Skip to main content
POST
/
apps
/
{app_id}
/
custom_events
Create Custom Events
curl --request POST \
  --url https://api.onesignal.com/apps/{app_id}/custom_events \
  --header 'Content-Type: application/json' \
  --data '{
  "events": [
    {
      "name": "<string>",
      "external_id": "<string>",
      "onesignal_id": "<string>",
      "timestamp": "<string>",
      "properties": {}
    }
  ]
}'
"{}"

Overview

The Custom Events API allows you to track user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. See Custom events for more information.

Use Cases

Custom events can be used to:

Headers

Authorization
string
default:Key YOUR_APP_API_KEY

Your app API key with prefix Key. See Keys & IDs.

Path Parameters

app_id
string
required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

Body

application/json
events
object[]
required

Array of event objects to be recorded

Response

200

The response is of type object.

I