Expiry TTL

TTL (Time to Live) controls how long a message stays active before it expires. Set it in seconds to auto-remove outdated notifications, keeping things relevant and clutter-free. ⏳


Not every notification needs to stick around forever. With TTL, you decide how long a message remains visible before disappearing automatically.

  • Set in Seconds: Define how long the message should stay active.

  • Expires Silently: No extra notifications—just poof, gone.

  • Defaults to Forever: If you don’t set a TTL, the message won’t expire on its own.

At the moment JustPush.io receives a push notification, we calculate the expiry based on the expiry_ttl. The expiry_ttl is in seconds and is added to the time of receipt.

Use Cases

Some notifications are only relevant for a short time. TTL ensures they disappear when they’re no longer useful, keeping your notifications fresh and clutter-free. Here’s when to use it:

Good Use Cases

Temporary Alerts: A flash sale notification that expires after an hour. ✅ Live Data Feeds: Stock updates that auto-remove after 60 seconds. ✅ Event Reminders: A meeting alert that vanishes when the meeting starts.

Bad Use Cases

Using a short TTL for critical alerts. (Gone before you see it!) ❌ Setting TTL too long for temporary updates. (Old news clutters your feed.)

Requirements

Attribute
Data Type
Validation Criteria

expiry_ttl

integer

max2147483647

Example Request

curl -X "POST" "https://api.justpush.io/messages" \
     -H 'Content-Type: application/json' \
     -d $'{
       "user": "<< USER KEY >>",
       "title": "A simple title",
       "message": "A simple test message",       
       "expiry_ttl": "90",
      }'

Mobile App

Below you see an example of how this displayed as a push message and within the app.

Push Message

Push Message with Title and Message

JustPush.io App

Message with a set expiry

Frequently Asked Questions

What happens when a message expires?

The contents of the message will disappear. This happens to both readand unreadmessages. We don't wait for you to have read the message.

Can I cancel TTL once set?

Nope! Once a message has a TTL, it follows the countdown.

What’s the max TTL I can set?

2147483647 seconds, in other words 68 years and bit. We aim to have you still as a customer by then!.

Last updated