v1

latestOpenAPI 3.1.02026-07-26497885.9 KB

Create Custom Events

The 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.

post/apps/{app_id}/custom_events

Path parameters

app_idstring required

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

Headers

Authorizationstring

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

Request body

Response

Accepted with optional partial-success details. The response body lists any individual events that could not be processed (typically because the supplied event_user_id does not resolve to a OneSignal user); other events in the same payload were processed normally. An empty errors array (or absent body) means every event was accepted.

Example response

{
  "errors": [
    {
      "event_user_id": "abc123",
      "event_id": "567491ee-9105-4a87-9cbc-ed78a571645b",
      "error": {
        "code": "not found",
        "title": "failed to find a onesignal_id for user_id abc123"
      }
    }
  ]
}