---
title: "Send In-App Message"
method: POST
path: "/v1/in-app-messages"
---

# Send In-App Message

`POST /v1/in-app-messages`

This endpoint can only be used with your Server credentials and allows you to send in-app messages directly to one or more customers.

## Request body

- object
  - `target` object, required
    - `userIds` string[] — The list of CustomerIDs that should receive the message, max length per entry 255
    - `installIds` string[] — The list of VisitorIDs that should receive the message, max length per entry 255
  - `templateId` integer, required
  - `content` string, json — Object of dynamic content tags keyed by their respective title, required if template contains dynamic tags
  - `presentedWhen` 'immediately' | 'next-open' | 'never', required — Immediately: If the message syncs during the users current session it will display immediately. Next Open: Once synced the message will be displayed at the start of the user's next session. Never: The message will not be shown unless the user explicitly opens it from the inbox or push notification (if configured).
  - `data` string, json — Optional object of additional key:values to be passed in the message payload for your app to consume
  - `notification` object
    - `title` string, required
    - `message` string, required
    - `ios` object
      - `category` string — This will trigger your UNNotificationContentExtension whose ID matches this category.
      - `badge` object
        - `type` 'incrementBy' | 'setTo'
        - `count` integer — Positive or Negative integer. Set to 0 to clear badge.
      - `sound` string — Sound file to play instead of the default device notification sound. Pass 'none' to disable vibration and sound for the notification.
      - `media` object
        - `pictureUrl` string — URL for image to include in notification
    - `android` object
      - `highPriority` boolean — Boolean, sets priority flag to wake up Android devices
      - `sound` string — Sound file that is included in your app to play instead of the default device notification sound.
      - `pictureUrl` string — URL for image to include in notification
      - `notificationType` 'general' | 'important' — General will use the default channel on device and drop into the notification tray. Important will present a heads-up notification. Cannot be combined with notificationChannel.
      - `notificationChannel` string — ID of the notification channel on the device to put the notification into, must exist on the device or will fallback to "general". Cannot be combined with notificationType.
  - `schedule` object
    - `sendAt` string — DateTime of format "Y-m-d" (for strategy "intelligent") or "Y-m-d H:i" otherwise
    - `strategy` 'local' | 'utc' | 'timezone' | 'intelligent'
    - `pastTimes` 'ignore' | 'nextDay'
    - `timezone` string — IANA Time Zone string
  - `inbox` object
    - `title` string, required
    - `subtitle` string, required
    - `availability` object
      - `from` string, date — DateTime of format "Y-m-d H:i:s", from when inbox is visible
      - `to` string, date — DateTime of format "Y-m-d H:i:s", until when inbox is visible. Should be after "from"
    - `imageUrl` string
  - `userMeta` string, json — Object keyed by customerID of meta-data for each recipient
  - `reportingMeta` string, json — Object of arbitrary meta-data about this notification
  - `ttl` object
    - `expiresIn` integer — Time after which in-app message is not shown. Between 1 and 365
    - `units` 'd' | 'h' — Units for "expiresIn". Can be days ('d') or hours ('h')

## Response `202`

202

## Other responses

- `400` — 400
- `401` — 401
- `422` — 422

---

[API](https://skmtc.net/optimove/apis/optimove-api.md) · [All operations](https://skmtc.net/optimove/apis/optimove-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/optimove/optimove-api/versions/fc55c5b1bec5/schema)
