# OneSignal REST API — how to use (mcp.ai)

Connect your OneSignal REST API account and use 15 tools for notifications straight from your AI agent. Connect with your own API key. The OneSignal REST API enables developers to programmatically send push notifications, emails, and SMS, manage users and subscriptions, and configure apps.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_onesignal_rest_api?ms=1787296020000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `onesignal_rest_api_begin_live_activity`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/onesignal_rest_api`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/onesignal_rest_api/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/onesignal_rest_api/begin/live/activity` — Tool to start a Live Activity on OneSignal. Use when you need to initiate a Live Activity session with a push token and subscription ID.
  - body: { app_id: string, push_token: string, activity_id: string, subscription_id: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/create/notification` — Tool to create and send a OneSignal push notification. Use when you have your message and target audience ready to dispatch notifications.
  - body: { url?: string, data?: object, app_id: string, buttons?: object[], filters?: object[], contents: object, headings?: object, subtitle?: object, ios_sound?: string, large_icon?: string, send_after?: string, big_picture?: string, extra_params?: object, android_sound?: string, delayed_option?: string, ios_attachments?: object, included_segments?: string[], android_channel_id?: string, include_player_ids?: string[] }
- `POST https://api.mcp.ai/api/onesignal_rest_api/create/template` — Tool to create reusable message templates for push, email, and SMS channels. Use when you need to create a template that can be accessed through both the dashboard and API using a template_id.
  - body: { url?: string, isWP?: boolean, name: string, isAdm?: boolean, isIos?: boolean, isSMS?: boolean, app_id: string, isEdge?: boolean, isEmail?: boolean, contents?: object, headings?: object, isChrome?: boolean, isMacOSX?: boolean, isSafari?: boolean, isWP_WNS?: boolean, isAndroid?: boolean, isFirefox?: boolean, email_body?: string, isChromeWeb?: boolean, email_subject?: string, dynamic_content?: object }
- `POST https://api.mcp.ai/api/onesignal_rest_api/create/user` — Tool to create a OneSignal user with optional subscriptions and aliases. Aliases provided in the payload will be used to look up an existing user.
  - body: { app_id: string, identity?: object, properties?: object, subscriptions?: object[], subscription_options?: object }
- `POST https://api.mcp.ai/api/onesignal_rest_api/delete/alias` — Tool to delete an alias by alias label from a OneSignal user. Use when you need to remove a specific alias identity from a user's profile.
  - body: { app_id: string, alias_id: string, alias_label: string, alias_label_to_delete: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/delete/device` — Tool to delete a device (player) from a OneSignal app. Use when you need to remove a specific device by its player ID.
  - body: { app_id: string, player_id: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/fetch/user/identity` — Tool to retrieve all aliases for a user identified by a specific alias. Use when you need to fetch the complete identity mapping for a OneSignal user.
  - body: { app_id: string, alias_id: string, alias_label: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/get/eligible/iams` — Tool to retrieve the manifest of In-App Messages that a subscription is eligible to display. Use when you need to fetch eligible IAMs for a specific subscription.
  - body: { app_id: string, subscription_id: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/update/device` — Tool to update properties of an existing device. Use when you need to modify device attributes after registration.
  - body: { tags?: object, ad_id?: string, app_id: string, country?: string, language?: string, latitude?: number, playtime?: integer, timezone?: integer, device_os?: string, longitude?: number, player_id: string, test_type?: integer, created_at?: integer, identifier?: string, badge_count?: integer, device_type?: integer, last_active?: integer, amount_spent?: string, device_model?: string, game_version?: string, sms_auth_hash?: string, email_auth_hash?: string, external_user_id?: string, custom_attributes?: object, notification_types?: integer, external_user_id_auth_hash?: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/update/subscription` — Tool to update an existing subscription's properties. Use when you need to modify subscription attributes like token, enabled status, or device information.
  - body: { app_id: string, subscription: object, subscription_id: string, retain_previous_owner?: boolean }
- `POST https://api.mcp.ai/api/onesignal_rest_api/view/an/app` — Tool to retrieve metadata for a single OneSignal app. Use when you need to fetch app details by its ID.
  - body: { app_id: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/view/device` — Tool to retrieve details of a specific device (player). Use when you have a OneSignal player_id and need current device info.
  - body: { app_id: string, player_id: string }
- `POST https://api.mcp.ai/api/onesignal_rest_api/view/devices` — Tool to retrieve a paginated list of devices (players) for a OneSignal app. Use when you need to list or audit all registered devices for a given app.
  - body: { limit?: integer, app_id: string, offset?: integer }
- `POST https://api.mcp.ai/api/onesignal_rest_api/view/notifications` — Tool to retrieve details of multiple notifications. Use when you need to list notifications for a specific app.
  - body: { limit?: integer, app_id: string, offset?: integer }
- `POST https://api.mcp.ai/api/onesignal_rest_api/view/segments` — Tool to view segments for a OneSignal app. Use when you need to list all segments associated with an app.
  - body: { limit?: integer, app_id: string, offset?: integer }

## Example prompts
- "What can I do in OneSignal REST API?"
- "Show me a summary of my OneSignal REST API account"

## More
- Page: https://mcp.ai/onesignal_rest_api
- Agent spec (llms.txt): https://mcp.ai/onesignal_rest_api/llms.txt
- Postman collection: https://mcp.ai/onesignal_rest_api/postman.json
