import Onesignal from '@onesignal/node-onesignal';
import { randomUUID } from 'node:crypto';
const configuration = Onesignal.createConfiguration({
restApiKey: 'YOUR_REST_API_KEY',
});
const apiInstance = new Onesignal.DefaultApi(configuration);
const notification = new Onesignal.Notification();
notification.app_id = 'YOUR_APP_ID';
notification.contents = { en: 'Hello from OneSignal!' };
notification.sms_from = '+15551234567';
// Target by External ID: alias keys must match the API (external_id, not externalId).
notification.include_aliases = { external_id: ['YOUR_USER_EXTERNAL_ID'] };
notification.target_channel = 'sms';
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is sent
// and the second returns the original response. `randomUUID` is imported from `node:crypto`
// (available on Node 14.17+) — DO NOT reuse keys across logically distinct sends.
notification.idempotency_key = randomUUID();
try {
const response = await apiInstance.createNotification(notification);
if (!response.id) {
console.warn("Notification was not sent:", response.errors);
} else if (response.errors) {
console.log("Notification created:", response.id, "(partial failures:", response.errors, ")");
} else {
console.log("Notification created:", response.id);
}
} catch (e) {
if (e instanceof Onesignal.ApiException) {
// `e.errorMessages` flattens any error-envelope shape to a `string[]`;
// the raw parsed body remains on `e.body`.
console.error("createNotification failed: HTTP " + e.code, e.errorMessages);
} else {
throw e;
}
}
import uuid
import onesignal
from onesignal.api import default_api
from onesignal.model.language_string_map import LanguageStringMap
from onesignal.model.notification import Notification
# See configuration.py for a list of all supported configuration parameters.
# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY.
# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself.
configuration = onesignal.Configuration(
rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints
organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints
)
with onesignal.ApiClient(configuration) as api_client:
api_instance = default_api.DefaultApi(api_client)
notification = Notification(
app_id='YOUR_APP_ID',
contents=LanguageStringMap(en='Hello from OneSignal!'),
sms_from='+15551234567',
include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},
target_channel='sms',
# Idempotency key: a client-generated UUID that lets you safely retry on network
# failure. If two requests arrive with the same key inside the 30-day window, only
# the first is sent and the second returns the original response. Use uuid.uuid4()
# or a similar source of randomness — DO NOT reuse keys across logically distinct
# sends.
idempotency_key=str(uuid.uuid4()),
)
try:
api_response = api_instance.create_notification(notification)
# `api_response.id` discriminates the two HTTP 200 shapes. A falsy value means no
# notification was created (e.g. all targets were unreachable / not subscribed).
# `api_response.errors` is polymorphic: a `list[str]` in the no-subscribers case, or
# a dict keyed by recipient-identifier type (`invalid_player_ids`,
# `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS
# created but some recipients were skipped. Access via `.get('errors')` rather than
# attribute access — the legacy Python generator's `ModelNormal.__getattr__` raises
# `ApiAttributeError` for optional fields that the server omitted, so plain
# `api_response.errors` would crash on the pure-success path.
response_id = api_response.get('id')
response_errors = api_response.get('errors')
if not response_id:
print('Notification was not sent:', response_errors)
elif response_errors:
print('Notification created:', response_id, '(partial failures:', response_errors, ')')
else:
print('Notification created:', response_id)
except onesignal.ApiException as e:
print('Exception when calling DefaultApi->create_notification: %s\n' % e)
print('Status Code: %s' % e.status)
# `e.error_messages` flattens any error-envelope shape to a list[str];
# the raw body remains on `e.body`.
print('Error Messages: %s' % e.error_messages)
print('Response Body: %s' % e.body)
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: rest_api_key
$config = onesignal\client\Configuration::getDefaultConfiguration()
->setRestApiKeyToken('YOUR_REST_API_KEY')
->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY');
$apiInstance = new onesignal\client\Api\DefaultApi(
new GuzzleHttp\Client(),
$config
);
$notification = new onesignal\client\Model\Notification();
$notification->setAppId('YOUR_APP_ID');
$contents = new onesignal\client\Model\LanguageStringMap();
$contents->setEn('Hello from OneSignal!');
$notification->setContents($contents);
$notification->setSmsFrom('+15551234567');
$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);
$notification->setTargetChannel('sms');
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is sent
// and the second returns the original response. Use a strong source of randomness — DO NOT
// reuse keys across logically distinct sends. We use PHP 7+'s built-in random_bytes() here
// so the snippet works against this SDK's declared composer.json deps (Guzzle + PSR-7) with
// no extra install; projects that already pull in ramsey/uuid can swap in
// `\Ramsey\Uuid\Uuid::uuid4()->toString()` instead.
$idempotencyKeyBytes = random_bytes(16);
$idempotencyKeyBytes[6] = chr(ord($idempotencyKeyBytes[6]) & 0x0f | 0x40);
$idempotencyKeyBytes[8] = chr(ord($idempotencyKeyBytes[8]) & 0x3f | 0x80);
$idempotencyKey = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($idempotencyKeyBytes), 4));
$notification->setIdempotencyKey($idempotencyKey);
try {
$result = $apiInstance->createNotification($notification);
// `$result->getId()` discriminates the two HTTP 200 shapes. A falsy value (empty
// string or null) means no notification was created (e.g. all targets were
// unreachable / not subscribed). `$result->getErrors()` is polymorphic: a `string[]`
// in the no-subscribers case, or an object keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when
// the notification WAS created but some recipients were skipped.
if (!$result->getId()) {
echo 'Notification was not sent: ', print_r($result->getErrors(), true), PHP_EOL;
} elseif ($result->getErrors()) {
echo 'Notification created: ', $result->getId(), ' (partial failures: ', print_r($result->getErrors(), true), ')', PHP_EOL;
} else {
echo 'Notification created: ', $result->getId(), PHP_EOL;
}
} catch (\onesignal\client\ApiException $e) {
echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;
echo 'Status Code: ', $e->getCode(), PHP_EOL;
echo 'Response Body: ', $e->getResponseBody(), PHP_EOL;
} catch (\Exception $e) {
echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;
}
package main
import (
"context"
"fmt"
"os"
"github.com/google/uuid"
"github.com/OneSignal/onesignal-go-api/v5"
)
func main() {
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
restAuth := context.WithValue(context.Background(), onesignal.RestApiKey, "YOUR_REST_API_KEY")
notification := onesignal.NewNotification("YOUR_APP_ID")
contents := onesignal.NewLanguageStringMap()
contents.SetEn("Hello from OneSignal!")
notification.SetContents(*contents)
notification.SetSmsFrom("+15551234567")
notification.SetIncludeAliases(map[string][]string{"external_id": {"YOUR_USER_EXTERNAL_ID"}})
notification.SetTargetChannel("sms")
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is
// sent and the second returns the original response. The `github.com/google/uuid` module
// is not a declared dep of this SDK; run `go get github.com/google/uuid` (or `go mod tidy`
// after importing it) before building. DO NOT reuse keys across logically distinct sends.
notification.SetIdempotencyKey(uuid.NewString())
resp, r, err := apiClient.DefaultApi.CreateNotification(restAuth).Notification(*notification).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateNotification``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
if apiErr, ok := err.(*onesignal.GenericOpenAPIError); ok {
fmt.Fprintf(os.Stderr, "Response Body: %s\n", apiErr.Body())
}
return
}
// `resp.GetId()` discriminates the two HTTP 200 shapes. An empty string means no
// notification was created (e.g. all targets were unreachable / not subscribed).
// `resp.GetErrors()` is `interface{}` because the field is polymorphic: a `[]string` in
// the no-subscribers case, or a map keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when
// the notification WAS created but some recipients were skipped.
if resp.GetId() == "" {
fmt.Fprintf(os.Stderr, "Notification was not sent: %v\n", resp.GetErrors())
} else if errors := resp.GetErrors(); errors != nil {
fmt.Fprintf(os.Stdout, "Notification created: %s (partial failures: %v)\n", resp.GetId(), errors)
} else {
fmt.Fprintf(os.Stdout, "Notification created: %s\n", resp.GetId())
}
}
require 'onesignal'
# setup authorization
OneSignal.configure do |config|
# Configure Bearer authorization: rest_api_key
config.rest_api_key = 'YOUR_REST_API_KEY'
end
api_instance = OneSignal::DefaultApi.new
require 'securerandom'
notification = OneSignal::Notification.new
notification.app_id = 'YOUR_APP_ID'
notification.contents = OneSignal::LanguageStringMap.new({ en: 'Hello from OneSignal!' })
notification.sms_from = '+15551234567'
notification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }
notification.target_channel = 'sms'
# Idempotency key: a client-generated UUID that lets you safely retry on network failure.
# If two requests arrive with the same key inside the 30-day window, only the first is sent
# and the second returns the original response. Use SecureRandom.uuid — DO NOT reuse keys
# across logically distinct sends.
notification.idempotency_key = SecureRandom.uuid
begin
# Create notification
result = api_instance.create_notification(notification)
# `result.id` discriminates the two HTTP 200 shapes. An empty string means no
# notification was created (e.g. all targets were unreachable / not subscribed).
# `result.errors` is polymorphic: an `Array<String>` in the no-subscribers case, or
# a Hash keyed by recipient-identifier type (`invalid_player_ids`,
# `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS
# created but some recipients were skipped.
if result.id.to_s.empty?
puts "Notification was not sent: #{result.errors}"
elsif result.errors
puts "Notification created: #{result.id} (partial failures: #{result.errors})"
else
puts "Notification created: #{result.id}"
end
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->create_notification: #{e}"
puts "Status Code: #{e.code}"
# `e.error_messages` flattens any error-envelope shape to an Array<String>;
# the raw body remains on `e.response_body`.
puts "Error Messages: #{e.error_messages}"
puts "Response Body: #{e.response_body}"
end
// Import classes:
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.onesignal.client.ApiClient;
import com.onesignal.client.ApiException;
import com.onesignal.client.Configuration;
import com.onesignal.client.auth.*;
import com.onesignal.client.model.*;
import com.onesignal.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.onesignal.com");
HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
rest_api_key.setBearerToken("YOUR_REST_API_KEY");
DefaultApi apiInstance = new DefaultApi(defaultClient);
Notification notification = new Notification();
notification.setAppId("YOUR_APP_ID");
LanguageStringMap contents = new LanguageStringMap();
contents.setEn("Hello from OneSignal!");
notification.setContents(contents);
notification.setSmsFrom("+15551234567");
Map<String, List<String>> aliases = new HashMap<>();
aliases.put("external_id", Arrays.asList("YOUR_USER_EXTERNAL_ID"));
notification.setIncludeAliases(aliases);
notification.setTargetChannel(Notification.TargetChannelEnum.SMS);
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is
// sent and the second returns the original response. Use UUID.randomUUID() — DO NOT
// reuse keys across logically distinct sends.
notification.setIdempotencyKey(UUID.randomUUID().toString());
try {
CreateNotificationSuccessResponse result = apiInstance.createNotification(notification);
// `result.getId()` discriminates the two HTTP 200 shapes. An empty string means no
// notification was created (e.g. all targets were unreachable / not subscribed).
// `result.getErrors()` is polymorphic (declared as `Object`): a `List<String>` in the
// no-subscribers case, or a Map keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when
// the notification WAS created but some recipients were skipped.
if (result.getId() == null || result.getId().isEmpty()) {
System.out.println("Notification was not sent: " + result.getErrors());
} else if (result.getErrors() != null) {
System.out.println("Notification created: " + result.getId() + " (partial failures: " + result.getErrors() + ")");
} else {
System.out.println("Notification created: " + result.getId());
}
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#createNotification");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using OneSignalApi.Api;
using OneSignalApi.Client;
using OneSignalApi.Model;
namespace Example
{
public class CreateNotificationExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.onesignal.com";
config.AccessToken = "YOUR_REST_API_KEY";
var apiInstance = new DefaultApi(config);
var notification = new Notification
{
AppId = "YOUR_APP_ID",
Contents = new LanguageStringMap(en: "Hello from OneSignal!"),
SmsFrom = "+15551234567",
IncludeAliases = new Dictionary<string, List<string>>
{
{ "external_id", new List<string> { "YOUR_USER_EXTERNAL_ID" } }
},
TargetChannel = Notification.TargetChannelEnum.Sms,
// Idempotency key: a client-generated UUID that lets you safely retry on
// network failure. If two requests arrive with the same key inside the
// 30-day window, only the first is sent and the second returns the original
// response. Use Guid.NewGuid() — DO NOT reuse keys across logically distinct
// sends.
IdempotencyKey = Guid.NewGuid().ToString()
};
try
{
CreateNotificationSuccessResponse result = apiInstance.CreateNotification(notification);
// `result.Id` discriminates the two HTTP 200 shapes. An empty string means
// no notification was created (e.g. all targets were unreachable / not
// subscribed). `result.Errors` is polymorphic: a `List<string>` in the
// no-subscribers case, or an object keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...)
// when the notification WAS created but some recipients were skipped.
if (string.IsNullOrEmpty(result.Id))
{
Debug.WriteLine("Notification was not sent: " + result.Errors);
}
else if (result.Errors != null)
{
Debug.WriteLine("Notification created: " + result.Id + " (partial failures: " + result.Errors + ")");
}
else
{
Debug.WriteLine("Notification created: " + result.Id);
}
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.CreateNotification: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print("Response Body: " + e.ErrorContent);
Debug.Print(e.StackTrace);
}
}
}
}
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;
use onesignal_rust_api::models::notification::TargetChannelType;
use onesignal_rust_api::models::{LanguageStringMap, Notification};
use uuid::Uuid;
#[tokio::main]
async fn main() {
let mut configuration = Configuration::new();
configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());
let mut notification = Notification::new("YOUR_APP_ID".to_string());
notification.contents = Some(Box::new(LanguageStringMap {
en: Some("Hello from OneSignal!".to_string()),
..Default::default()
}));
notification.sms_from = Some("+15551234567".to_string());
let mut aliases = std::collections::HashMap::new();
aliases.insert(
"external_id".to_string(),
vec!["YOUR_USER_EXTERNAL_ID".to_string()],
);
notification.include_aliases = Some(aliases);
notification.target_channel = Some(TargetChannelType::Sms);
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is
// sent and the second returns the original response. The `uuid` crate must be declared
// in your own Cargo.toml (Cargo doesn't expose transitive crates by name to downstream
// code) — add `uuid = { version = "1", features = ["v4"] }` to your `[dependencies]`.
// DO NOT reuse keys across logically distinct sends.
notification.idempotency_key = Some(Uuid::new_v4().to_string());
match default_api::create_notification(&configuration, notification).await {
Ok(resp) => {
// `resp.id` discriminates the two HTTP 200 shapes. An empty string or `None`
// means no notification was created (e.g. all targets were unreachable / not
// subscribed). `resp.errors` is polymorphic (typed as `Option<serde_json::Value>`):
// a `Vec<String>` in the no-subscribers case, or an object keyed by
// recipient-identifier type (`invalid_player_ids`, `invalid_external_user_ids`,
// `invalid_aliases`, ...) when the notification WAS created but some recipients
// were skipped.
match resp.id.as_deref() {
Some("") | None => eprintln!("Notification was not sent: {:?}", resp.errors),
Some(id) if resp.errors.is_some() => {
println!("Notification created: {} (partial failures: {:?})", id, resp.errors)
}
Some(id) => println!("Notification created: {}", id),
}
}
Err(onesignal_rust_api::apis::Error::ResponseError(content)) => {
eprintln!("create_notification failed: HTTP {}", content.status);
eprintln!("Response Body: {}", content.content);
}
Err(e) => eprintln!("create_notification failed: {:?}", e),
}
}
{
"errors": [
{
"Message Notifications must have English language content": "<string>",
"Incorrect subscription_id format in include_subscription_ids (not a valid UUID):": "<string>",
"Platforms You may only send to one delivery channel at a time. Make sure you are only including one of push platforms, Email, or SMS.": "<string>"
}
]
}
{
"errors": [
"This API is not available for applications on your plan."
]
}
import Onesignal from '@onesignal/node-onesignal';
import { randomUUID } from 'node:crypto';
const configuration = Onesignal.createConfiguration({
restApiKey: 'YOUR_REST_API_KEY',
});
const apiInstance = new Onesignal.DefaultApi(configuration);
const notification = new Onesignal.Notification();
notification.app_id = 'YOUR_APP_ID';
notification.contents = { en: 'Hello from OneSignal!' };
notification.sms_from = '+15551234567';
// Target by External ID: alias keys must match the API (external_id, not externalId).
notification.include_aliases = { external_id: ['YOUR_USER_EXTERNAL_ID'] };
notification.target_channel = 'sms';
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is sent
// and the second returns the original response. `randomUUID` is imported from `node:crypto`
// (available on Node 14.17+) — DO NOT reuse keys across logically distinct sends.
notification.idempotency_key = randomUUID();
try {
const response = await apiInstance.createNotification(notification);
if (!response.id) {
console.warn("Notification was not sent:", response.errors);
} else if (response.errors) {
console.log("Notification created:", response.id, "(partial failures:", response.errors, ")");
} else {
console.log("Notification created:", response.id);
}
} catch (e) {
if (e instanceof Onesignal.ApiException) {
// `e.errorMessages` flattens any error-envelope shape to a `string[]`;
// the raw parsed body remains on `e.body`.
console.error("createNotification failed: HTTP " + e.code, e.errorMessages);
} else {
throw e;
}
}
import uuid
import onesignal
from onesignal.api import default_api
from onesignal.model.language_string_map import LanguageStringMap
from onesignal.model.notification import Notification
# See configuration.py for a list of all supported configuration parameters.
# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY.
# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself.
configuration = onesignal.Configuration(
rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints
organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints
)
with onesignal.ApiClient(configuration) as api_client:
api_instance = default_api.DefaultApi(api_client)
notification = Notification(
app_id='YOUR_APP_ID',
contents=LanguageStringMap(en='Hello from OneSignal!'),
sms_from='+15551234567',
include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},
target_channel='sms',
# Idempotency key: a client-generated UUID that lets you safely retry on network
# failure. If two requests arrive with the same key inside the 30-day window, only
# the first is sent and the second returns the original response. Use uuid.uuid4()
# or a similar source of randomness — DO NOT reuse keys across logically distinct
# sends.
idempotency_key=str(uuid.uuid4()),
)
try:
api_response = api_instance.create_notification(notification)
# `api_response.id` discriminates the two HTTP 200 shapes. A falsy value means no
# notification was created (e.g. all targets were unreachable / not subscribed).
# `api_response.errors` is polymorphic: a `list[str]` in the no-subscribers case, or
# a dict keyed by recipient-identifier type (`invalid_player_ids`,
# `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS
# created but some recipients were skipped. Access via `.get('errors')` rather than
# attribute access — the legacy Python generator's `ModelNormal.__getattr__` raises
# `ApiAttributeError` for optional fields that the server omitted, so plain
# `api_response.errors` would crash on the pure-success path.
response_id = api_response.get('id')
response_errors = api_response.get('errors')
if not response_id:
print('Notification was not sent:', response_errors)
elif response_errors:
print('Notification created:', response_id, '(partial failures:', response_errors, ')')
else:
print('Notification created:', response_id)
except onesignal.ApiException as e:
print('Exception when calling DefaultApi->create_notification: %s\n' % e)
print('Status Code: %s' % e.status)
# `e.error_messages` flattens any error-envelope shape to a list[str];
# the raw body remains on `e.body`.
print('Error Messages: %s' % e.error_messages)
print('Response Body: %s' % e.body)
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: rest_api_key
$config = onesignal\client\Configuration::getDefaultConfiguration()
->setRestApiKeyToken('YOUR_REST_API_KEY')
->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY');
$apiInstance = new onesignal\client\Api\DefaultApi(
new GuzzleHttp\Client(),
$config
);
$notification = new onesignal\client\Model\Notification();
$notification->setAppId('YOUR_APP_ID');
$contents = new onesignal\client\Model\LanguageStringMap();
$contents->setEn('Hello from OneSignal!');
$notification->setContents($contents);
$notification->setSmsFrom('+15551234567');
$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);
$notification->setTargetChannel('sms');
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is sent
// and the second returns the original response. Use a strong source of randomness — DO NOT
// reuse keys across logically distinct sends. We use PHP 7+'s built-in random_bytes() here
// so the snippet works against this SDK's declared composer.json deps (Guzzle + PSR-7) with
// no extra install; projects that already pull in ramsey/uuid can swap in
// `\Ramsey\Uuid\Uuid::uuid4()->toString()` instead.
$idempotencyKeyBytes = random_bytes(16);
$idempotencyKeyBytes[6] = chr(ord($idempotencyKeyBytes[6]) & 0x0f | 0x40);
$idempotencyKeyBytes[8] = chr(ord($idempotencyKeyBytes[8]) & 0x3f | 0x80);
$idempotencyKey = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($idempotencyKeyBytes), 4));
$notification->setIdempotencyKey($idempotencyKey);
try {
$result = $apiInstance->createNotification($notification);
// `$result->getId()` discriminates the two HTTP 200 shapes. A falsy value (empty
// string or null) means no notification was created (e.g. all targets were
// unreachable / not subscribed). `$result->getErrors()` is polymorphic: a `string[]`
// in the no-subscribers case, or an object keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when
// the notification WAS created but some recipients were skipped.
if (!$result->getId()) {
echo 'Notification was not sent: ', print_r($result->getErrors(), true), PHP_EOL;
} elseif ($result->getErrors()) {
echo 'Notification created: ', $result->getId(), ' (partial failures: ', print_r($result->getErrors(), true), ')', PHP_EOL;
} else {
echo 'Notification created: ', $result->getId(), PHP_EOL;
}
} catch (\onesignal\client\ApiException $e) {
echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;
echo 'Status Code: ', $e->getCode(), PHP_EOL;
echo 'Response Body: ', $e->getResponseBody(), PHP_EOL;
} catch (\Exception $e) {
echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;
}
package main
import (
"context"
"fmt"
"os"
"github.com/google/uuid"
"github.com/OneSignal/onesignal-go-api/v5"
)
func main() {
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
restAuth := context.WithValue(context.Background(), onesignal.RestApiKey, "YOUR_REST_API_KEY")
notification := onesignal.NewNotification("YOUR_APP_ID")
contents := onesignal.NewLanguageStringMap()
contents.SetEn("Hello from OneSignal!")
notification.SetContents(*contents)
notification.SetSmsFrom("+15551234567")
notification.SetIncludeAliases(map[string][]string{"external_id": {"YOUR_USER_EXTERNAL_ID"}})
notification.SetTargetChannel("sms")
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is
// sent and the second returns the original response. The `github.com/google/uuid` module
// is not a declared dep of this SDK; run `go get github.com/google/uuid` (or `go mod tidy`
// after importing it) before building. DO NOT reuse keys across logically distinct sends.
notification.SetIdempotencyKey(uuid.NewString())
resp, r, err := apiClient.DefaultApi.CreateNotification(restAuth).Notification(*notification).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateNotification``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
if apiErr, ok := err.(*onesignal.GenericOpenAPIError); ok {
fmt.Fprintf(os.Stderr, "Response Body: %s\n", apiErr.Body())
}
return
}
// `resp.GetId()` discriminates the two HTTP 200 shapes. An empty string means no
// notification was created (e.g. all targets were unreachable / not subscribed).
// `resp.GetErrors()` is `interface{}` because the field is polymorphic: a `[]string` in
// the no-subscribers case, or a map keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when
// the notification WAS created but some recipients were skipped.
if resp.GetId() == "" {
fmt.Fprintf(os.Stderr, "Notification was not sent: %v\n", resp.GetErrors())
} else if errors := resp.GetErrors(); errors != nil {
fmt.Fprintf(os.Stdout, "Notification created: %s (partial failures: %v)\n", resp.GetId(), errors)
} else {
fmt.Fprintf(os.Stdout, "Notification created: %s\n", resp.GetId())
}
}
require 'onesignal'
# setup authorization
OneSignal.configure do |config|
# Configure Bearer authorization: rest_api_key
config.rest_api_key = 'YOUR_REST_API_KEY'
end
api_instance = OneSignal::DefaultApi.new
require 'securerandom'
notification = OneSignal::Notification.new
notification.app_id = 'YOUR_APP_ID'
notification.contents = OneSignal::LanguageStringMap.new({ en: 'Hello from OneSignal!' })
notification.sms_from = '+15551234567'
notification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }
notification.target_channel = 'sms'
# Idempotency key: a client-generated UUID that lets you safely retry on network failure.
# If two requests arrive with the same key inside the 30-day window, only the first is sent
# and the second returns the original response. Use SecureRandom.uuid — DO NOT reuse keys
# across logically distinct sends.
notification.idempotency_key = SecureRandom.uuid
begin
# Create notification
result = api_instance.create_notification(notification)
# `result.id` discriminates the two HTTP 200 shapes. An empty string means no
# notification was created (e.g. all targets were unreachable / not subscribed).
# `result.errors` is polymorphic: an `Array<String>` in the no-subscribers case, or
# a Hash keyed by recipient-identifier type (`invalid_player_ids`,
# `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS
# created but some recipients were skipped.
if result.id.to_s.empty?
puts "Notification was not sent: #{result.errors}"
elsif result.errors
puts "Notification created: #{result.id} (partial failures: #{result.errors})"
else
puts "Notification created: #{result.id}"
end
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->create_notification: #{e}"
puts "Status Code: #{e.code}"
# `e.error_messages` flattens any error-envelope shape to an Array<String>;
# the raw body remains on `e.response_body`.
puts "Error Messages: #{e.error_messages}"
puts "Response Body: #{e.response_body}"
end
// Import classes:
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.onesignal.client.ApiClient;
import com.onesignal.client.ApiException;
import com.onesignal.client.Configuration;
import com.onesignal.client.auth.*;
import com.onesignal.client.model.*;
import com.onesignal.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.onesignal.com");
HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
rest_api_key.setBearerToken("YOUR_REST_API_KEY");
DefaultApi apiInstance = new DefaultApi(defaultClient);
Notification notification = new Notification();
notification.setAppId("YOUR_APP_ID");
LanguageStringMap contents = new LanguageStringMap();
contents.setEn("Hello from OneSignal!");
notification.setContents(contents);
notification.setSmsFrom("+15551234567");
Map<String, List<String>> aliases = new HashMap<>();
aliases.put("external_id", Arrays.asList("YOUR_USER_EXTERNAL_ID"));
notification.setIncludeAliases(aliases);
notification.setTargetChannel(Notification.TargetChannelEnum.SMS);
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is
// sent and the second returns the original response. Use UUID.randomUUID() — DO NOT
// reuse keys across logically distinct sends.
notification.setIdempotencyKey(UUID.randomUUID().toString());
try {
CreateNotificationSuccessResponse result = apiInstance.createNotification(notification);
// `result.getId()` discriminates the two HTTP 200 shapes. An empty string means no
// notification was created (e.g. all targets were unreachable / not subscribed).
// `result.getErrors()` is polymorphic (declared as `Object`): a `List<String>` in the
// no-subscribers case, or a Map keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when
// the notification WAS created but some recipients were skipped.
if (result.getId() == null || result.getId().isEmpty()) {
System.out.println("Notification was not sent: " + result.getErrors());
} else if (result.getErrors() != null) {
System.out.println("Notification created: " + result.getId() + " (partial failures: " + result.getErrors() + ")");
} else {
System.out.println("Notification created: " + result.getId());
}
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#createNotification");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using OneSignalApi.Api;
using OneSignalApi.Client;
using OneSignalApi.Model;
namespace Example
{
public class CreateNotificationExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.onesignal.com";
config.AccessToken = "YOUR_REST_API_KEY";
var apiInstance = new DefaultApi(config);
var notification = new Notification
{
AppId = "YOUR_APP_ID",
Contents = new LanguageStringMap(en: "Hello from OneSignal!"),
SmsFrom = "+15551234567",
IncludeAliases = new Dictionary<string, List<string>>
{
{ "external_id", new List<string> { "YOUR_USER_EXTERNAL_ID" } }
},
TargetChannel = Notification.TargetChannelEnum.Sms,
// Idempotency key: a client-generated UUID that lets you safely retry on
// network failure. If two requests arrive with the same key inside the
// 30-day window, only the first is sent and the second returns the original
// response. Use Guid.NewGuid() — DO NOT reuse keys across logically distinct
// sends.
IdempotencyKey = Guid.NewGuid().ToString()
};
try
{
CreateNotificationSuccessResponse result = apiInstance.CreateNotification(notification);
// `result.Id` discriminates the two HTTP 200 shapes. An empty string means
// no notification was created (e.g. all targets were unreachable / not
// subscribed). `result.Errors` is polymorphic: a `List<string>` in the
// no-subscribers case, or an object keyed by recipient-identifier type
// (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...)
// when the notification WAS created but some recipients were skipped.
if (string.IsNullOrEmpty(result.Id))
{
Debug.WriteLine("Notification was not sent: " + result.Errors);
}
else if (result.Errors != null)
{
Debug.WriteLine("Notification created: " + result.Id + " (partial failures: " + result.Errors + ")");
}
else
{
Debug.WriteLine("Notification created: " + result.Id);
}
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.CreateNotification: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print("Response Body: " + e.ErrorContent);
Debug.Print(e.StackTrace);
}
}
}
}
use onesignal_rust_api::apis::configuration::Configuration;
use onesignal_rust_api::apis::default_api;
use onesignal_rust_api::models::notification::TargetChannelType;
use onesignal_rust_api::models::{LanguageStringMap, Notification};
use uuid::Uuid;
#[tokio::main]
async fn main() {
let mut configuration = Configuration::new();
configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());
let mut notification = Notification::new("YOUR_APP_ID".to_string());
notification.contents = Some(Box::new(LanguageStringMap {
en: Some("Hello from OneSignal!".to_string()),
..Default::default()
}));
notification.sms_from = Some("+15551234567".to_string());
let mut aliases = std::collections::HashMap::new();
aliases.insert(
"external_id".to_string(),
vec!["YOUR_USER_EXTERNAL_ID".to_string()],
);
notification.include_aliases = Some(aliases);
notification.target_channel = Some(TargetChannelType::Sms);
// Idempotency key: a client-generated UUID that lets you safely retry on network failure.
// If two requests arrive with the same key inside the 30-day window, only the first is
// sent and the second returns the original response. The `uuid` crate must be declared
// in your own Cargo.toml (Cargo doesn't expose transitive crates by name to downstream
// code) — add `uuid = { version = "1", features = ["v4"] }` to your `[dependencies]`.
// DO NOT reuse keys across logically distinct sends.
notification.idempotency_key = Some(Uuid::new_v4().to_string());
match default_api::create_notification(&configuration, notification).await {
Ok(resp) => {
// `resp.id` discriminates the two HTTP 200 shapes. An empty string or `None`
// means no notification was created (e.g. all targets were unreachable / not
// subscribed). `resp.errors` is polymorphic (typed as `Option<serde_json::Value>`):
// a `Vec<String>` in the no-subscribers case, or an object keyed by
// recipient-identifier type (`invalid_player_ids`, `invalid_external_user_ids`,
// `invalid_aliases`, ...) when the notification WAS created but some recipients
// were skipped.
match resp.id.as_deref() {
Some("") | None => eprintln!("Notification was not sent: {:?}", resp.errors),
Some(id) if resp.errors.is_some() => {
println!("Notification created: {} (partial failures: {:?})", id, resp.errors)
}
Some(id) => println!("Notification created: {}", id),
}
}
Err(onesignal_rust_api::apis::Error::ResponseError(content)) => {
eprintln!("create_notification failed: HTTP {}", content.status);
eprintln!("Response Body: {}", content.content);
}
Err(e) => eprintln!("create_notification failed: {:?}", e),
}
}
{
"errors": [
{
"Message Notifications must have English language content": "<string>",
"Incorrect subscription_id format in include_subscription_ids (not a valid UUID):": "<string>",
"Platforms You may only send to one delivery channel at a time. Make sure you are only including one of push platforms, Email, or SMS.": "<string>"
}
]
}
{
"errors": [
"This API is not available for applications on your plan."
]
}
The Create message API allows you to send push notifications, emails, and SMS to your users. This guide is specific for SMS and MMS. See Push notification or Email to send to those channels.Ensure your SMS setup is complete.
The main message body with language-specific values. Too many characters may result in multiple messages and increased costs. See SMS. Required unless using template_id. Supports Message Personalization. You can add trackable links to your SMS via the API by including liquid syntax in your message contents. For example: {{'your_url' | track_link}} The liquid syntax block will be replaced with a trackable short link in the following format: 1sgnl.co/XXXX. Using trackable links allows you to see the click through rates of your SMS.
Target up to 20,000 users by their external_id, onesignal_id, or your own custom alias. Use with target_channel to control the delivery channel. Not compatible with any other targeting parameters like filters, include_subscription_ids, included_segments, or excluded_segments. See Sending messages with the OneSignal API.
Target users' specific subscriptions by ID. Include up to 20,000 subscription_id per API call. Not compatible with any other targeting parameters like filters, include_aliases, included_segments, or excluded_segments. See Sending messages with the OneSignal API.
Send SMS/MMS to specific users by their phone number in E.164 format. Can only be used when sending SMS/MMS. Include up to 20,000 phone numbers per API call. If the phone number does not exist within the OneSignal App, then a new SMS Subscription will be created. Not compatible with any other targeting parameters like filters, include_aliases, included_segments, or excluded_segments. See Sending messages with the OneSignal API.
Target predefined Segments. Users that are in multiple segments will only be sent the message once. Can be combined with excluded_segments. Requires target_channel to be set to 'sms' or isSms=true when sending SMS/RCS. Not compatible with any other targeting parameters like filters, include_aliases, or include_subscription_ids. See Sending messages with the OneSignal API.
Exclude users in predefined Segments. Overrides membership in any segment specified in the included_segments. Not compatible with any other targeting parameters like filters, include_aliases, or include_subscription_ids. See Sending messages with the OneSignal API.
Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators. See Sending messages with the OneSignal API.
The Messaging Service ID or phone number used to send the SMS or MMS. Its recommended to use Messaging Service SIDs (e.g., MGxxxxxxxxxxxxxxx) but also accepts E.164 phone numbers (e.g., +12065551234). Defaults to the sender selected in SMS Setup. If using per-sender opt-out, you must use a Messaging Service ID.
Include user or context-specific data (e.g., cart items, OTPs, links) in a message. Use with template_id. See Message Personalization. Max size: 2KB (Push/SMS), 10KB (Email).
Schedule delivery for a future date/time (in UTC). The format must be valid per the ISO 8601 standard and compatible with JavaScript's Date() parser. Example: 2025-09-24T14:00:00-07:00
A unique identifier used to prevent duplicate messages from repeat API calls. See Idempotent notification requests. Any RFC 9562 UUID supported. Valid for 30 days. Previously called external_id.
Response
200
Message Sent
Message Not Sent
Two variants are possible with HTTP 200, distinguished by the id field: a UUID indicates the message was accepted and dispatched (Message Sent); an empty string indicates the request was valid but no subscribers matched (Message Not Sent). Inspect errors when id is empty.
The idempotency_key parameter from the request, echoed back. Null when no idempotency_key was provided. Use this to detect duplicate-send attempts. See Idempotent message requests.
Per-channel listings of invalid identifiers in the request. Only emitted when at least one identifier in the request failed validation. Each listed key is optional; the keys present depend on the channel and request.
Non-fatal warnings emitted alongside a successful send.
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"OneSignal","description":"OneSignal is a platform for sending push notifications, emails, in-app messages, and SMS campaigns via a single API, Journey Builder, and a dashboard.","colors":{"primary":"#3A3DB3","light":"#E54B4D","dark":"#3A3DB3"},"logo":{"light":"https://mintcdn.com/onesignal/yJcueeDCO7UpHnnY/logo/OneSignal-Logo.svg?fit=max\u0026auto=format\u0026n=yJcueeDCO7UpHnnY\u0026q=85\u0026s=1fcfb6fef6d820fd9d99c74850711107","dark":"https://mintcdn.com/onesignal/s4WC_KzLxf8ornqq/logo/OneSignal-Logo-White.svg?fit=max\u0026auto=format\u0026n=s4WC_KzLxf8ornqq\u0026q=85\u0026s=2573a53b5aea961e18c82b3af8f31925"},"favicon":"https://mintcdn.com/onesignal/SGduBFHpiRdg5l6h/favicon.ico?fit=max\u0026auto=format\u0026n=SGduBFHpiRdg5l6h\u0026q=85\u0026s=c0a99fadc0553c658a83741c5611cef4","api":{"examples":{"languages":["curl","typescript","python","php","go","ruby","java","csharp","rust"],"autogenerate":true}},"navbar":{"links":[{"href":"mailto:support@onesignal.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://dashboard.onesignal.com"}},"footer":{"socials":{"github":"https://github.com/OneSignal","linkedin":"https://linkedin.com/company/onesignal","youtube":"https://www.youtube.com/@onesignalofficial/playlists"}},"seo":{"metatags":{"apple-mobile-web-app-title":"OneSignal Docs"}},"fonts":{"family":"Nunito Sans"},"styling":{"eyebrows":"breadcrumbs","latex":true},"integrations":{"ga4":{"measurementId":"G-2DGWL0VYP5"},"posthog":{"apiKey":"phc_vZpvE0f5eyzcOt30FHer34yddVmNdo9kmlMVRBzLMtn","apiHost":"https://eu.i.posthog.com","sessionRecording":true}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"languages":[{"language":"en","href":"docs/en/home"},{"language":"cn","href":"docs/cn/home"},{"language":"ko","href":"docs/ko/home"},{"language":"ja","href":"docs/ja/home"},{"language":"tr","href":"docs/tr/home"},{"language":"pt-BR","href":"docs/pt-BR/home"},{"language":"es","href":"docs/es/home"},{"language":"fr","href":"docs/fr/home"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"onesignal","hasAudioNarration":false,"actualSubdomain":"onesignal","customDomains":["documentation.onesignal.com"],"gitSource":{"type":"github","owner":"onesignal","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae4dad5b2fbfb4a64b42060","collectionId":"d2331cde-db1b-4c2b-909b-e5554e0542f7","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae4dad5b2fbfb4a64b42060"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae52961fd814923a414a631","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"en","tag":"User Guides","count":201},{"language":"es","tag":"Guías del Usuario","count":178},{"language":"fr","tag":"Guides utilisateur","count":178},{"language":"ja","tag":"ユーザーガイド","count":178},{"language":"ko","tag":"사용자 가이드","count":178},{"language":"pt-BR","tag":"Guia do Usuário","count":178},{"language":"tr","tag":"Kullanıcı Kılavuzları","count":178},{"language":"cn","tag":"用户指南","count":176},{"language":"en","tag":"Message channels","count":90},{"language":"es","tag":"Canales de mensajería","count":84},{"language":"fr","tag":"Canaux de messagerie","count":84},{"language":"ja","tag":"メッセージングチャネル","count":84},{"language":"ko","tag":"메시지 채널","count":84},{"language":"pt-BR","tag":"Canais de mensagem","count":84},{"language":"tr","tag":"Mesaj kanalları","count":84},{"language":"cn","tag":"消息渠道","count":83},{"language":"default","tag":"API Reference","count":68},{"language":"default","tag":"API reference","count":64},{"language":"en","tag":"Analytics \u0026 Integrations","count":53},{"language":"es","tag":"Analítica \u0026 Integraciones","count":52},{"language":"fr","tag":"Analyses et intégrations","count":52},{"language":"ja","tag":"分析 \u0026 統合","count":52},{"language":"ko","tag":"분석 \u0026 통합","count":52},{"language":"pt-BR","tag":"Análises \u0026 Integrações","count":52},{"language":"tr","tag":"Analitik ve Entegrasyonlar","count":52},{"language":"cn","tag":"分析和集成","count":51},{"language":"cn","tag":"开发者指南","count":48},{"language":"es","tag":"Guías del desarrollador","count":48},{"language":"fr","tag":"Guides développeur","count":48},{"language":"ja","tag":"開発者ガイド","count":48},{"language":"ko","tag":"개발자 가이드","count":48},{"language":"tr","tag":"Geliştirici Kılavuzları","count":48},{"language":"en","tag":"Developer Guides","count":47},{"language":"pt-BR","tag":"Guia de desenvolvedor","count":47},{"language":"en","tag":"Integrations","count":37},{"language":"es","tag":"Integraciones","count":37},{"language":"fr","tag":"Intégrations","count":37},{"language":"ja","tag":"統合","count":37},{"language":"ko","tag":"통합","count":37},{"language":"pt-BR","tag":"Integrações","count":37},{"language":"tr","tag":"Entegrasyonlar","count":37},{"language":"cn","tag":"集成","count":36},{"language":"en","tag":"Tutorials","count":35},{"language":"cn","tag":"推送通知","count":31},{"language":"cn","tag":"OneSignal 作为目的地","count":31},{"language":"en","tag":"Push","count":31},{"language":"en","tag":"OneSignal as destination","count":31},{"language":"es","tag":"Push notificaciones","count":31},{"language":"es","tag":"OneSignal como destino","count":31},{"language":"fr","tag":"Push","count":31},{"language":"fr","tag":"OneSignal comme destination","count":31},{"language":"ja","tag":"プッシュ通知","count":31},{"language":"ja","tag":"OneSignal as 宛先","count":31},{"language":"ko","tag":"푸시","count":31},{"language":"ko","tag":"OneSignal을 데이터 목적지로 사용","count":31},{"language":"pt-BR","tag":"Push notificações","count":31},{"language":"pt-BR","tag":"OneSignal como destino","count":31},{"language":"tr","tag":"Anlık bildirimler","count":31},{"language":"tr","tag":"OneSignal hedef","count":31},{"language":"en","tag":"Mobile SDKs","count":26},{"language":"cn","tag":"移动SDK","count":25},{"language":"es","tag":"SDKs móviles","count":25},{"language":"fr","tag":"SDK mobiles","count":25},{"language":"ja","tag":"モバイルSDK","count":25},{"language":"ko","tag":"모바일 SDKs","count":25},{"language":"pt-BR","tag":"SDKs móveis","count":25},{"language":"tr","tag":"Mobil SDK'lar","count":25},{"language":"cn","tag":"教程","count":24},{"language":"es","tag":"Tutoriales","count":24},{"language":"fr","tag":"Tutoriels","count":24},{"language":"ja","tag":"チュートリアル","count":24},{"language":"ko","tag":"튜토리얼","count":24},{"language":"pt-BR","tag":"Tutoriais","count":24},{"language":"tr","tag":"Eğitimler","count":24},{"language":"en","tag":"Mobile SDK setup","count":19},{"language":"cn","tag":"移动SDK设置","count":18},{"language":"es","tag":"Configuración del SDK móvil","count":18},{"language":"fr","tag":"Configuration SDK mobile","count":18},{"language":"ja","tag":"モバイルSDKセットアップ","count":18},{"language":"ko","tag":"모바일 SDK 설정","count":18},{"language":"pt-BR","tag":"Configuração do SDK móvel","count":18},{"language":"tr","tag":"Mobil SDK kurulumu","count":18},{"language":"default","tag":"Messages","count":9},{"language":"default","tag":"Users","count":9},{"language":"default","tag":"Organization","count":9},{"language":"default","tag":"Journeys","count":8},{"language":"default","tag":"Deprecated","count":6},{"language":"default","tag":"Templates","count":6},{"language":"default","tag":"Subscriptions","count":6},{"language":"default","tag":"Segments","count":5}]},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"email":"support@onesignal.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"reference/sms","slug":"/reference/sms","pageMetadata":{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Send a message using the SMS channel.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`The Create message API allows you to send push notifications, emails, and SMS to your users. This guide is specific for SMS and MMS. See `,_jsx(_components.a,{href:`/reference/push-notification`,children:`Push notification`}),` or `,_jsx(_components.a,{href:`/reference/email`,children:`Email`}),` to send to those channels.`]}),`\n`,_jsxs(_components.p,{children:[`Ensure your `,_jsx(_components.a,{href:`/docs/en/sms-setup`,children:`SMS setup`}),` is complete.`]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[`Review the `,_jsx(_components.a,{href:`/reference/create-message`,children:`Sending messages with the OneSignal API`}),` guide for details on how to structure your messages.`]}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/reference/create-message#choose-your-target-audience`,children:`Select your target audience`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/reference/create-message#craft-your-message`,children:`Craft your message`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/reference/create-message#schedule-%26-per-user-delivery`,children:`Schedule \u0026 per-user delivery options`})}),`\n`]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`trackable-links`,children:`Trackable links`}),`\n`,_jsxs(_components.p,{children:[`Add trackable links to your SMS `,_jsx(_components.code,{children:`contents`}),` using `,_jsx(_components.a,{href:`/docs/en/using-liquid-syntax`,children:`liquid syntax`}),` in the format `,_jsx(_components.code,{children:`{{'your_url' | track_link}}`}),`.`]}),`\n`,_jsx(_components.p,{children:`Example:`}),`\n`,_jsx(CodeBlock,{filename:`JSON`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"contents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"en\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hi, here's my link: {{'https://example.com' | track_link}} \"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`In this example, the liquid syntax block will be replaced with a trackable short link and display in the message as: `,_jsx(_components.code,{children:`1sgnl.co/XXXX`}),`.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/docs/en/links#sms`,children:`SMS trackable links`}),` for more details.`]})}),`\n`,_jsx(_components.hr,{})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Trackable links","slug":"trackable-links","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/onesignal/e069c1b9f3157e14/hotjar-koala.js","/_mintlify/custom/onesignal/3e5d03885ab32f49/intercom.js","/_mintlify/custom/onesignal/dbb7af4794d1b586/munchkin-marketo.js"],"openApiReferenceData":{"operation":{"summary":"SMS","description":"Send a message using the SMS channel.","operationId":"sms","x-codeSamples":[{"lang":"typescript","label":"Node.js SDK","source":"import Onesignal from '@onesignal/node-onesignal';\nimport { randomUUID } from 'node:crypto';\n\nconst configuration = Onesignal.createConfiguration({\n restApiKey: 'YOUR_REST_API_KEY',\n});\nconst apiInstance = new Onesignal.DefaultApi(configuration);\n\nconst notification = new Onesignal.Notification();\nnotification.app_id = 'YOUR_APP_ID';\nnotification.contents = { en: 'Hello from OneSignal!' };\nnotification.sms_from = '+15551234567';\n// Target by External ID: alias keys must match the API (external_id, not externalId).\nnotification.include_aliases = { external_id: ['YOUR_USER_EXTERNAL_ID'] };\nnotification.target_channel = 'sms';\n// Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n// If two requests arrive with the same key inside the 30-day window, only the first is sent\n// and the second returns the original response. `randomUUID` is imported from `node:crypto`\n// (available on Node 14.17+) — DO NOT reuse keys across logically distinct sends.\nnotification.idempotency_key = randomUUID();\n\ntry {\n const response = await apiInstance.createNotification(notification);\n if (!response.id) {\n console.warn(\"Notification was not sent:\", response.errors);\n } else if (response.errors) {\n console.log(\"Notification created:\", response.id, \"(partial failures:\", response.errors, \")\");\n } else {\n console.log(\"Notification created:\", response.id);\n }\n} catch (e) {\n if (e instanceof Onesignal.ApiException) {\n // `e.errorMessages` flattens any error-envelope shape to a `string[]`;\n // the raw parsed body remains on `e.body`.\n console.error(\"createNotification failed: HTTP \" + e.code, e.errorMessages);\n } else {\n throw e;\n }\n}"},{"lang":"python","label":"Python SDK","source":"import uuid\nimport onesignal\nfrom onesignal.api import default_api\nfrom onesignal.model.language_string_map import LanguageStringMap\nfrom onesignal.model.notification import Notification\n\n# See configuration.py for a list of all supported configuration parameters.\n# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY.\n# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself.\nconfiguration = onesignal.Configuration(\n rest_api_key = \"YOUR_REST_API_KEY\", # App REST API key required for most endpoints\n organization_api_key = \"YOUR_ORGANIZATION_API_KEY\" # Organization key is only required for creating new apps and other top-level endpoints\n)\n\n\nwith onesignal.ApiClient(configuration) as api_client:\n api_instance = default_api.DefaultApi(api_client)\n notification = Notification(\n app_id='YOUR_APP_ID',\n contents=LanguageStringMap(en='Hello from OneSignal!'),\n sms_from='+15551234567',\n include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},\n target_channel='sms',\n # Idempotency key: a client-generated UUID that lets you safely retry on network\n # failure. If two requests arrive with the same key inside the 30-day window, only\n # the first is sent and the second returns the original response. Use uuid.uuid4()\n # or a similar source of randomness — DO NOT reuse keys across logically distinct\n # sends.\n idempotency_key=str(uuid.uuid4()),\n )\n try:\n api_response = api_instance.create_notification(notification)\n # `api_response.id` discriminates the two HTTP 200 shapes. A falsy value means no\n # notification was created (e.g. all targets were unreachable / not subscribed).\n # `api_response.errors` is polymorphic: a `list[str]` in the no-subscribers case, or\n # a dict keyed by recipient-identifier type (`invalid_player_ids`,\n # `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS\n # created but some recipients were skipped. Access via `.get('errors')` rather than\n # attribute access — the legacy Python generator's `ModelNormal.__getattr__` raises\n # `ApiAttributeError` for optional fields that the server omitted, so plain\n # `api_response.errors` would crash on the pure-success path.\n response_id = api_response.get('id')\n response_errors = api_response.get('errors')\n if not response_id:\n print('Notification was not sent:', response_errors)\n elif response_errors:\n print('Notification created:', response_id, '(partial failures:', response_errors, ')')\n else:\n print('Notification created:', response_id)\n except onesignal.ApiException as e:\n print('Exception when calling DefaultApi->create_notification: %s\\n' % e)\n print('Status Code: %s' % e.status)\n # `e.error_messages` flattens any error-envelope shape to a list[str];\n # the raw body remains on `e.body`.\n print('Error Messages: %s' % e.error_messages)\n print('Response Body: %s' % e.body)"},{"lang":"php","label":"PHP SDK","source":"\u003c?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n\n// Configure Bearer authorization: rest_api_key\n$config = onesignal\\client\\Configuration::getDefaultConfiguration()\n ->setRestApiKeyToken('YOUR_REST_API_KEY')\n ->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY');\n\n\n\n$apiInstance = new onesignal\\client\\Api\\DefaultApi(\n new GuzzleHttp\\Client(),\n $config\n);\n\n$notification = new onesignal\\client\\Model\\Notification();\n$notification->setAppId('YOUR_APP_ID');\n$contents = new onesignal\\client\\Model\\LanguageStringMap();\n$contents->setEn('Hello from OneSignal!');\n$notification->setContents($contents);\n$notification->setSmsFrom('+15551234567');\n$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);\n$notification->setTargetChannel('sms');\n// Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n// If two requests arrive with the same key inside the 30-day window, only the first is sent\n// and the second returns the original response. Use a strong source of randomness — DO NOT\n// reuse keys across logically distinct sends. We use PHP 7+'s built-in random_bytes() here\n// so the snippet works against this SDK's declared composer.json deps (Guzzle + PSR-7) with\n// no extra install; projects that already pull in ramsey/uuid can swap in\n// `\\Ramsey\\Uuid\\Uuid::uuid4()->toString()` instead.\n$idempotencyKeyBytes = random_bytes(16);\n$idempotencyKeyBytes[6] = chr(ord($idempotencyKeyBytes[6]) \u0026 0x0f | 0x40);\n$idempotencyKeyBytes[8] = chr(ord($idempotencyKeyBytes[8]) \u0026 0x3f | 0x80);\n$idempotencyKey = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($idempotencyKeyBytes), 4));\n$notification->setIdempotencyKey($idempotencyKey);\n\ntry {\n $result = $apiInstance->createNotification($notification);\n // `$result->getId()` discriminates the two HTTP 200 shapes. A falsy value (empty\n // string or null) means no notification was created (e.g. all targets were\n // unreachable / not subscribed). `$result->getErrors()` is polymorphic: a `string[]`\n // in the no-subscribers case, or an object keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when\n // the notification WAS created but some recipients were skipped.\n if (!$result->getId()) {\n echo 'Notification was not sent: ', print_r($result->getErrors(), true), PHP_EOL;\n } elseif ($result->getErrors()) {\n echo 'Notification created: ', $result->getId(), ' (partial failures: ', print_r($result->getErrors(), true), ')', PHP_EOL;\n } else {\n echo 'Notification created: ', $result->getId(), PHP_EOL;\n }\n} catch (\\onesignal\\client\\ApiException $e) {\n echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;\n echo 'Status Code: ', $e->getCode(), PHP_EOL;\n echo 'Response Body: ', $e->getResponseBody(), PHP_EOL;\n} catch (\\Exception $e) {\n echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;\n}"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n \"context\"\n \"fmt\"\n \"os\"\n\n \"github.com/google/uuid\"\n \"github.com/OneSignal/onesignal-go-api/v5\"\n)\n\nfunc main() {\n configuration := onesignal.NewConfiguration()\n apiClient := onesignal.NewAPIClient(configuration)\n\n restAuth := context.WithValue(context.Background(), onesignal.RestApiKey, \"YOUR_REST_API_KEY\")\n\n notification := onesignal.NewNotification(\"YOUR_APP_ID\")\n contents := onesignal.NewLanguageStringMap()\n contents.SetEn(\"Hello from OneSignal!\")\n notification.SetContents(*contents)\n notification.SetSmsFrom(\"+15551234567\")\n notification.SetIncludeAliases(map[string][]string{\"external_id\": {\"YOUR_USER_EXTERNAL_ID\"}})\n notification.SetTargetChannel(\"sms\")\n // Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n // If two requests arrive with the same key inside the 30-day window, only the first is\n // sent and the second returns the original response. The `github.com/google/uuid` module\n // is not a declared dep of this SDK; run `go get github.com/google/uuid` (or `go mod tidy`\n // after importing it) before building. DO NOT reuse keys across logically distinct sends.\n notification.SetIdempotencyKey(uuid.NewString())\n\n resp, r, err := apiClient.DefaultApi.CreateNotification(restAuth).Notification(*notification).Execute()\n if err != nil {\n fmt.Fprintf(os.Stderr, \"Error when calling `DefaultApi.CreateNotification``: %v\\n\", err)\n fmt.Fprintf(os.Stderr, \"Full HTTP response: %v\\n\", r)\n if apiErr, ok := err.(*onesignal.GenericOpenAPIError); ok {\n fmt.Fprintf(os.Stderr, \"Response Body: %s\\n\", apiErr.Body())\n }\n return\n }\n // `resp.GetId()` discriminates the two HTTP 200 shapes. An empty string means no\n // notification was created (e.g. all targets were unreachable / not subscribed).\n // `resp.GetErrors()` is `interface{}` because the field is polymorphic: a `[]string` in\n // the no-subscribers case, or a map keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when\n // the notification WAS created but some recipients were skipped.\n if resp.GetId() == \"\" {\n fmt.Fprintf(os.Stderr, \"Notification was not sent: %v\\n\", resp.GetErrors())\n } else if errors := resp.GetErrors(); errors != nil {\n fmt.Fprintf(os.Stdout, \"Notification created: %s (partial failures: %v)\\n\", resp.GetId(), errors)\n } else {\n fmt.Fprintf(os.Stdout, \"Notification created: %s\\n\", resp.GetId())\n }\n}"},{"lang":"ruby","label":"Ruby SDK","source":"require 'onesignal'\n# setup authorization\nOneSignal.configure do |config|\n # Configure Bearer authorization: rest_api_key\n config.rest_api_key = 'YOUR_REST_API_KEY'\n\nend\n\napi_instance = OneSignal::DefaultApi.new\nrequire 'securerandom'\n\nnotification = OneSignal::Notification.new\nnotification.app_id = 'YOUR_APP_ID'\nnotification.contents = OneSignal::LanguageStringMap.new({ en: 'Hello from OneSignal!' })\nnotification.sms_from = '+15551234567'\nnotification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }\nnotification.target_channel = 'sms'\n# Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n# If two requests arrive with the same key inside the 30-day window, only the first is sent\n# and the second returns the original response. Use SecureRandom.uuid — DO NOT reuse keys\n# across logically distinct sends.\nnotification.idempotency_key = SecureRandom.uuid\n\nbegin\n # Create notification\n result = api_instance.create_notification(notification)\n # `result.id` discriminates the two HTTP 200 shapes. An empty string means no\n # notification was created (e.g. all targets were unreachable / not subscribed).\n # `result.errors` is polymorphic: an `Array\u003cString>` in the no-subscribers case, or\n # a Hash keyed by recipient-identifier type (`invalid_player_ids`,\n # `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS\n # created but some recipients were skipped.\n if result.id.to_s.empty?\n puts \"Notification was not sent: #{result.errors}\"\n elsif result.errors\n puts \"Notification created: #{result.id} (partial failures: #{result.errors})\"\n else\n puts \"Notification created: #{result.id}\"\n end\nrescue OneSignal::ApiError => e\n puts \"Error when calling DefaultApi->create_notification: #{e}\"\n puts \"Status Code: #{e.code}\"\n # `e.error_messages` flattens any error-envelope shape to an Array\u003cString>;\n # the raw body remains on `e.response_body`.\n puts \"Error Messages: #{e.error_messages}\"\n puts \"Response Body: #{e.response_body}\"\nend"},{"lang":"java","label":"Java SDK","source":"// Import classes:\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\n\nimport com.onesignal.client.ApiClient;\nimport com.onesignal.client.ApiException;\nimport com.onesignal.client.Configuration;\nimport com.onesignal.client.auth.*;\nimport com.onesignal.client.model.*;\nimport com.onesignal.client.api.DefaultApi;\n\npublic class Example {\n public static void main(String[] args) {\n ApiClient defaultClient = Configuration.getDefaultApiClient();\n defaultClient.setBasePath(\"https://api.onesignal.com\");\n\n HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication(\"rest_api_key\");\n rest_api_key.setBearerToken(\"YOUR_REST_API_KEY\");\n\n DefaultApi apiInstance = new DefaultApi(defaultClient);\n Notification notification = new Notification();\n notification.setAppId(\"YOUR_APP_ID\");\n LanguageStringMap contents = new LanguageStringMap();\n contents.setEn(\"Hello from OneSignal!\");\n notification.setContents(contents);\n notification.setSmsFrom(\"+15551234567\");\n Map\u003cString, List\u003cString>> aliases = new HashMap\u003c>();\n aliases.put(\"external_id\", Arrays.asList(\"YOUR_USER_EXTERNAL_ID\"));\n notification.setIncludeAliases(aliases);\n notification.setTargetChannel(Notification.TargetChannelEnum.SMS);\n // Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n // If two requests arrive with the same key inside the 30-day window, only the first is\n // sent and the second returns the original response. Use UUID.randomUUID() — DO NOT\n // reuse keys across logically distinct sends.\n notification.setIdempotencyKey(UUID.randomUUID().toString());\n\n try {\n CreateNotificationSuccessResponse result = apiInstance.createNotification(notification);\n // `result.getId()` discriminates the two HTTP 200 shapes. An empty string means no\n // notification was created (e.g. all targets were unreachable / not subscribed).\n // `result.getErrors()` is polymorphic (declared as `Object`): a `List\u003cString>` in the\n // no-subscribers case, or a Map keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when\n // the notification WAS created but some recipients were skipped.\n if (result.getId() == null || result.getId().isEmpty()) {\n System.out.println(\"Notification was not sent: \" + result.getErrors());\n } else if (result.getErrors() != null) {\n System.out.println(\"Notification created: \" + result.getId() + \" (partial failures: \" + result.getErrors() + \")\");\n } else {\n System.out.println(\"Notification created: \" + result.getId());\n }\n } catch (ApiException e) {\n System.err.println(\"Exception when calling DefaultApi#createNotification\");\n System.err.println(\"Status code: \" + e.getCode());\n System.err.println(\"Reason: \" + e.getResponseBody());\n System.err.println(\"Response headers: \" + e.getResponseHeaders());\n e.printStackTrace();\n }\n }\n}"},{"lang":"csharp","label":"C# SDK","source":"using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing OneSignalApi.Api;\nusing OneSignalApi.Client;\nusing OneSignalApi.Model;\n\nnamespace Example\n{\n public class CreateNotificationExample\n {\n public static void Main()\n {\n Configuration config = new Configuration();\n config.BasePath = \"https://api.onesignal.com\";\n config.AccessToken = \"YOUR_REST_API_KEY\";\n\n var apiInstance = new DefaultApi(config);\n\n var notification = new Notification\n {\n AppId = \"YOUR_APP_ID\",\n Contents = new LanguageStringMap(en: \"Hello from OneSignal!\"),\n SmsFrom = \"+15551234567\",\n IncludeAliases = new Dictionary\u003cstring, List\u003cstring>>\n {\n { \"external_id\", new List\u003cstring> { \"YOUR_USER_EXTERNAL_ID\" } }\n },\n TargetChannel = Notification.TargetChannelEnum.Sms,\n // Idempotency key: a client-generated UUID that lets you safely retry on\n // network failure. If two requests arrive with the same key inside the\n // 30-day window, only the first is sent and the second returns the original\n // response. Use Guid.NewGuid() — DO NOT reuse keys across logically distinct\n // sends.\n IdempotencyKey = Guid.NewGuid().ToString()\n };\n\n try\n {\n CreateNotificationSuccessResponse result = apiInstance.CreateNotification(notification);\n // `result.Id` discriminates the two HTTP 200 shapes. An empty string means\n // no notification was created (e.g. all targets were unreachable / not\n // subscribed). `result.Errors` is polymorphic: a `List\u003cstring>` in the\n // no-subscribers case, or an object keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...)\n // when the notification WAS created but some recipients were skipped.\n if (string.IsNullOrEmpty(result.Id))\n {\n Debug.WriteLine(\"Notification was not sent: \" + result.Errors);\n }\n else if (result.Errors != null)\n {\n Debug.WriteLine(\"Notification created: \" + result.Id + \" (partial failures: \" + result.Errors + \")\");\n }\n else\n {\n Debug.WriteLine(\"Notification created: \" + result.Id);\n }\n }\n catch (ApiException e)\n {\n Debug.Print(\"Exception when calling DefaultApi.CreateNotification: \" + e.Message);\n Debug.Print(\"Status Code: \" + e.ErrorCode);\n Debug.Print(\"Response Body: \" + e.ErrorContent);\n Debug.Print(e.StackTrace);\n }\n }\n }\n}"},{"lang":"rust","label":"Rust SDK","source":"use onesignal_rust_api::apis::configuration::Configuration;\nuse onesignal_rust_api::apis::default_api;\nuse onesignal_rust_api::models::notification::TargetChannelType;\nuse onesignal_rust_api::models::{LanguageStringMap, Notification};\nuse uuid::Uuid;\n\n#[tokio::main]\nasync fn main() {\n let mut configuration = Configuration::new();\n configuration.rest_api_key_token = Some(\"YOUR_REST_API_KEY\".to_string());\n\n let mut notification = Notification::new(\"YOUR_APP_ID\".to_string());\n notification.contents = Some(Box::new(LanguageStringMap {\n en: Some(\"Hello from OneSignal!\".to_string()),\n ..Default::default()\n }));\n notification.sms_from = Some(\"+15551234567\".to_string());\n let mut aliases = std::collections::HashMap::new();\n aliases.insert(\n \"external_id\".to_string(),\n vec![\"YOUR_USER_EXTERNAL_ID\".to_string()],\n );\n notification.include_aliases = Some(aliases);\n notification.target_channel = Some(TargetChannelType::Sms);\n // Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n // If two requests arrive with the same key inside the 30-day window, only the first is\n // sent and the second returns the original response. The `uuid` crate must be declared\n // in your own Cargo.toml (Cargo doesn't expose transitive crates by name to downstream\n // code) — add `uuid = { version = \"1\", features = [\"v4\"] }` to your `[dependencies]`.\n // DO NOT reuse keys across logically distinct sends.\n notification.idempotency_key = Some(Uuid::new_v4().to_string());\n\n match default_api::create_notification(\u0026configuration, notification).await {\n Ok(resp) => {\n // `resp.id` discriminates the two HTTP 200 shapes. An empty string or `None`\n // means no notification was created (e.g. all targets were unreachable / not\n // subscribed). `resp.errors` is polymorphic (typed as `Option\u003cserde_json::Value>`):\n // a `Vec\u003cString>` in the no-subscribers case, or an object keyed by\n // recipient-identifier type (`invalid_player_ids`, `invalid_external_user_ids`,\n // `invalid_aliases`, ...) when the notification WAS created but some recipients\n // were skipped.\n match resp.id.as_deref() {\n Some(\"\") | None => eprintln!(\"Notification was not sent: {:?}\", resp.errors),\n Some(id) if resp.errors.is_some() => {\n println!(\"Notification created: {} (partial failures: {:?})\", id, resp.errors)\n }\n Some(id) => println!(\"Notification created: {}\", id),\n }\n }\n Err(onesignal_rust_api::apis::Error::ResponseError(content)) => {\n eprintln!(\"create_notification failed: HTTP {}\", content.status);\n eprintln!(\"Response Body: {}\", content.content);\n }\n Err(e) => eprintln!(\"create_notification failed: {:?}\", e),\n }\n}"}],"parameters":["da3d1fe9-e0e0-47e4-9696-d10e9d5e48f8"],"requestBody":"319b23a3-e0b7-4058-9949-bebc1facc8a6","responses":{"200":"dbdc02df-6196-415c-98a7-2d77cfc57c12","400":"6da146c8-3e43-452f-be46-fa1cb262bc59","403":"2374e154-1ffa-4262-8ac5-edd9b76ca80b","429":"1de5e565-4fe3-4c05-b915-0e3791848d81","503":"40321a34-d5bc-4c6a-bdd6-d2d20bb604a0"},"deprecated":false,"method":"post","type":"path","servers":["cf753503-cc1a-4f14-8e18-590f517b52c4"],"security":["c673d826-9e50-44e7-be1a-14cb91ce6281"],"path":"/notifications?c=sms","baseUrlOptions":["https://api.onesignal.com"],"title":"SMS","codeSamples":[{"label":"Node.js SDK","lang":"typescript","source":"import Onesignal from '@onesignal/node-onesignal';\nimport { randomUUID } from 'node:crypto';\n\nconst configuration = Onesignal.createConfiguration({\n restApiKey: 'YOUR_REST_API_KEY',\n});\nconst apiInstance = new Onesignal.DefaultApi(configuration);\n\nconst notification = new Onesignal.Notification();\nnotification.app_id = 'YOUR_APP_ID';\nnotification.contents = { en: 'Hello from OneSignal!' };\nnotification.sms_from = '+15551234567';\n// Target by External ID: alias keys must match the API (external_id, not externalId).\nnotification.include_aliases = { external_id: ['YOUR_USER_EXTERNAL_ID'] };\nnotification.target_channel = 'sms';\n// Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n// If two requests arrive with the same key inside the 30-day window, only the first is sent\n// and the second returns the original response. `randomUUID` is imported from `node:crypto`\n// (available on Node 14.17+) — DO NOT reuse keys across logically distinct sends.\nnotification.idempotency_key = randomUUID();\n\ntry {\n const response = await apiInstance.createNotification(notification);\n if (!response.id) {\n console.warn(\"Notification was not sent:\", response.errors);\n } else if (response.errors) {\n console.log(\"Notification created:\", response.id, \"(partial failures:\", response.errors, \")\");\n } else {\n console.log(\"Notification created:\", response.id);\n }\n} catch (e) {\n if (e instanceof Onesignal.ApiException) {\n // `e.errorMessages` flattens any error-envelope shape to a `string[]`;\n // the raw parsed body remains on `e.body`.\n console.error(\"createNotification failed: HTTP \" + e.code, e.errorMessages);\n } else {\n throw e;\n }\n}"},{"label":"Python SDK","lang":"python","source":"import uuid\nimport onesignal\nfrom onesignal.api import default_api\nfrom onesignal.model.language_string_map import LanguageStringMap\nfrom onesignal.model.notification import Notification\n\n# See configuration.py for a list of all supported configuration parameters.\n# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY.\n# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself.\nconfiguration = onesignal.Configuration(\n rest_api_key = \"YOUR_REST_API_KEY\", # App REST API key required for most endpoints\n organization_api_key = \"YOUR_ORGANIZATION_API_KEY\" # Organization key is only required for creating new apps and other top-level endpoints\n)\n\n\nwith onesignal.ApiClient(configuration) as api_client:\n api_instance = default_api.DefaultApi(api_client)\n notification = Notification(\n app_id='YOUR_APP_ID',\n contents=LanguageStringMap(en='Hello from OneSignal!'),\n sms_from='+15551234567',\n include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},\n target_channel='sms',\n # Idempotency key: a client-generated UUID that lets you safely retry on network\n # failure. If two requests arrive with the same key inside the 30-day window, only\n # the first is sent and the second returns the original response. Use uuid.uuid4()\n # or a similar source of randomness — DO NOT reuse keys across logically distinct\n # sends.\n idempotency_key=str(uuid.uuid4()),\n )\n try:\n api_response = api_instance.create_notification(notification)\n # `api_response.id` discriminates the two HTTP 200 shapes. A falsy value means no\n # notification was created (e.g. all targets were unreachable / not subscribed).\n # `api_response.errors` is polymorphic: a `list[str]` in the no-subscribers case, or\n # a dict keyed by recipient-identifier type (`invalid_player_ids`,\n # `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS\n # created but some recipients were skipped. Access via `.get('errors')` rather than\n # attribute access — the legacy Python generator's `ModelNormal.__getattr__` raises\n # `ApiAttributeError` for optional fields that the server omitted, so plain\n # `api_response.errors` would crash on the pure-success path.\n response_id = api_response.get('id')\n response_errors = api_response.get('errors')\n if not response_id:\n print('Notification was not sent:', response_errors)\n elif response_errors:\n print('Notification created:', response_id, '(partial failures:', response_errors, ')')\n else:\n print('Notification created:', response_id)\n except onesignal.ApiException as e:\n print('Exception when calling DefaultApi->create_notification: %s\\n' % e)\n print('Status Code: %s' % e.status)\n # `e.error_messages` flattens any error-envelope shape to a list[str];\n # the raw body remains on `e.body`.\n print('Error Messages: %s' % e.error_messages)\n print('Response Body: %s' % e.body)"},{"label":"PHP SDK","lang":"php","source":"\u003c?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n\n// Configure Bearer authorization: rest_api_key\n$config = onesignal\\client\\Configuration::getDefaultConfiguration()\n ->setRestApiKeyToken('YOUR_REST_API_KEY')\n ->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY');\n\n\n\n$apiInstance = new onesignal\\client\\Api\\DefaultApi(\n new GuzzleHttp\\Client(),\n $config\n);\n\n$notification = new onesignal\\client\\Model\\Notification();\n$notification->setAppId('YOUR_APP_ID');\n$contents = new onesignal\\client\\Model\\LanguageStringMap();\n$contents->setEn('Hello from OneSignal!');\n$notification->setContents($contents);\n$notification->setSmsFrom('+15551234567');\n$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);\n$notification->setTargetChannel('sms');\n// Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n// If two requests arrive with the same key inside the 30-day window, only the first is sent\n// and the second returns the original response. Use a strong source of randomness — DO NOT\n// reuse keys across logically distinct sends. We use PHP 7+'s built-in random_bytes() here\n// so the snippet works against this SDK's declared composer.json deps (Guzzle + PSR-7) with\n// no extra install; projects that already pull in ramsey/uuid can swap in\n// `\\Ramsey\\Uuid\\Uuid::uuid4()->toString()` instead.\n$idempotencyKeyBytes = random_bytes(16);\n$idempotencyKeyBytes[6] = chr(ord($idempotencyKeyBytes[6]) \u0026 0x0f | 0x40);\n$idempotencyKeyBytes[8] = chr(ord($idempotencyKeyBytes[8]) \u0026 0x3f | 0x80);\n$idempotencyKey = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($idempotencyKeyBytes), 4));\n$notification->setIdempotencyKey($idempotencyKey);\n\ntry {\n $result = $apiInstance->createNotification($notification);\n // `$result->getId()` discriminates the two HTTP 200 shapes. A falsy value (empty\n // string or null) means no notification was created (e.g. all targets were\n // unreachable / not subscribed). `$result->getErrors()` is polymorphic: a `string[]`\n // in the no-subscribers case, or an object keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when\n // the notification WAS created but some recipients were skipped.\n if (!$result->getId()) {\n echo 'Notification was not sent: ', print_r($result->getErrors(), true), PHP_EOL;\n } elseif ($result->getErrors()) {\n echo 'Notification created: ', $result->getId(), ' (partial failures: ', print_r($result->getErrors(), true), ')', PHP_EOL;\n } else {\n echo 'Notification created: ', $result->getId(), PHP_EOL;\n }\n} catch (\\onesignal\\client\\ApiException $e) {\n echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;\n echo 'Status Code: ', $e->getCode(), PHP_EOL;\n echo 'Response Body: ', $e->getResponseBody(), PHP_EOL;\n} catch (\\Exception $e) {\n echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL;\n}"},{"label":"Go SDK","lang":"go","source":"package main\n\nimport (\n \"context\"\n \"fmt\"\n \"os\"\n\n \"github.com/google/uuid\"\n \"github.com/OneSignal/onesignal-go-api/v5\"\n)\n\nfunc main() {\n configuration := onesignal.NewConfiguration()\n apiClient := onesignal.NewAPIClient(configuration)\n\n restAuth := context.WithValue(context.Background(), onesignal.RestApiKey, \"YOUR_REST_API_KEY\")\n\n notification := onesignal.NewNotification(\"YOUR_APP_ID\")\n contents := onesignal.NewLanguageStringMap()\n contents.SetEn(\"Hello from OneSignal!\")\n notification.SetContents(*contents)\n notification.SetSmsFrom(\"+15551234567\")\n notification.SetIncludeAliases(map[string][]string{\"external_id\": {\"YOUR_USER_EXTERNAL_ID\"}})\n notification.SetTargetChannel(\"sms\")\n // Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n // If two requests arrive with the same key inside the 30-day window, only the first is\n // sent and the second returns the original response. The `github.com/google/uuid` module\n // is not a declared dep of this SDK; run `go get github.com/google/uuid` (or `go mod tidy`\n // after importing it) before building. DO NOT reuse keys across logically distinct sends.\n notification.SetIdempotencyKey(uuid.NewString())\n\n resp, r, err := apiClient.DefaultApi.CreateNotification(restAuth).Notification(*notification).Execute()\n if err != nil {\n fmt.Fprintf(os.Stderr, \"Error when calling `DefaultApi.CreateNotification``: %v\\n\", err)\n fmt.Fprintf(os.Stderr, \"Full HTTP response: %v\\n\", r)\n if apiErr, ok := err.(*onesignal.GenericOpenAPIError); ok {\n fmt.Fprintf(os.Stderr, \"Response Body: %s\\n\", apiErr.Body())\n }\n return\n }\n // `resp.GetId()` discriminates the two HTTP 200 shapes. An empty string means no\n // notification was created (e.g. all targets were unreachable / not subscribed).\n // `resp.GetErrors()` is `interface{}` because the field is polymorphic: a `[]string` in\n // the no-subscribers case, or a map keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when\n // the notification WAS created but some recipients were skipped.\n if resp.GetId() == \"\" {\n fmt.Fprintf(os.Stderr, \"Notification was not sent: %v\\n\", resp.GetErrors())\n } else if errors := resp.GetErrors(); errors != nil {\n fmt.Fprintf(os.Stdout, \"Notification created: %s (partial failures: %v)\\n\", resp.GetId(), errors)\n } else {\n fmt.Fprintf(os.Stdout, \"Notification created: %s\\n\", resp.GetId())\n }\n}"},{"label":"Ruby SDK","lang":"ruby","source":"require 'onesignal'\n# setup authorization\nOneSignal.configure do |config|\n # Configure Bearer authorization: rest_api_key\n config.rest_api_key = 'YOUR_REST_API_KEY'\n\nend\n\napi_instance = OneSignal::DefaultApi.new\nrequire 'securerandom'\n\nnotification = OneSignal::Notification.new\nnotification.app_id = 'YOUR_APP_ID'\nnotification.contents = OneSignal::LanguageStringMap.new({ en: 'Hello from OneSignal!' })\nnotification.sms_from = '+15551234567'\nnotification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }\nnotification.target_channel = 'sms'\n# Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n# If two requests arrive with the same key inside the 30-day window, only the first is sent\n# and the second returns the original response. Use SecureRandom.uuid — DO NOT reuse keys\n# across logically distinct sends.\nnotification.idempotency_key = SecureRandom.uuid\n\nbegin\n # Create notification\n result = api_instance.create_notification(notification)\n # `result.id` discriminates the two HTTP 200 shapes. An empty string means no\n # notification was created (e.g. all targets were unreachable / not subscribed).\n # `result.errors` is polymorphic: an `Array\u003cString>` in the no-subscribers case, or\n # a Hash keyed by recipient-identifier type (`invalid_player_ids`,\n # `invalid_external_user_ids`, `invalid_aliases`, ...) when the notification WAS\n # created but some recipients were skipped.\n if result.id.to_s.empty?\n puts \"Notification was not sent: #{result.errors}\"\n elsif result.errors\n puts \"Notification created: #{result.id} (partial failures: #{result.errors})\"\n else\n puts \"Notification created: #{result.id}\"\n end\nrescue OneSignal::ApiError => e\n puts \"Error when calling DefaultApi->create_notification: #{e}\"\n puts \"Status Code: #{e.code}\"\n # `e.error_messages` flattens any error-envelope shape to an Array\u003cString>;\n # the raw body remains on `e.response_body`.\n puts \"Error Messages: #{e.error_messages}\"\n puts \"Response Body: #{e.response_body}\"\nend"},{"label":"Java SDK","lang":"java","source":"// Import classes:\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\n\nimport com.onesignal.client.ApiClient;\nimport com.onesignal.client.ApiException;\nimport com.onesignal.client.Configuration;\nimport com.onesignal.client.auth.*;\nimport com.onesignal.client.model.*;\nimport com.onesignal.client.api.DefaultApi;\n\npublic class Example {\n public static void main(String[] args) {\n ApiClient defaultClient = Configuration.getDefaultApiClient();\n defaultClient.setBasePath(\"https://api.onesignal.com\");\n\n HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication(\"rest_api_key\");\n rest_api_key.setBearerToken(\"YOUR_REST_API_KEY\");\n\n DefaultApi apiInstance = new DefaultApi(defaultClient);\n Notification notification = new Notification();\n notification.setAppId(\"YOUR_APP_ID\");\n LanguageStringMap contents = new LanguageStringMap();\n contents.setEn(\"Hello from OneSignal!\");\n notification.setContents(contents);\n notification.setSmsFrom(\"+15551234567\");\n Map\u003cString, List\u003cString>> aliases = new HashMap\u003c>();\n aliases.put(\"external_id\", Arrays.asList(\"YOUR_USER_EXTERNAL_ID\"));\n notification.setIncludeAliases(aliases);\n notification.setTargetChannel(Notification.TargetChannelEnum.SMS);\n // Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n // If two requests arrive with the same key inside the 30-day window, only the first is\n // sent and the second returns the original response. Use UUID.randomUUID() — DO NOT\n // reuse keys across logically distinct sends.\n notification.setIdempotencyKey(UUID.randomUUID().toString());\n\n try {\n CreateNotificationSuccessResponse result = apiInstance.createNotification(notification);\n // `result.getId()` discriminates the two HTTP 200 shapes. An empty string means no\n // notification was created (e.g. all targets were unreachable / not subscribed).\n // `result.getErrors()` is polymorphic (declared as `Object`): a `List\u003cString>` in the\n // no-subscribers case, or a Map keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...) when\n // the notification WAS created but some recipients were skipped.\n if (result.getId() == null || result.getId().isEmpty()) {\n System.out.println(\"Notification was not sent: \" + result.getErrors());\n } else if (result.getErrors() != null) {\n System.out.println(\"Notification created: \" + result.getId() + \" (partial failures: \" + result.getErrors() + \")\");\n } else {\n System.out.println(\"Notification created: \" + result.getId());\n }\n } catch (ApiException e) {\n System.err.println(\"Exception when calling DefaultApi#createNotification\");\n System.err.println(\"Status code: \" + e.getCode());\n System.err.println(\"Reason: \" + e.getResponseBody());\n System.err.println(\"Response headers: \" + e.getResponseHeaders());\n e.printStackTrace();\n }\n }\n}"},{"label":"C# SDK","lang":"csharp","source":"using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing OneSignalApi.Api;\nusing OneSignalApi.Client;\nusing OneSignalApi.Model;\n\nnamespace Example\n{\n public class CreateNotificationExample\n {\n public static void Main()\n {\n Configuration config = new Configuration();\n config.BasePath = \"https://api.onesignal.com\";\n config.AccessToken = \"YOUR_REST_API_KEY\";\n\n var apiInstance = new DefaultApi(config);\n\n var notification = new Notification\n {\n AppId = \"YOUR_APP_ID\",\n Contents = new LanguageStringMap(en: \"Hello from OneSignal!\"),\n SmsFrom = \"+15551234567\",\n IncludeAliases = new Dictionary\u003cstring, List\u003cstring>>\n {\n { \"external_id\", new List\u003cstring> { \"YOUR_USER_EXTERNAL_ID\" } }\n },\n TargetChannel = Notification.TargetChannelEnum.Sms,\n // Idempotency key: a client-generated UUID that lets you safely retry on\n // network failure. If two requests arrive with the same key inside the\n // 30-day window, only the first is sent and the second returns the original\n // response. Use Guid.NewGuid() — DO NOT reuse keys across logically distinct\n // sends.\n IdempotencyKey = Guid.NewGuid().ToString()\n };\n\n try\n {\n CreateNotificationSuccessResponse result = apiInstance.CreateNotification(notification);\n // `result.Id` discriminates the two HTTP 200 shapes. An empty string means\n // no notification was created (e.g. all targets were unreachable / not\n // subscribed). `result.Errors` is polymorphic: a `List\u003cstring>` in the\n // no-subscribers case, or an object keyed by recipient-identifier type\n // (`invalid_player_ids`, `invalid_external_user_ids`, `invalid_aliases`, ...)\n // when the notification WAS created but some recipients were skipped.\n if (string.IsNullOrEmpty(result.Id))\n {\n Debug.WriteLine(\"Notification was not sent: \" + result.Errors);\n }\n else if (result.Errors != null)\n {\n Debug.WriteLine(\"Notification created: \" + result.Id + \" (partial failures: \" + result.Errors + \")\");\n }\n else\n {\n Debug.WriteLine(\"Notification created: \" + result.Id);\n }\n }\n catch (ApiException e)\n {\n Debug.Print(\"Exception when calling DefaultApi.CreateNotification: \" + e.Message);\n Debug.Print(\"Status Code: \" + e.ErrorCode);\n Debug.Print(\"Response Body: \" + e.ErrorContent);\n Debug.Print(e.StackTrace);\n }\n }\n }\n}"},{"label":"Rust SDK","lang":"rust","source":"use onesignal_rust_api::apis::configuration::Configuration;\nuse onesignal_rust_api::apis::default_api;\nuse onesignal_rust_api::models::notification::TargetChannelType;\nuse onesignal_rust_api::models::{LanguageStringMap, Notification};\nuse uuid::Uuid;\n\n#[tokio::main]\nasync fn main() {\n let mut configuration = Configuration::new();\n configuration.rest_api_key_token = Some(\"YOUR_REST_API_KEY\".to_string());\n\n let mut notification = Notification::new(\"YOUR_APP_ID\".to_string());\n notification.contents = Some(Box::new(LanguageStringMap {\n en: Some(\"Hello from OneSignal!\".to_string()),\n ..Default::default()\n }));\n notification.sms_from = Some(\"+15551234567\".to_string());\n let mut aliases = std::collections::HashMap::new();\n aliases.insert(\n \"external_id\".to_string(),\n vec![\"YOUR_USER_EXTERNAL_ID\".to_string()],\n );\n notification.include_aliases = Some(aliases);\n notification.target_channel = Some(TargetChannelType::Sms);\n // Idempotency key: a client-generated UUID that lets you safely retry on network failure.\n // If two requests arrive with the same key inside the 30-day window, only the first is\n // sent and the second returns the original response. The `uuid` crate must be declared\n // in your own Cargo.toml (Cargo doesn't expose transitive crates by name to downstream\n // code) — add `uuid = { version = \"1\", features = [\"v4\"] }` to your `[dependencies]`.\n // DO NOT reuse keys across logically distinct sends.\n notification.idempotency_key = Some(Uuid::new_v4().to_string());\n\n match default_api::create_notification(\u0026configuration, notification).await {\n Ok(resp) => {\n // `resp.id` discriminates the two HTTP 200 shapes. An empty string or `None`\n // means no notification was created (e.g. all targets were unreachable / not\n // subscribed). `resp.errors` is polymorphic (typed as `Option\u003cserde_json::Value>`):\n // a `Vec\u003cString>` in the no-subscribers case, or an object keyed by\n // recipient-identifier type (`invalid_player_ids`, `invalid_external_user_ids`,\n // `invalid_aliases`, ...) when the notification WAS created but some recipients\n // were skipped.\n match resp.id.as_deref() {\n Some(\"\") | None => eprintln!(\"Notification was not sent: {:?}\", resp.errors),\n Some(id) if resp.errors.is_some() => {\n println!(\"Notification created: {} (partial failures: {:?})\", id, resp.errors)\n }\n Some(id) => println!(\"Notification created: {}\", id),\n }\n }\n Err(onesignal_rust_api::apis::Error::ResponseError(content)) => {\n eprintln!(\"create_notification failed: HTTP {}\", content.status);\n eprintln!(\"Response Body: {}\", content.content);\n }\n Err(e) => eprintln!(\"create_notification failed: {:?}\", e),\n }\n}"}],"requestExampleLanguages":["bash","typescript","python","php","go","ruby","java","csharp","rust"],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"da3d1fe9-e0e0-47e4-9696-d10e9d5e48f8":{"name":"Authorization","in":"header","description":"Your App API key with prefix `Key `. See [Keys \u0026 IDs](/docs/en/keys-and-ids).","required":true,"schema":{"type":"string","default":"Key YOUR_APP_API_KEY","isRequired":true,"description":"Your App API key with prefix `Key `. See [Keys \u0026 IDs](/docs/en/keys-and-ids).","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["app_id","contents","target_channel"],"properties":{"app_id":{"type":"string","description":"Your OneSignal App ID in UUID v4 format. See [Keys \u0026 IDs](/docs/en/keys-and-ids).","default":"YOUR_APP_ID","isRequired":true,"uniqueKey":"app_id","typeLabel":"string"},"contents":{"type":"object","description":"The main message body with [language-specific values](/docs/en/multi-language-messaging#supported-languages). Too many characters may result in multiple messages and increased costs. See [SMS](/docs/en/sms-messaging). Required unless using `template_id`. Supports [Message Personalization](/docs/en/message-personalization). You can add trackable links to your SMS via the API by including liquid syntax in your message contents. For example: {{'your_url' | track_link}} The liquid syntax block will be replaced with a trackable short link in the following format: 1sgnl.co/XXXX. Using trackable links allows you to see the click through rates of your SMS.","required":["en"],"properties":{"en":{"type":"string","description":"The required message language type. See [Supported Languages](/docs/en/multi-language-messaging#supported-languages).","isRequired":true,"uniqueKey":"contents.en","typeLabel":"string"}},"isRequired":true,"uniqueKey":"contents","typeLabel":"object"},"target_channel":{"type":"string","description":"The targeted delivery channel. Required when using `include_aliases` and `included_segments` for SMS/RCS. Accepts `push`, `email`, or `sms`.","enum":["push","email","sms"],"default":"sms","isRequired":true,"uniqueKey":"target_channel","typeLabel":"enum\u003cstring>"},"include_aliases":{"type":"object","description":"Target up to 20,000 users by their `external_id`, `onesignal_id`, or your own custom alias. Use with `target_channel` to control the delivery channel. Not compatible with any other targeting parameters like `filters`, `include_subscription_ids`, `included_segments`, or `excluded_segments`. See [Sending messages with the OneSignal API](/reference/create-message#include-aliases).","format":"json","properties":{"external_id":{"description":"An array of external IDs which should be the same as the user ID in your app. This is the recommended method for targeting users. See [Users](/docs/en/users).","type":"array","items":{"type":"string","uniqueKey":"include_aliases.external_id.items.[INDEX]","typeLabel":"string"},"uniqueKey":"include_aliases.external_id","typeLabel":"string[]"}},"uniqueKey":"include_aliases","typeLabel":"object"},"include_subscription_ids":{"type":"array","description":"Target users' specific [subscriptions](/docs/en/subscriptions) by ID. Include up to 20,000 `subscription_id` per API call. Not compatible with any other targeting parameters like `filters`, `include_aliases`, `included_segments`, or `excluded_segments`. See [Sending messages with the OneSignal API](/reference/create-message).","items":{"type":"string","uniqueKey":"include_subscription_ids.items.[INDEX]","typeLabel":"string"},"uniqueKey":"include_subscription_ids","typeLabel":"string[]"},"include_phone_numbers":{"type":"array","description":"Send SMS/MMS to specific users by their phone number in [E.164 format](/docs/en/sms-setup#what-is-e164-format). Can only be used when sending [SMS/MMS](/reference/sms). Include up to 20,000 phone numbers per API call. If the phone number does not exist within the OneSignal App, then a new SMS Subscription will be created. Not compatible with any other targeting parameters like `filters`, `include_aliases`, `included_segments`, or `excluded_segments`. See [Sending messages with the OneSignal API](/reference/create-message).","items":{"type":"string","uniqueKey":"include_phone_numbers.items.[INDEX]","typeLabel":"string"},"uniqueKey":"include_phone_numbers","typeLabel":"string[]"},"included_segments":{"type":"array","description":"Target predefined [Segments](/docs/en/segmentation). Users that are in multiple segments will only be sent the message once. Can be combined with `excluded_segments`. Requires `target_channel` to be set to `'sms'` or `isSms=true` when sending SMS/RCS. Not compatible with any other targeting parameters like `filters`, `include_aliases`, or `include_subscription_ids`. See [Sending messages with the OneSignal API](/reference/create-message).","items":{"type":"string","uniqueKey":"included_segments.items.[INDEX]","typeLabel":"string"},"uniqueKey":"included_segments","typeLabel":"string[]"},"excluded_segments":{"type":"array","description":"Exclude users in predefined [Segments](/docs/en/segmentation). Overrides membership in any segment specified in the `included_segments`. Not compatible with any other targeting parameters like `filters`, `include_aliases`, or `include_subscription_ids`. See [Sending messages with the OneSignal API](/reference/create-message).","items":{"type":"string","uniqueKey":"excluded_segments.items.[INDEX]","typeLabel":"string"},"uniqueKey":"excluded_segments","typeLabel":"string[]"},"filters":{"type":"array","description":"Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and `OR` operators. See [Sending messages with the OneSignal API](/reference/create-message#filters).","items":{"oneOf":[{"type":"object","title":"Filter","description":"Required. The fitler object.","required":["field","relation"],"properties":{"field":{"type":"string","description":"The name of the filter to use.","enum":["tag","last_session","first_session","session_count","session_time","language","app_version","location","country"],"isRequired":true,"uniqueKey":"filters.items.[INDEX].oneOf.0.field","typeLabel":"enum\u003cstring>"},"relation":{"type":"string","description":"Used with most filters. See details on the specific filter.","enum":["=","!=",">","\u003c","exists","not_exists","in_array","not_in_array","time_elapsed_gt","time_elapsed_lt"],"isRequired":true,"uniqueKey":"filters.items.[INDEX].oneOf.0.relation","typeLabel":"enum\u003cstring>"},"key":{"type":"string","description":"Used with the `tag` filter. This is the tag `key`.","uniqueKey":"filters.items.[INDEX].oneOf.0.key","typeLabel":"string"},"value":{"type":"string","description":"The value of the `field` or tag `key` in which you want to filter with.","uniqueKey":"filters.items.[INDEX].oneOf.0.value","typeLabel":"string"}},"uniqueKey":"filters.items.[INDEX].oneOf.0","typeLabel":"Filter · object"},{"type":"object","title":"Operator","properties":{"operator":{"type":"string","description":"Chain filter conditions with implicit `AND` and `OR` logic. Never end your `filters` object with an `operator`. See [filters](/reference/create-message#filters) for more.","enum":["AND","OR"],"default":"AND","uniqueKey":"filters.items.[INDEX].oneOf.1.operator","typeLabel":"enum\u003cstring>"}},"uniqueKey":"filters.items.[INDEX].oneOf.1","typeLabel":"Operator · object"}],"uniqueKey":"filters.items.[INDEX]","typeLabel":"Filter · object | Operator · object"},"minItems":1,"maxItems":200,"uniqueKey":"filters","typeLabel":"(Filter · object | Operator · object)[]"},"sms_from":{"type":"string","description":"The [Messaging Service ID](/docs/en/sms-setup#step-2-create-senders) or phone number used to send the SMS or MMS. Its recommended to use Messaging Service SIDs (e.g., `MGxxxxxxxxxxxxxxx`) but also accepts E.164 phone numbers (e.g., `+12065551234`). Defaults to the sender selected in [SMS Setup](/docs/en/sms-setup). If using [per-sender opt-out](/docs/en/sms-consent-keyword-management), you must use a Messaging Service ID.","uniqueKey":"sms_from","typeLabel":"string"},"sms_media_urls":{"type":"array","description":"URLs for the media files to be sent as MMS. Additional rates apply. `sms_from` must support sending MMS messages. See [SMS](/docs/en/sms-messaging).","items":{"type":"string","uniqueKey":"sms_media_urls.items.[INDEX]","typeLabel":"string"},"uniqueKey":"sms_media_urls","typeLabel":"string[]"},"name":{"type":"string","description":"An internal name you set to help organize and track messages. Not shown to recipients. Maximum 128 characters.","uniqueKey":"name","typeLabel":"string"},"template_id":{"type":"string","description":"The template ID in UUID v4 format set for the message if applicable. See [Templates](/docs/en/templates).","uniqueKey":"template_id","typeLabel":"string"},"custom_data":{"type":"object","description":"Include user or context-specific data (e.g., cart items, OTPs, links) in a message. Use with `template_id`. See [Message Personalization](/docs/en/message-personalization). Max size: 2KB (Push/SMS), 10KB (Email).","uniqueKey":"custom_data","typeLabel":"object"},"send_after":{"type":"string","description":"Schedule delivery for a future date/time (in UTC). The format must be valid per the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard and compatible with [`JavaScript's Date() parser`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date#datestring). Example: `2025-09-24T14:00:00-07:00`","uniqueKey":"send_after","typeLabel":"string"},"idempotency_key":{"type":"string","description":"A unique identifier used to prevent duplicate messages from repeat API calls. See [Idempotent notification requests](/reference/idempotent-notification-requests). Any RFC 9562 UUID supported. Valid for 30 days. Previously called `external_id`.","uniqueKey":"idempotency_key","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"app_id":"YOUR_APP_ID","contents":{"en":"\u003cstring>"},"target_channel":"sms","include_aliases":{"external_id":["\u003cstring>"]},"include_subscription_ids":["\u003cstring>"],"include_phone_numbers":["\u003cstring>"],"included_segments":["\u003cstring>"],"excluded_segments":["\u003cstring>"],"filters":[{"key":"\u003cstring>","value":"\u003cstring>"}],"sms_from":"\u003cstring>","sms_media_urls":["\u003cstring>"],"name":"\u003cstring>","template_id":"\u003cstring>","custom_data":{},"send_after":"\u003cstring>","idempotency_key":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"dbdc02df-6196-415c-98a7-2d77cfc57c12":{"description":"200","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Message Sent","description":"Two variants are possible with HTTP 200, distinguished by the `id` field: a UUID indicates the message was accepted and dispatched (Message Sent); an empty string indicates the request was valid but no subscribers matched (Message Not Sent). Inspect `errors` when `id` is empty.","required":["id"],"properties":{"id":{"type":"string","description":"Notification ID in UUID v4 format. If `id` is an empty string, then the message was not sent.","format":"uuid","isRequired":true,"uniqueKey":"oneOf.0.id","typeLabel":"string\u003cuuid>"},"external_id":{"oneOf":[{"type":"string","description":"The `idempotency_key` parameter from the request, echoed back. Null when no `idempotency_key` was provided. Use this to detect duplicate-send attempts. See [Idempotent message requests](/reference/idempotent-notification-requests).","uniqueKey":"oneOf.0.external_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"The `idempotency_key` parameter from the request, echoed back. Null when no `idempotency_key` was provided. Use this to detect duplicate-send attempts. See [Idempotent message requests](/reference/idempotent-notification-requests).","uniqueKey":"oneOf.0.external_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.external_id","typeLabel":"string | null"},"errors":{"type":"object","description":"Per-channel listings of invalid identifiers in the request. Only emitted when at least one identifier in the request failed validation. Each listed key is optional; the keys present depend on the channel and request.","properties":{"invalid_phone_numbers":{"type":"array","items":{"type":"string","description":"The listed phone numbers used in the `include_phone_numbers` parameter that were unsubscribed from the message channel before the message was sent.","uniqueKey":"oneOf.0.errors.invalid_phone_numbers.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.errors.invalid_phone_numbers","typeLabel":"string[]"},"invalid_aliases":{"type":"object","description":"The alias label that was used in the `include_aliases` parameter.","properties":{"external_id":{"type":"array","items":{"type":"string","description":"The alias IDs associated with the unsubscribed Subscriptions. The Subscriptions associated with the listed aliases were unsubscribed before the message was sent. In this example, `user_id_1` has two unsubscribed Subscriptions while `user_id_2` has one unsubscribed Subscription.","example":"[\"user_id_1\", \"user_id_1\", \"user_id_2\"]","uniqueKey":"oneOf.0.errors.invalid_aliases.external_id.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.errors.invalid_aliases.external_id","typeLabel":"string[]"},"onesignal_id":{"type":"array","items":{"type":"string","description":"The OneSignal ID associated with the unsubscribed Subscription. The Subscriptions associated with the listed OneSignal IDs were unsubscribed before the message was sent. In this example, the user with OneSignal ID `1589641e-bed1-4325-bce4-d2234e578884` has three unsubscribed Subscriptions.","example":"[\"1589641e-bed1-4325-bce4-d2234e578884\", \"1589641e-bed1-4325-bce4-d2234e578884\", \"1589641e-bed1-4325-bce4-d2234e578884\"]","uniqueKey":"oneOf.0.errors.invalid_aliases.onesignal_id.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.errors.invalid_aliases.onesignal_id","typeLabel":"string[]"}},"uniqueKey":"oneOf.0.errors.invalid_aliases","typeLabel":"object"},"invalid_player_ids":{"type":"array","items":{"type":"string","description":"The Subscription ID exists in the OneSignal app but is unsubscribed from the message channel. If the Subscription ID did not exist, it will not be reported.","uniqueKey":"oneOf.0.errors.invalid_player_ids.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.errors.invalid_player_ids","typeLabel":"string[]"}},"uniqueKey":"oneOf.0.errors","typeLabel":"object"},"warnings":{"oneOf":[{"type":"object","description":"Non-fatal warnings emitted alongside a successful send.","properties":{"invalid_external_user_ids":{"type":"string","description":"external_ids whose subscriptions are unsubscribed.","uniqueKey":"oneOf.0.warnings.oneOf.0.invalid_external_user_ids","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.0.warnings.oneOf.0","typeLabel":"object"},{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.warnings.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"Non-fatal warnings emitted alongside a successful send.","uniqueKey":"oneOf.0.warnings.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"oneOf.0.warnings","typeLabel":"object | string[]"}},"uniqueKey":"oneOf.0","typeLabel":"Message Sent · object"},{"type":"object","title":"Message Not Sent","description":"Two variants are possible with HTTP 200, distinguished by the `id` field: a UUID indicates the message was accepted and dispatched (Message Sent); an empty string indicates the request was valid but no subscribers matched (Message Not Sent). Inspect `errors` when `id` is empty.","required":["id","errors"],"properties":{"id":{"type":"string","description":"If the message `id` is an empty string, then no message was sent. The request appears to be formatted correctly, but there are issues with the aliases, segments, or filters targeted.","example":"","enum":[""],"isRequired":true,"uniqueKey":"oneOf.1.id","typeLabel":"enum\u003cstring>"},"errors":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.1.errors.items.[INDEX]","typeLabel":"string"},"description":"Reasons the message was not dispatched. The most common value is `\"All included players are not subscribed\"`, which means every subscription matched by the segments/aliases/filters was unsubscribed before send time. Per-channel sentinels (e.g., invalid identifiers) may also appear.","example":["All included players are not subscribed"],"isRequired":true,"uniqueKey":"oneOf.1.errors","typeLabel":"string[]"},"warnings":{"oneOf":[{"type":"object","description":"Non-fatal warnings emitted alongside a successful send.","properties":{"invalid_external_user_ids":{"type":"string","description":"external_ids whose subscriptions are unsubscribed.","uniqueKey":"oneOf.1.warnings.oneOf.0.invalid_external_user_ids","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.1.warnings.oneOf.0","typeLabel":"object"},{"type":"array","items":{"type":"string","uniqueKey":"oneOf.1.warnings.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"Non-fatal warnings emitted alongside a successful send.","uniqueKey":"oneOf.1.warnings.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"oneOf.1.warnings","typeLabel":"object | string[]"}},"uniqueKey":"oneOf.1","typeLabel":"Message Not Sent · object"}],"uniqueKey":"","typeLabel":"Message Sent · object | Message Not Sent · object"},"examples":{"Example":{"title":"Example","value":{"id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","external_id":"\u003cstring>","errors":{"invalid_phone_numbers":["\u003cstring>"],"invalid_aliases":{"external_id":["[\"user_id_1\", \"user_id_1\", \"user_id_2\"]"],"onesignal_id":["[\"1589641e-bed1-4325-bce4-d2234e578884\", \"1589641e-bed1-4325-bce4-d2234e578884\", \"1589641e-bed1-4325-bce4-d2234e578884\"]"]},"invalid_player_ids":["\u003cstring>"]},"warnings":{"invalid_external_user_ids":"\u003cstring>"}}}},"exampleType":"generated"}},"headers":{"Idempotent-Replayed":{"description":"Present and set to `true` when this response is a replay of a previous successful request that used the same `idempotency_key`. Absent on fresh executions. Use this to distinguish \"new send\" from \"deduplicated retry\" without inspecting the body.","schema":{"type":"boolean","enum":[true]}}},"exampleType":"generated"},"6da146c8-3e43-452f-be46-fa1cb262bc59":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","description":"The reason for the bad request.","items":{"properties":{"Message Notifications must have English language content":{"type":"string","description":"Make sure the request or template has English language ('en')content. This is required but can be any language desired.","uniqueKey":"errors.items.[INDEX].Message Notifications must have English language content","typeLabel":"string"},"Incorrect subscription_id format in include_subscription_ids (not a valid UUID):":{"type":"string","description":"The provided `subscription_id` is not a valid UUID.","uniqueKey":"errors.items.[INDEX].Incorrect subscription_id format in include_subscription_ids (not a valid UUID):","typeLabel":"string"},"Platforms You may only send to one delivery channel at a time. Make sure you are only including one of push platforms, Email, or SMS.":{"type":"string","description":"You are attempting to send a message to a Subscription for a different channel. Make sure you are only targeting one channel at a time.","uniqueKey":"errors.items.[INDEX].Platforms You may only send to one delivery channel at a time\\. Make sure you are only including one of push platforms, Email, or SMS\\.","typeLabel":"string"}},"type":"object","uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"errors":[{"Message Notifications must have English language content":"\u003cstring>","Incorrect subscription_id format in include_subscription_ids (not a valid UUID):":"\u003cstring>","Platforms You may only send to one delivery channel at a time. Make sure you are only including one of push platforms, Email, or SMS.":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"2374e154-1ffa-4262-8ac5-edd9b76ca80b":{"description":"Forbidden. The Authorization key cannot send SMS for this app, or the request targets a feature the app's plan does not enable.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"description":"One or more human-readable error messages.","uniqueKey":"errors","typeLabel":"string[]"},"success":{"type":"boolean","description":"Present (and `false`) on some endpoints (notifications, templates, segments). Not emitted by every endpoint.","uniqueKey":"success","typeLabel":"boolean"},"reference":{"type":"array","items":{"type":"string","uniqueKey":"reference.items.[INDEX]","typeLabel":"string"},"description":"Documentation URL fragments related to the error. Only emitted by the API-key auth error helpers.","uniqueKey":"reference","typeLabel":"string[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":["This API is not available for applications on your plan."]},"examples":{"Example":{"title":"Example","value":{"errors":["This API is not available for applications on your plan."]}}},"exampleType":"examples"}},"exampleType":"examples"},"1de5e565-4fe3-4c05-b915-0e3791848d81":{"description":"Rate limit exceeded. Wait the number of seconds in the `Retry-After` header before retrying.","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying the request. Always emitted on 429 responses.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"description":"One or more human-readable error messages.","uniqueKey":"errors","typeLabel":"string[]"},"success":{"type":"boolean","description":"Present (and `false`) on some endpoints (notifications, templates, segments). Not emitted by every endpoint.","uniqueKey":"success","typeLabel":"boolean"},"reference":{"type":"array","items":{"type":"string","uniqueKey":"reference.items.[INDEX]","typeLabel":"string"},"description":"Documentation URL fragments related to the error. Only emitted by the API-key auth error helpers.","uniqueKey":"reference","typeLabel":"string[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":["API rate limit exceeded"]},"examples":{"Example":{"title":"Example","value":{"errors":["API rate limit exceeded"]}}},"exampleType":"examples"}},"exampleType":"examples"},"40321a34-d5bc-4c6a-bdd6-d2d20bb604a0":{"description":"Service temporarily unavailable. Retry after a short backoff. The body may be empty or non-JSON in some failure modes.","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying the request. This header is optional and may be absent when a proxy or load balancer generates the 503.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"description":"One or more human-readable error messages.","uniqueKey":"errors","typeLabel":"string[]"},"success":{"type":"boolean","description":"Present (and `false`) on some endpoints (notifications, templates, segments). Not emitted by every endpoint.","uniqueKey":"success","typeLabel":"boolean"},"reference":{"type":"array","items":{"type":"string","uniqueKey":"reference.items.[INDEX]","typeLabel":"string"},"description":"Documentation URL fragments related to the error. Only emitted by the API-key auth error helpers.","uniqueKey":"reference","typeLabel":"string[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":["Service temporarily unavailable"]},"examples":{"Example":{"title":"Example","value":{"errors":["Service temporarily unavailable"]}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"c673d826-9e50-44e7-be1a-14cb91ce6281":{}},"servers":{"cf753503-cc1a-4f14-8e18-590f517b52c4":{"url":"https://api.onesignal.com"}}},"originalFileLocation":"openapi.json"},"subdomain":"onesignal","siteName":"OneSignal","title":"SMS - OneSignal","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/reference/sms","matchLevel":0},"cn":{"href":"/reference/sms","matchLevel":0},"ko":{"href":"/reference/sms","matchLevel":0},"ja":{"href":"/reference/sms","matchLevel":0},"tr":{"href":"/reference/sms","matchLevel":0},"pt-BR":{"href":"/reference/sms","matchLevel":0},"es":{"href":"/reference/sms","matchLevel":0},"fr":{"href":"/reference/sms","matchLevel":0}}},"lastModified":"2026-01-28T10:02:07.036Z","originalFileLocation":"reference/sms.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Send a message using the SMS channel.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OneSignal\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SMS - OneSignal\">\u003cmeta data-mint-head property=\"og:description\" content=\"Send a message using the SMS channel.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OneSignal\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://documentation.onesignal.com/reference/sms\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://onesignal.mintlify.app/_mintlify/api/og/v2?division=Messages\u0026amp;title=SMS\u0026amp;description=Send+a+message+using+the+SMS+channel.\u0026amp;theme=8d648f04f85028b307bd669b\u0026amp;signature=e21857a93c507507bb742f71b0e609fe00e6359258a2261d476de9205ba53edc\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SMS - OneSignal\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Send a message using the SMS channel.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://onesignal.mintlify.app/_mintlify/api/og/v2?division=Messages\u0026amp;title=SMS\u0026amp;description=Send+a+message+using+the+SMS+channel.\u0026amp;theme=8d648f04f85028b307bd669b\u0026amp;signature=e21857a93c507507bb742f71b0e609fe00e6359258a2261d476de9205ba53edc\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"OneSignal Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3A3DB3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://documentation.onesignal.com/reference/sms\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/sms.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://documentation.onesignal.com/#organization\",\"name\":\"OneSignal\",\"url\":\"https://documentation.onesignal.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/onesignal/yJcueeDCO7UpHnnY/logo/OneSignal-Logo.svg?fit=max\u0026auto=format\u0026n=yJcueeDCO7UpHnnY\u0026q=85\u0026s=1fcfb6fef6d820fd9d99c74850711107\"}},{\"@type\":\"WebSite\",\"@id\":\"https://documentation.onesignal.com#website\",\"name\":\"OneSignal\",\"url\":\"https://documentation.onesignal.com\",\"publisher\":{\"@id\":\"https://documentation.onesignal.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://documentation.onesignal.com/reference/sms#webpage\",\"url\":\"https://documentation.onesignal.com/reference/sms\",\"name\":\"SMS\",\"description\":\"Send a message using the SMS channel.\",\"dateModified\":\"2026-01-28T10:02:07.036Z\",\"isPartOf\":{\"@id\":\"https://documentation.onesignal.com#website\"},\"breadcrumb\":{\"@id\":\"https://documentation.onesignal.com/reference/sms#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://documentation.onesignal.com/reference/sms#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API reference\",\"item\":\"https://documentation.onesignal.com/reference/create-message\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Messages\",\"item\":\"https://documentation.onesignal.com/reference/create-message\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SMS\",\"item\":\"https://documentation.onesignal.com/reference/sms\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://documentation.onesignal.com/reference/sms#apireference\",\"headline\":\"SMS\",\"name\":\"SMS\",\"description\":\"Send a message using the SMS channel.\",\"url\":\"https://documentation.onesignal.com/reference/sms\",\"mainEntityOfPage\":{\"@id\":\"https://documentation.onesignal.com/reference/sms#webpage\"},\"dateModified\":\"2026-01-28T10:02:07.036Z\",\"publisher\":{\"@id\":\"https://documentation.onesignal.com/#organization\"},\"isPartOf\":{\"@id\":\"https://documentation.onesignal.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"OneSignal\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"OneSignal","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/docs/en/home"}]},{"tab":"User Guides","pages":[{"title":"User Guides","href":"/docs/en/quickstart-guide"}]},{"tab":"Developer Guides","pages":[{"title":"Developer Guides","href":"/docs/en/developers"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/docs/en/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Server SDK reference","href":"/docs/en/server-sdk-reference"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Organization","pages":[{"title":"List audit logs","openapi":"GET /organizations/{organization_id}/audit_logs","href":"/reference/list-audit-logs"},{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"},{"title":"Email reputation statistics","openapi":"GET /apps/{app_id}/email_analytics/delivery_metrics","href":"/reference/delivery-metrics"},{"title":"Email provider metrics","openapi":"GET /apps/{app_id}/email_analytics/provider_metrics","href":"/reference/provider-metrics"},{"title":"Email provider metrics timeseries","openapi":"GET /apps/{app_id}/email_analytics/provider_metrics_timeseries","href":"/reference/provider-metrics-timeseries"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]},{"tab":"Customer Success Hub","pages":[{"title":"Customer Success Hub","href":"/docs/en/customer-success-hub"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"cn","tabs":[{"tab":"主页","pages":[{"title":"主页","href":"/docs/cn/home"}]},{"tab":"用户指南","pages":[{"title":"用户指南","href":"/docs/cn/quickstart-guide"}]},{"tab":"开发者指南","pages":[{"title":"开发者指南","href":"/docs/cn/developers"}]},{"tab":"教程","pages":[{"title":"教程","href":"/docs/cn/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API Reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"服务器 SDK 参考","href":"/docs/cn/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"ko","tabs":[{"tab":"홈","pages":[{"title":"홈","href":"/docs/ko/home"}]},{"tab":"사용자 가이드","pages":[{"title":"사용자 가이드","href":"/docs/ko/quickstart-guide"}]},{"tab":"개발자 가이드","pages":[{"title":"개발자 가이드","href":"/docs/ko/developers"}]},{"tab":"튜토리얼","pages":[{"title":"튜토리얼","href":"/docs/ko/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"Server SDK 참조","href":"/docs/ko/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"ja","tabs":[{"tab":"ホームページ","pages":[{"title":"ホームページ","href":"/docs/ja/home"}]},{"tab":"ユーザーガイド","pages":[{"title":"ユーザーガイド","href":"/docs/ja/quickstart-guide"}]},{"tab":"開発者ガイド","pages":[{"title":"開発者ガイド","href":"/docs/ja/developers"}]},{"tab":"チュートリアル","pages":[{"title":"チュートリアル","href":"/docs/ja/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"Server SDK reference","href":"/docs/en/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"tr","tabs":[{"tab":"Ana Sayfa","pages":[{"title":"Ana Sayfa","href":"/docs/tr/home"}]},{"tab":"Kullanıcı Kılavuzları","pages":[{"title":"Kullanıcı Kılavuzları","href":"/docs/tr/quickstart-guide"}]},{"tab":"Geliştirici Kılavuzları","pages":[{"title":"Geliştirici Kılavuzları","href":"/docs/tr/developers"}]},{"tab":"Eğitimler","pages":[{"title":"Eğitimler","href":"/docs/tr/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"Server SDK reference","href":"/docs/en/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"pt-BR","tabs":[{"tab":"Início","pages":[{"title":"Início","href":"/docs/pt-BR/home"}]},{"tab":"Guia do Usuário","pages":[{"title":"Guia do Usuário","href":"/docs/pt-BR/quickstart-guide"}]},{"tab":"Guia de desenvolvedor","pages":[{"title":"Guia de desenvolvedor","href":"/docs/pt-BR/developers"}]},{"tab":"Tutoriais","pages":[{"title":"Tutoriais","href":"/docs/pt-BR/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"Referência do SDK do Servidor","href":"/docs/pt-BR/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"es","tabs":[{"tab":"Inicio","pages":[{"title":"Inicio","href":"/docs/es/home"}]},{"tab":"Guías del Usuario","pages":[{"title":"Guías del Usuario","href":"/docs/es/quickstart-guide"}]},{"tab":"Guías del desarrollador","pages":[{"title":"Guías del desarrollador","href":"/docs/es/developers"}]},{"tab":"Tutoriales","pages":[{"title":"Tutoriales","href":"/docs/es/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"Server SDK reference","href":"/docs/en/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"fr","tabs":[{"tab":"Accueil","pages":[{"title":"Accueil","href":"/docs/fr/home"}]},{"tab":"Guides utilisateur","pages":[{"title":"Guides utilisateur","href":"/docs/fr/quickstart-guide"}]},{"tab":"Guides développeur","pages":[{"title":"Guides développeur","href":"/docs/fr/developers"}]},{"tab":"Tutoriels","pages":[{"title":"Tutoriels","href":"/docs/fr/tutorials"}]},{"tab":"API Reference","groups":[{"group":"Using the REST APIs","pages":[{"title":"REST API overview","href":"/reference/rest-api-overview"},{"title":"Rate limits and error handling","href":"/reference/rate-limits"}]},{"group":"API reference","pages":[{"group":"Messages","pages":[{"title":"Sending messages with the OneSignal API","href":"/reference/create-message"},{"title":"Idempotent API requests","href":"/reference/idempotent-notification-requests"},{"title":"Push notification","openapi":"POST /notifications?c=push","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","description":"View the details of a single message and the Outcomes associated with it.","href":"/reference/view-message"},{"title":"View messages","openapi":"GET /notifications?app_id={app_id}\u0026limit={limit}\u0026offset={offset}\u0026kind={kind}\u0026template_id={template_id}\u0026time_offset={time_offset}","href":"/reference/view-messages"},{"title":"Cancel message","openapi":"DELETE /notifications/{message_id}?app_id={app_id}","href":"/reference/cancel-message"},{"title":"Message history","openapi":"POST /notifications/{message_id}/history","href":"/reference/message-history"},{"title":"Estimated recipients","openapi":"POST /notifications/count-unsaved","href":"/reference/count-unsaved"}]},{"group":"Live Activities","pages":[{"title":"Start Live Activity","openapi":"POST /apps/{app_id}/activities/activity/{activity_type}","href":"/reference/start-live-activity"},{"title":"Update Live Activity","openapi":"POST /apps/{app_id}/live_activities/{activity_id}/notifications","href":"/reference/update-live-activity-api"}]},{"group":"Custom Events","pages":[{"title":"Create custom events","openapi":"POST /apps/{app_id}/custom_events","href":"/reference/create-custom-events"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /apps/{app_id}/users","href":"/reference/create-user"},{"title":"View user","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/view-user"},{"title":"Update user","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/update-user"},{"title":"Delete user","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}","href":"/reference/delete-user"},{"title":"View user identity","openapi":"GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/fetch-aliases"},{"title":"View user identity (by subscription)","openapi":"GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/fetch-identity-by-subscription"},{"title":"Create or update alias","openapi":"PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity","href":"/reference/create-alias"},{"title":"Create alias (by subscription)","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity","href":"/reference/create-alias-by-subscription"},{"title":"Delete alias","openapi":"DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}","href":"/reference/delete-alias"}]},{"group":"Subscriptions","pages":[{"title":"Create Subscription by alias","openapi":"POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions","href":"/reference/create-subscription"},{"title":"Update Subscription by ID","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/update-subscription"},{"title":"Update Subscription by token","openapi":"PATCH /apps/{app_id}/subscriptions_by_token/{token_type}/{token}","href":"/reference/update-subscription-by-token"},{"title":"Delete Subscription","openapi":"DELETE /apps/{app_id}/subscriptions/{subscription_id}","href":"/reference/delete-subscription"},{"title":"Transfer Subscription","openapi":"PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner","href":"/reference/transfer-subscription"},{"title":"Unsubscribe email with token","openapi":"POST /apps/{app_id}/notifications/{notification_id}/unsubscribe?token={token}","href":"/reference/unsubscribe-with-token"}]},{"group":"Templates","pages":[{"title":"Create template","openapi":"POST /templates","href":"/reference/create-template"},{"title":"Update template","openapi":"PATCH /templates/{template_id}?app_id={app_id}","href":"/reference/update-template"},{"title":"View templates","openapi":"GET /templates?app_id={app_id}\u0026limit={limit}\u0026offset={offset}","href":"/reference/view-templates"},{"title":"View template","openapi":"GET /templates/{template_id}?app_id={app_id}","href":"/reference/view-template"},{"title":"Delete template","openapi":"DELETE /templates/{template_id}?app_id={app_id}","href":"/reference/delete-template"},{"title":"Copy template to another app","openapi":"POST /templates/{template_id}/copy_to_app?app_id={app_id}","href":"/reference/copy-template-to-another-app"}]},{"group":"Segments","pages":[{"title":"View segments","openapi":"GET /apps/{app_id}/segments","href":"/reference/view-segments"},{"title":"View segment","openapi":"GET /apps/{app_id}/segments/{segment_id}","href":"/reference/view-segment"},{"title":"Create segment","openapi":"POST /apps/{app_id}/segments","href":"/reference/create-segments"},{"title":"Update segment","openapi":"PATCH /apps/{app_id}/segments/{segment_id}","href":"/reference/update-segment"},{"title":"Delete segment","openapi":"DELETE /apps/{app_id}/segments/{segment_id}","href":"/reference/delete-segments"}]},{"group":"Journeys","pages":[{"title":"View journeys","tag":"BETA","openapi":"GET /apps/{app_id}/journeys","href":"/reference/view-journeys"},{"title":"View journey","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}","href":"/reference/view-journey"},{"title":"View journey stats","tag":"BETA","openapi":"GET /apps/{app_id}/journeys/{id}/stats","href":"/reference/view-journey-stats"},{"title":"Create journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys","href":"/reference/create-journey"},{"title":"Duplicate journey","tag":"BETA","openapi":"POST /apps/{app_id}/journeys/{id}/duplicate","href":"/reference/duplicate-journey"},{"title":"Update journey","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}","href":"/reference/update-journey"},{"title":"Update journey node","tag":"BETA","openapi":"PATCH /apps/{app_id}/journeys/{id}/nodes/{node_id}","href":"/reference/update-journey-node"},{"title":"Delete journey","tag":"BETA","openapi":"DELETE /apps/{app_id}/journeys/{id}","href":"/reference/delete-journey"}]},{"group":"Configuration","pages":[{"title":"View apps","openapi":"GET /apps","href":"/reference/view-apps"},{"title":"View an app","openapi":"GET /apps/{app_id}","href":"/reference/view-an-app"},{"title":"Create an app","openapi":"POST /apps","href":"/reference/create-an-app"},{"title":"Update an app","openapi":"PUT /apps/{app_id}","href":"/reference/update-an-app"},{"title":"View API keys","openapi":"GET /apps/{app_id}/auth/tokens","href":"/reference/view-api-keys"},{"title":"Create API key","openapi":"POST /apps/{app_id}/auth/tokens","href":"/reference/create-api-key"},{"title":"Delete API key","openapi":"DELETE /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/delete-api-key"},{"title":"Update API key","openapi":"PATCH /apps/{app_id}/auth/tokens/{token_id}","href":"/reference/update-api-key"},{"title":"Rotate API key","openapi":"POST /apps/{app_id}/auth/tokens/{token_id}/rotate","href":"/reference/rotate-api-key"}]},{"group":"Analytics","pages":[{"title":"Export subscriptions CSV","openapi":"POST /players/csv_export","href":"/reference/csv-export"},{"title":"Export audience activity CSV","openapi":"POST /notifications/{message_id}/export_events","href":"/reference/export-csv-of-events"},{"title":"View outcomes","openapi":"GET /apps/{app_id}/outcomes?outcome_names={outcome_names}\u0026outcome_time_range={outcome_time_range}\u0026outcome_platforms={outcome_platforms}\u0026outcome_attribution={outcome_attribution}","href":"/reference/view-outcomes"}]},{"group":"Deprecated","pages":[{"title":"View players","deprecated":true,"href":"/reference/view-devices"},{"title":"View player","deprecated":true,"href":"/reference/view-device"},{"title":"Add a player","deprecated":true,"href":"/reference/add-a-device"},{"title":"Edit player","deprecated":true,"href":"/reference/edit-device"},{"title":"Edit tags with external user id","deprecated":true,"href":"/reference/edit-tags-with-external-user-id"},{"title":"Delete player record","deprecated":true,"href":"/reference/delete-user-record"}]}]},{"group":"SDKs","pages":[{"title":"Référence du SDK Serveur","href":"/docs/fr/server-sdk-reference"}]}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}}]},"basePath":"","title":"SMS - OneSignal","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B7XKH4J3.js","utils-lOYzL7z-.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DF6jUUIM.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dpsj5f7C.js","snippetPresets-CYeiDe8v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CUFz1YZ_.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D8H_iLS4.js","shallow-DdluZBHX.js","getApiPlaygroundDisplay-B9922vev.js","CodeSnippet-CMoRNGYs.js","CodeSnippets-DwyrPHuw.js","Page-DSVu9Ucl.js","getPastedJson-G-zIvlHh.js","icon-B03fnEy0.js","MethodPill-CW7teklc.js","DuplicateIcon-CtO8eekd.js","createIcon-DZTKdM_A.js","DynamicMarkdown-D5M2At0B.js","SectionHeading-C_2NaA2U.js","axios-vUo_bRtp.js","Markdown-D7QRHV3m.js","clsx-D1Z-ELXV.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-lvhuD9Du.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CKfC4ywL.js"]}