Delete in-app message
curl --request DELETE \
--url https://api.onesignal.com/apps/{app_id}/in_app_messages/{id} \
--header 'Authorization: <authorization>'const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.delete("https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}")
.header("Authorization", "<authorization>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<authorization>");
var response = await client.DeleteAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"success": true,
"payload": {
"success": true
}
}{
"success": false,
"errors": [
"In-App Message is used by a Journey and cannot be deleted"
]
}{
"errors": [
"Access denied. Please include an 'Authorization: ...' header with a valid API key (https://documentation.onesignal.com/docs/en/keys-and-ids#api-keys)."
]
}{
"success": false,
"errors": [
"In-App Message not found"
]
}{
"errors": [
"API rate limit exceeded"
],
"limit": "API Per App"
}Delete in-app message
Permanently delete an in-app message by its UUID. Deletion cannot be undone. Pause the in-app message instead if you need to keep it and its stats.
DELETE
/
apps
/
{app_id}
/
in_app_messages
/
{id}
Delete in-app message
curl --request DELETE \
--url https://api.onesignal.com/apps/{app_id}/in_app_messages/{id} \
--header 'Authorization: <authorization>'const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.delete("https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}")
.header("Authorization", "<authorization>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.onesignal.com/apps/{app_id}/in_app_messages/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<authorization>");
var response = await client.DeleteAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"success": true,
"payload": {
"success": true
}
}{
"success": false,
"errors": [
"In-App Message is used by a Journey and cannot be deleted"
]
}{
"errors": [
"Access denied. Please include an 'Authorization: ...' header with a valid API key (https://documentation.onesignal.com/docs/en/keys-and-ids#api-keys)."
]
}{
"success": false,
"errors": [
"In-App Message not found"
]
}{
"errors": [
"API rate limit exceeded"
],
"limit": "API Per App"
}Overview
Permanently delete an in-app message by its UUID.Deletion is permanent and cannot be undone. To stop showing an in-app message and keep it, pause it with Pause or resume in-app message instead.
400 Bad Request with the error In-App Message is used by a Journey and cannot be deleted, and the in-app message is kept.
How to use this API
Authenticate with your App API Key. Find an in-app message’sid from the View in-app messages API.
DELETE /apps/{app_id}/in_app_messages/{id}
Response
A successful request returns200 OK with a confirmation body:
{
"success": true,
"payload": { "success": true }
}
Headers
Your App API key with prefix Key. See Keys & IDs.
Path Parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
Was this page helpful?