OneSignal REST API

Push notifications triggered by AI conversations, delivered instantly

Your AI agent does not just talk, it takes action. When a customer interaction requires a follow-up notification, the agent fires a push message through OneSignal on the spot. Order updates, appointment reminders, and promotional alerts go out without anyone pressing send.

Chosen by 800+ global brands across industries

Notification power in every chat

Your AI agent orchestrates push notifications, manages subscriber devices, and segments audiences through OneSignal's REST API, all triggered by real-time conversation context.

Send Push Notifications

During a conversation, a customer opts into delivery updates. Your AI agent creates a push notification in OneSignal targeting that customer's device with personalized content, scheduling, and action buttons. The notification fires immediately or at the chosen time.

View Audience Segments

A marketing manager asks which user segments exist. The agent queries OneSignal for all segments with their names, sizes, and filter definitions. Perfect for quick audits before launching a campaign or verifying targeting criteria during planning conversations.

Manage Device Records

A customer reports duplicate notifications. The agent looks up their device record in OneSignal by player ID, reviews subscription status, and can update device properties or remove stale entries. Device hygiene happens in real-time during the support interaction.

Review Notification History

A team member asks what notifications were sent this week. The agent retrieves a paginated list of notifications from OneSignal showing content, delivery stats, and targeting details. Campaign performance becomes visible without opening the OneSignal dashboard.

Update Device Tags

A customer changes their preferences in a conversation. The agent updates custom tags on their OneSignal device record, adjusting which segments they belong to. Preference changes take effect immediately for future notification targeting.

View App Configuration

A developer needs to verify app settings. The agent retrieves OneSignal app metadata including the app name, platform configurations, and notification settings. Quick config checks happen right in conversation without API console access.

OneSignal REST API

Use Cases

Conversational notification workflows

Real scenarios where AI-driven conversations trigger targeted push notifications through OneSignal, closing the loop between customer engagement and re-engagement.

Transactional Alerts Triggered by Chat Actions

A customer confirms a shipping address change through your AI chatbot. The agent updates the order in your system, then immediately sends a push notification through OneSignal confirming the address was changed, with a deep link to track their package. The customer receives confirmation on their phone within seconds, even after closing the chat.

Smart Re-Engagement After Abandoned Conversations

A shopper asks about a product but leaves the chat without purchasing. Your AI Agent notes their interest, creates a targeted push notification in OneSignal with a personalized product recommendation and a limited-time discount, and schedules it for delivery 2 hours later. The shopper returns and converts. Cart abandonment drops measurably.

Support Escalation Notifications to On-Call Teams

A customer reports a critical production issue through the chatbot at 3 AM. Your AI Agent cannot resolve it automatically, so it creates a high-priority push notification through OneSignal targeting the on-call engineering segment. The notification includes the issue summary and a direct link to the support ticket. Response time drops from hours to minutes.

Try
OneSignal REST API

OneSignal REST API

FAQs

Frequently Asked Questions

How does the AI agent send push notifications through OneSignal?

The agent uses OneSignal's Create Notification endpoint, specifying the target audience via segments or player IDs, the message content per language, optional headings, and scheduling parameters. You can configure the agent to send notifications based on conversation triggers like order confirmations, preference changes, or support escalations.

Can I control which types of notifications the agent is allowed to send?

Yes. Configure your agent with rules about which notification types are permitted. You might allow transactional notifications like order updates and appointment reminders while requiring human approval for promotional campaigns. The agent respects whatever guardrails you set around notification content and frequency.

What OneSignal API key does Tars need?

Tars requires your OneSignal App API Key, found in the OneSignal dashboard under Settings, then Keys and IDs. This key authenticates REST API requests for your specific app. Keep the key secure and avoid sharing it. You can regenerate it from the OneSignal dashboard if needed.

Does Tars store subscriber device data from OneSignal?

No. Device information, segment data, and notification history are queried from OneSignal in real-time during conversations. Tars does not maintain a copy of your subscriber database. All data lives in your OneSignal account and is fetched live when the agent needs it.

Can the agent target notifications to specific user segments?

Yes. The Create Notification endpoint supports targeting by included_segments such as All, Active Users, or any custom segment you have defined in OneSignal. The agent can also target individual devices by player ID or apply advanced filters based on tags, location, and activity.

How is this different from sending notifications directly from the OneSignal dashboard?

The dashboard requires manual creation of each notification. With Tars, notifications are triggered automatically based on conversation context. A customer confirms an order and the push goes out. A lead qualifies and a follow-up notification schedules itself. No one needs to open the OneSignal dashboard for routine messaging.

Can the agent schedule notifications for later delivery?

Yes. The Create Notification endpoint supports a send_after parameter in ISO 8601 format, as well as delayed_option for timezone-based or last-active-based delivery. The agent can schedule a notification during a conversation to be delivered hours or days later.

What happens if a notification fails to deliver?

The agent can check delivery status by reviewing notification records through the View Notifications endpoint. If a notification was not delivered due to invalid device tokens or disabled subscriptions, the agent can identify the issue, update the device record, and attempt redelivery or notify the support team.

How to add Tools to your AI Agent

Supercharge your AI Agent with Tool Integrations

Don't limit your AI Agent to basic conversations. Watch how to configure and add powerful tools making your agent smarter and more functional.

Privacy & Security

We’ll never let you lose sleep over privacy and security concerns

At Tars, we take privacy and security very seriously. We are compliant with GDPR, ISO, SOC 2, and HIPAA.

GDPR
ISO
SOC 2
HIPAA

Still scrolling? We both know you're interested.

Let's chat about AI Agents the old-fashioned way. Get a demo tailored to your requirements.

Schedule a Demo