# Notification inbox

Requires v3.3+This feature requires SDK version 3.3 or later.

 Minimum SDK required: 3.3

Users who don’t have a version of your app with Customer.io SDK version 3.3 or later will not see this feature and related messages. If you send inbox messages to users without the minimum required version, they won’t be *delivered*.

## How it works[](#how-it-works)

Unlike other messages, inbox messages don’t necessarily appear immediately to users, and they don’t disappear when the user dismisses them. Instead, you’ll display these messages through a notification inbox that your audience can access at their leisure.

Customer.io delivers inbox messages as JSON payloads, not fully-rendered messages. The SDK helps you listen for these payloads, but you’ll determine how to display them in your own inbox client.

You can send an inbox message as a part of a [campaign, broadcast](/journeys/send-inbox/), or [transactional message](/journeys/send-inbox-txnl/).

## Get the inbox instance[](#get-the-inbox-instance)

You’ll access inbox functionality through the `inbox` property on the in-app messaging module.

```dart
final inbox = CustomerIO.inAppMessaging.inbox;
```

## Inbox methods[](#inbox-methods)

The inbox instance provides several methods to manage messages.

Method

Description

`fetchMessages({String? topic})`

Fetch messages from the inbox. Optionally filter by topic. Returns a Future with the list of messages.

`messages({String? topic})`

Stream messages from the inbox for real-time updates. Optionally filter by topic. Returns a Stream of message lists.

`markMessageOpened(message)`

Mark a message as opened.

`markMessageUnopened(message)`

Mark a message as unopened.

`markMessageDeleted(message)`

Mark a message as deleted.

`trackMessageClicked(message, {String? actionName})`

Track a click on the message. The `actionName` parameter is optional.

## Inbox message payloads[](#inbox-message-payloads)

Inbox messages are delivered as a JSON payload. The SDK helps you listen for the payload, but you’ll render the content in your own inbox client.

The client payload includes the following fields, but you’re most concerned with the `properties` object, which represents your message content. By default, we’ll send a `title` and `body` field, but you can add other fields like an `image` or a `link`—whatever you set up your inbox to expect.

Make sure that your team members know what payloads to send—especially if you expect different payloads for different topics or types of messages.

Field

Type

Description

`messageId`

string

Unique identifier for the message.

`sentAt`

string

When the message was sent.

`expiresAt`

string

When the message will expire.

`opened`

boolean

Whether the message has been opened.

`topics`

array

The topics that the message belongs to.

`type`

string

The type of message.

`properties`

object

The properties of the message.

```json
{
    "messageId": "1234567890",
    "sentAt": "2026-02-05T12:00:00Z",
    "expiresAt": "2026-02-05T12:00:00Z",
    "opened": false,
    "topics": ["orders", "shipping"],
    "type": "order_shipped",
    "properties": {
        "title": "Hey Cool Person, your order shipped!",
        "body": "You can track your order #1234567890 here:",
        "link": "https://example.com/orders/1234567890"
    }
}
```

### Inbox topics and types[](#inbox-topics-and-types)

When you send an inbox message, you can assign it to one or more topics. You can use these topics to filter messages when you fetch them. You can also use the topics to determine how to render the messages in your notification inbox.

Messages also have a `type`. Think of this like a sub-category or topic for a message. For example, you might have `orders` and `sale` topics, where `orders` don’t have images but `sale` topics might. Or, within the `orders` topic, you might have `order_placed` and `order_shipped` types, where `order_placed` lists order details and images of purchased products and `order_shipped` provides a link to the tracking information for the order that opens in a new tab.

## Setup your notification inbox[](#setup-your-notification-inbox)

Inbox messages are just JSON payloads. You’ll need to build your own inbox client to display the messages. The code below gives you a starting point, but you can build your own inbox client however you want.

### Fetch messages[](#fetch-messages)

```dart
// Fetch all messages
final messages = await inbox.fetchMessages();

// Fetch messages filtered by topic
final promotions = await inbox.fetchMessages(topic: 'promotions');
```

### Stream messages for real-time updates[](#stream-messages-for-real-time-updates)

```dart
// Stream all messages (real-time updates)
inbox.messages().listen((messages) {
  // Update your UI with the messages
  updateInboxUI(messages);
});

// Stream messages filtered by topic
inbox.messages(topic: 'promotions').listen((messages) {
  // Update your UI with promotions
  updatePromotionsUI(messages);
});
```

### Mark messages as opened or unopened[](#mark-messages-as-opened-or-unopened)

```dart
// Mark a message as opened
inbox.markMessageOpened(message);

// Mark a message as unopened
inbox.markMessageUnopened(message);
```

### Track message clicks[](#track-message-clicks)

```dart
// Track a click without an action name
inbox.trackMessageClicked(message);

// Track a click with an action name
inbox.trackMessageClicked(message, actionName: 'view_details');
```

### Delete messages[](#delete-messages)

```dart
// Mark a message as deleted
inbox.markMessageDeleted(message);
```

## Working with message properties[](#working-with-message-properties)

You can access message properties to display custom content in your inbox:

```dart
// Access message properties
final title = message.properties['title'] as String?;
final body = message.properties['body'] as String?;
final link = message.properties['link'] as String?;
final imageUrl = message.properties['image'] as String?;

// Handle message action when user taps
void handleMessageTap(InboxMessage message) {
  // Mark as opened
  inbox.markMessageOpened(message);

  // Track the click
  inbox.trackMessageClicked(message);

  // Open link if available
  final link = message.properties['link'] as String?;
  if (link != null) {
    launchUrl(Uri.parse(link));
  }
}
```