Skip to main content
PUT
Update in-app message

Overview

Update an existing custom HTML in-app message. This API updates custom HTML in-app messages only. Use this endpoint to change an in-app message’s HTML, schedule, audience, triggers, or redisplay settings, and to publish a draft.
An update replaces the whole in-app message. It is not a patch. html, start_time, end_time, and triggers are required on every request. Read the in-app message with View in-app message first and send the stored values back for anything you are not changing.
Two kinds of in-app message cannot be updated through the API. Both requests are rejected with a 400 and nothing changes:
  • An in-app message built with the Block Editor.
  • An in-app message with language variants authored in the dashboard. The API manages an in-app message’s default language only.

How to use this API

Authenticate with your App API Key. The body has two top-level keys: is_draft and in_app_message.

Draft or publish

is_draft is required and sets whether the in-app message is live after the update.
  • is_draft: true leaves the in-app message paused, and pauses it if it was live.
  • is_draft: false publishes the in-app message, including an in-app message that was paused before this update.
Send is_draft at the top level of the body, beside in_app_message. A missing key, null, or an is_draft nested inside in_app_message is rejected with a 400 and nothing changes.

Required and optional fields

Trigger sets are recreated on every update, so the id values of trigger sets and conditions change. You can send the id values back or omit them. Triggers, redisplay settings, and limits follow the same rules as Create in-app message. An update keeps the in-app message’s dashboard labels.

Removed clickable elements

OneSignal keeps the stats of clickable elements that an update removes from the HTML. An in-app message can hold up to 100 removed data-onesignal-unique-label values. An update that would exceed 100 is rejected with a 400. Create a new in-app message to continue.

Permissions

An API key can update and publish in-app messages in its app. A request made with an OAuth access token, such as through the OneSignal MCP server, acts with the role of the signed-in user. A role that can edit in-app messages but cannot activate them, such as Composer, can save with is_draft: true. With is_draft: false, that role receives a 403 when the in-app message is paused or is currently live.

Response

A successful request returns 200 OK with the id of the in-app message:
A 429 rate limit response uses a different shape from the other errors on this endpoint. It has no success key and adds a limit key that names the rate limit: { "errors": ["API rate limit exceeded"], "limit": "API Per App" }. See Rate limits.

Headers

Authorization
string
default:Key YOUR_APP_API_KEY
required

Your App API key with prefix Key. See Keys & IDs.

Content-Type
string
default:application/json; charset=utf-8
required

Path Parameters

app_id
string
default:YOUR_APP_ID
required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

id
string
default:YOUR_IN_APP_MESSAGE_ID
required

UUID of the in-app message to update.

Body

application/json
is_draft
boolean
required

true saves the in-app message paused, and pauses it if it was live. false publishes it, including an in-app message that was paused before this update. Send it at the top level of the body, beside in_app_message.

in_app_message
object
required

The in-app message definition.

Response

200

success
boolean

true when the request succeeded.

payload
object