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.email_subject = 'Welcome to OneSignal';
notification.email_body = '<h1>Hello!</h1><p>Thanks for signing up.</p>';
// 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 = 'email';
// 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.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',
email_subject='Welcome to OneSignal',
email_body='<h1>Hello!</h1><p>Thanks for signing up.</p>',
include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},
target_channel='email',
# 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');
$notification->setEmailSubject('Welcome to OneSignal');
$notification->setEmailBody('<h1>Hello!</h1><p>Thanks for signing up.</p>');
$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);
$notification->setTargetChannel('email');
// 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")
notification.SetEmailSubject("Welcome to OneSignal")
notification.SetEmailBody("<h1>Hello!</h1><p>Thanks for signing up.</p>")
notification.SetIncludeAliases(map[string][]string{"external_id": {"YOUR_USER_EXTERNAL_ID"}})
notification.SetTargetChannel("email")
// 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.email_subject = 'Welcome to OneSignal'
notification.email_body = '<h1>Hello!</h1><p>Thanks for signing up.</p>'
notification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }
notification.target_channel = 'email'
# 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");
notification.setEmailSubject("Welcome to OneSignal");
notification.setEmailBody("<h1>Hello!</h1><p>Thanks for signing up.</p>");
Map<String, List<String>> aliases = new HashMap<>();
aliases.put("external_id", Arrays.asList("YOUR_USER_EXTERNAL_ID"));
notification.setIncludeAliases(aliases);
notification.setTargetChannel(Notification.TargetChannelEnum.EMAIL);
// 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",
EmailSubject = "Welcome to OneSignal",
EmailBody = "<h1>Hello!</h1><p>Thanks for signing up.</p>",
IncludeAliases = new Dictionary<string, List<string>>
{
{ "external_id", new List<string> { "YOUR_USER_EXTERNAL_ID" } }
},
TargetChannel = Notification.TargetChannelEnum.Email,
// 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::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.email_subject = Some("Welcome to OneSignal".to_string());
notification.email_body = Some("<h1>Hello!</h1><p>Thanks for signing up.</p>".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::Email);
// 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.email_subject = 'Welcome to OneSignal';
notification.email_body = '<h1>Hello!</h1><p>Thanks for signing up.</p>';
// 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 = 'email';
// 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.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',
email_subject='Welcome to OneSignal',
email_body='<h1>Hello!</h1><p>Thanks for signing up.</p>',
include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},
target_channel='email',
# 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');
$notification->setEmailSubject('Welcome to OneSignal');
$notification->setEmailBody('<h1>Hello!</h1><p>Thanks for signing up.</p>');
$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);
$notification->setTargetChannel('email');
// 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")
notification.SetEmailSubject("Welcome to OneSignal")
notification.SetEmailBody("<h1>Hello!</h1><p>Thanks for signing up.</p>")
notification.SetIncludeAliases(map[string][]string{"external_id": {"YOUR_USER_EXTERNAL_ID"}})
notification.SetTargetChannel("email")
// 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.email_subject = 'Welcome to OneSignal'
notification.email_body = '<h1>Hello!</h1><p>Thanks for signing up.</p>'
notification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }
notification.target_channel = 'email'
# 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");
notification.setEmailSubject("Welcome to OneSignal");
notification.setEmailBody("<h1>Hello!</h1><p>Thanks for signing up.</p>");
Map<String, List<String>> aliases = new HashMap<>();
aliases.put("external_id", Arrays.asList("YOUR_USER_EXTERNAL_ID"));
notification.setIncludeAliases(aliases);
notification.setTargetChannel(Notification.TargetChannelEnum.EMAIL);
// 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",
EmailSubject = "Welcome to OneSignal",
EmailBody = "<h1>Hello!</h1><p>Thanks for signing up.</p>",
IncludeAliases = new Dictionary<string, List<string>>
{
{ "external_id", new List<string> { "YOUR_USER_EXTERNAL_ID" } }
},
TargetChannel = Notification.TargetChannelEnum.Email,
// 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::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.email_subject = Some("Welcome to OneSignal".to_string());
notification.email_body = Some("<h1>Hello!</h1><p>Thanks for signing up.</p>".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::Email);
// 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 email. See Push notification or SMS to send to those channels.Ensure your Email setup is complete.
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 email to specific users by their email address. Include up to 20,000 email addresses per API call. If the email address does not exist within the OneSignal App, then a new email Subscription will be created. Can only be used when sending Email. 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. 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.
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).
The full email address shown in the 'From' field of the email (e.g., promotions@news.example.com). This is what recipients see as the sender. If not specified, OneSignal uses the default 'Sender Email' set in your Dashboard's Email Settings. See Senders.
The authenticated sending domain used for email delivery. This domain must be verified in your DNS records and will determine which domain handles the mail transfer. It may not always exactly match the domain in the email_from_address (e.g., email_from_address = news@example.com while email_sender_domain = mail.example.com), but the root domain must align for DMARC compliance. If not specified, OneSignal uses the default sender email's domain configured in your Dashboard. See Email setup and Senders.
BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. For every email sent, an additional billable email is sent to each BCC address. See BCC Emails.
Used for important account-related, non-marking emails. If set to true it will send the email to unsubscribed email addresses. Defaults to false. See Email unsubscribe links & headers.
If set to true, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. See Email unsubscribe links & headers. Defaults to false.
Set to warmup to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. Requires email_warm_up. Not compatible with send_after. The campaign will be scheduled to begin at its first stage's start time.
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. Not compatible with kind: "warmup".
Controls how messages are delivered on a per-user basis. timezone sends at the same local time across time zones. last-active delivers based on each user's most recent session. Not compatible with Push Throttling. If you set delayed_option, set throttle_rate_per_minute to 0.
Use with delayed_option: 'timezone' to set a consistent local delivery time. Accepted formats: '9:00AM' (12-hour), '21:45' (24-hour), '09:45:30' (HH:mm:ss).
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 Documentation","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":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aee76d2161a823262d5e93f","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"en","tag":"User Guides","count":203},{"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":"rbac-expansion","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":"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":"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},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"reference/email","slug":"/reference/email","pageMetadata":{"title":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"},"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 email 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`,hr:`hr`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Note}=_components;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 email. See `,_jsx(_components.a,{href:`/reference/push-notification`,children:`Push notification`}),` or `,_jsx(_components.a,{href:`/reference/sms`,children:`SMS`}),` to send to those channels.`]}),`\n`,_jsxs(_components.p,{children:[`Ensure your `,_jsx(_components.a,{href:`/docs/en/email-setup`,children:`Email 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,{})]})}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":"Email","openapi":"POST /notifications?c=email","description":"Send a message using the email channel.","href":"/reference/email"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","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":"Email","description":"Send a message using the email channel.","operationId":"email","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.email_subject = 'Welcome to OneSignal';\nnotification.email_body = '\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>';\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 = 'email';\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.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 email_subject='Welcome to OneSignal',\n email_body='\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>',\n include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},\n target_channel='email',\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$notification->setEmailSubject('Welcome to OneSignal');\n$notification->setEmailBody('\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>');\n$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);\n$notification->setTargetChannel('email');\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 notification.SetEmailSubject(\"Welcome to OneSignal\")\n notification.SetEmailBody(\"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\")\n notification.SetIncludeAliases(map[string][]string{\"external_id\": {\"YOUR_USER_EXTERNAL_ID\"}})\n notification.SetTargetChannel(\"email\")\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.email_subject = 'Welcome to OneSignal'\nnotification.email_body = '\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>'\nnotification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }\nnotification.target_channel = 'email'\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 notification.setEmailSubject(\"Welcome to OneSignal\");\n notification.setEmailBody(\"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\");\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.EMAIL);\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 EmailSubject = \"Welcome to OneSignal\",\n EmailBody = \"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\",\n IncludeAliases = new Dictionary\u003cstring, List\u003cstring>>\n {\n { \"external_id\", new List\u003cstring> { \"YOUR_USER_EXTERNAL_ID\" } }\n },\n TargetChannel = Notification.TargetChannelEnum.Email,\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::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.email_subject = Some(\"Welcome to OneSignal\".to_string());\n notification.email_body = Some(\"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\".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::Email);\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":["b3f010a8-9a68-4813-ada4-ec98bed69fb1"],"requestBody":"44acb2fa-a831-4870-b867-69b0a22b83bf","responses":{"200":"71859e22-8ef8-49c5-bcbe-eeef3606efac","400":"6510cbbf-28fa-401d-8aba-d34b15d75343","403":"3d19487c-6f34-4616-aba4-51922a64b0dc","429":"aa582727-df59-4df6-9fd6-24ecdedf6f27","503":"da1defdb-7bcd-4034-8d5b-176f86e7ac52"},"deprecated":false,"method":"post","type":"path","servers":["409091ad-6d30-4df4-9e86-f2a13d67c7b3"],"security":["a15236e2-20f7-4712-b1c5-1a2812fdcec4"],"path":"/notifications?c=email","baseUrlOptions":["https://api.onesignal.com"],"title":"Email","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.email_subject = 'Welcome to OneSignal';\nnotification.email_body = '\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>';\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 = 'email';\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.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 email_subject='Welcome to OneSignal',\n email_body='\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>',\n include_aliases={'external_id': ['YOUR_USER_EXTERNAL_ID']},\n target_channel='email',\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$notification->setEmailSubject('Welcome to OneSignal');\n$notification->setEmailBody('\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>');\n$notification->setIncludeAliases(['external_id' => ['YOUR_USER_EXTERNAL_ID']]);\n$notification->setTargetChannel('email');\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 notification.SetEmailSubject(\"Welcome to OneSignal\")\n notification.SetEmailBody(\"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\")\n notification.SetIncludeAliases(map[string][]string{\"external_id\": {\"YOUR_USER_EXTERNAL_ID\"}})\n notification.SetTargetChannel(\"email\")\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.email_subject = 'Welcome to OneSignal'\nnotification.email_body = '\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>'\nnotification.include_aliases = { 'external_id' => ['YOUR_USER_EXTERNAL_ID'] }\nnotification.target_channel = 'email'\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 notification.setEmailSubject(\"Welcome to OneSignal\");\n notification.setEmailBody(\"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\");\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.EMAIL);\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 EmailSubject = \"Welcome to OneSignal\",\n EmailBody = \"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\",\n IncludeAliases = new Dictionary\u003cstring, List\u003cstring>>\n {\n { \"external_id\", new List\u003cstring> { \"YOUR_USER_EXTERNAL_ID\" } }\n },\n TargetChannel = Notification.TargetChannelEnum.Email,\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::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.email_subject = Some(\"Welcome to OneSignal\".to_string());\n notification.email_body = Some(\"\u003ch1>Hello!\u003c/h1>\u003cp>Thanks for signing up.\u003c/p>\".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::Email);\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":{"b3f010a8-9a68-4813-ada4-ec98bed69fb1":{"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","email_subject","email_body"],"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"},"email_subject":{"type":"string","description":"The subject of the email. Supports [Message Personalization](/docs/en/message-personalization).","default":"This is your email subject.","isRequired":true,"uniqueKey":"email_subject","typeLabel":"string"},"email_body":{"type":"string","description":"The body of the email in HTML format. Required if `template_id` is not set. Supports [Message Personalization](/docs/en/message-personalization).","isRequired":true,"uniqueKey":"email_body","typeLabel":"string"},"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"},"target_channel":{"type":"string","description":"The targeted delivery channel. Required when using `include_aliases`. Accepts `push`, `email`, or `sms`.","enum":["push","email","sms"],"default":"email","uniqueKey":"target_channel","typeLabel":"enum\u003cstring>"},"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[]"},"email_to":{"type":"array","description":"Send email to specific users by their email address. Include up to 20,000 email addresses per API call. If the email address does not exist within the OneSignal App, then a new email Subscription will be created. Can only be used when sending [Email](/reference/email). 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":"email_to.items.[INDEX]","typeLabel":"string"},"uniqueKey":"email_to","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`. 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)[]"},"email_preheader":{"type":"string","description":"Preview text displayed after the email subject.","uniqueKey":"email_preheader","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"},"email_from_name":{"type":"string","description":"The name the email is sent from. Defaults to the 'Sender Name' in the Email Settings of your OneSignal Dashboard. See [Email setup](/docs/en/email-setup) and [Senders](/docs/en/senders).","default":"Your Company","uniqueKey":"email_from_name","typeLabel":"string"},"email_from_address":{"type":"string","description":"The full email address shown in the 'From' field of the email (e.g., `promotions@news.example.com`). This is what recipients see as the sender. If not specified, OneSignal uses the default 'Sender Email' set in your Dashboard's Email Settings. See [Senders](/docs/en/senders).","uniqueKey":"email_from_address","typeLabel":"string"},"email_sender_domain":{"type":"string","description":"The authenticated sending domain used for email delivery. This domain must be verified in your DNS records and will determine which domain handles the mail transfer. It may not always exactly match the domain in the `email_from_address` (e.g., `email_from_address = news@example.com` while `email_sender_domain = mail.example.com`), but the root domain must align for DMARC compliance. If not specified, OneSignal uses the default sender email's domain configured in your Dashboard. See [Email setup](/docs/en/email-setup) and [Senders](/docs/en/senders).","uniqueKey":"email_sender_domain","typeLabel":"string"},"email_reply_to_address":{"type":"string","description":"The email address users reply to. Defaults to the 'Reply-To' address in the Email Settings of your OneSignal Dashboard. See [Email setup](/docs/en/email-setup).","uniqueKey":"email_reply_to_address","typeLabel":"string"},"email_bcc":{"type":"array","description":"BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. For every email sent, an additional billable email is sent to each BCC address. See [BCC Emails](/docs/en/email-bcc).","items":{"type":"string","uniqueKey":"email_bcc.items.[INDEX]","typeLabel":"string"},"uniqueKey":"email_bcc","typeLabel":"string[]"},"include_unsubscribed":{"type":"boolean","description":"Used for important account-related, non-marking emails. If set to `true` it will send the email to unsubscribed email addresses. Defaults to `false`. See [Email unsubscribe links \u0026 headers](/docs/en/unsubscribe-links-email-subscriptions).","uniqueKey":"include_unsubscribed","typeLabel":"boolean"},"disable_email_click_tracking":{"type":"boolean","description":"If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. See [Email unsubscribe links \u0026 headers](/docs/en/unsubscribe-links-email-subscriptions). Defaults to `false`.","uniqueKey":"disable_email_click_tracking","typeLabel":"boolean"},"kind":{"type":"string","enum":["warmup"],"description":"Set to `warmup` to send this as an [Auto Warm Up](/docs/en/email-warm-up) campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. Requires `email_warm_up`. Not compatible with `send_after`. The campaign will be scheduled to begin at its first stage's `start` time.","uniqueKey":"kind","typeLabel":"enum\u003cstring>"},"email_warm_up":{"type":"object","description":"Required when `kind` is `warmup`. The gradual sending schedule for the campaign. See [Auto Warm Up](/docs/en/email-warm-up).","properties":{"stages":{"type":"array","description":"The ordered stages that make up the sending schedule.","items":{"type":"object","required":["start","end","quota"],"properties":{"start":{"type":"string","description":"ISO 8601 timestamp for the start of this stage. Sending for this stage will not begin before this time.","isRequired":true,"uniqueKey":"email_warm_up.stages.items.[INDEX].start","typeLabel":"string"},"end":{"type":"string","description":"ISO 8601 timestamp for the end of this stage. This stage's quota is expected to be sent by this time.","isRequired":true,"uniqueKey":"email_warm_up.stages.items.[INDEX].end","typeLabel":"string"},"quota":{"type":"integer","description":"Number of emails to send during this stage.","isRequired":true,"uniqueKey":"email_warm_up.stages.items.[INDEX].quota","typeLabel":"integer"}},"uniqueKey":"email_warm_up.stages.items.[INDEX]","typeLabel":"object"},"uniqueKey":"email_warm_up.stages","typeLabel":"object[]"},"strategy":{"type":"string","enum":["recommended","custom"],"description":"`recommended` (default) lets OneSignal adjust the provided stages based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. `custom` sends the provided stages as-is.","uniqueKey":"email_warm_up.strategy","typeLabel":"enum\u003cstring>"}},"uniqueKey":"email_warm_up","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`. Not compatible with `kind: \"warmup\"`.","uniqueKey":"send_after","typeLabel":"string"},"delayed_option":{"type":"string","description":"Controls how messages are delivered on a per-user basis. `timezone` sends at the same local time across time zones. `last-active` delivers based on each user's most recent session. Not compatible with [Push Throttling](/docs/en/throttling). If you set `delayed_option`, set `throttle_rate_per_minute` to `0`.","uniqueKey":"delayed_option","typeLabel":"string"},"delivery_time_of_day":{"type":"string","description":"Use with `delayed_option: 'timezone'` to set a consistent local delivery time. Accepted formats: `'9:00AM'` (12-hour), `'21:45'` (24-hour), `'09:45:30'` (HH:mm:ss).","uniqueKey":"delivery_time_of_day","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","email_subject":"This is your email subject.","email_body":"\u003cstring>","include_aliases":{"external_id":["\u003cstring>"]},"target_channel":"email","include_subscription_ids":["\u003cstring>"],"email_to":["\u003cstring>"],"included_segments":["\u003cstring>"],"excluded_segments":["\u003cstring>"],"filters":[{"key":"\u003cstring>","value":"\u003cstring>"}],"email_preheader":"\u003cstring>","name":"\u003cstring>","template_id":"\u003cstring>","custom_data":{},"email_from_name":"Your Company","email_from_address":"\u003cstring>","email_sender_domain":"\u003cstring>","email_reply_to_address":"\u003cstring>","email_bcc":["\u003cstring>"],"include_unsubscribed":true,"disable_email_click_tracking":true,"kind":"warmup","email_warm_up":{"stages":[{"start":"\u003cstring>","end":"\u003cstring>","quota":123}]},"send_after":"\u003cstring>","delayed_option":"\u003cstring>","delivery_time_of_day":"\u003cstring>","idempotency_key":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"71859e22-8ef8-49c5-bcbe-eeef3606efac":{"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_email_tokens":{"type":"array","items":{"type":"string","description":"The email addresses from the `email_to` parameter that were excluded from this send, either because the email address is not correctly formatted or because the email subscription was unsubscribed from the email message channel before the message was sent. This endpoint checks address format only. See [Email address validation](/docs/en/email-address-validation) for the typo, MX record, role-based, and disposable domain checks, which run only during CSV import and bulk validation.","uniqueKey":"oneOf.0.errors.invalid_email_tokens.items.[INDEX]","typeLabel":"string"},"uniqueKey":"oneOf.0.errors.invalid_email_tokens","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 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 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_email_tokens":["\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"},"6510cbbf-28fa-401d-8aba-d34b15d75343":{"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"},"3d19487c-6f34-4616-aba4-51922a64b0dc":{"description":"Forbidden. The Authorization key cannot send email 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"},"aa582727-df59-4df6-9fd6-24ecdedf6f27":{"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"},"da1defdb-7bcd-4034-8d5b-176f86e7ac52":{"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":{"a15236e2-20f7-4712-b1c5-1a2812fdcec4":{}},"servers":{"409091ad-6d30-4df4-9e86-f2a13d67c7b3":{"url":"https://api.onesignal.com"}}},"originalFileLocation":"openapi.json"},"subdomain":"onesignal","siteName":"OneSignal Documentation","title":"Email - OneSignal Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/reference/email","matchLevel":0},"cn":{"href":"/reference/email","matchLevel":0},"ko":{"href":"/reference/email","matchLevel":0},"ja":{"href":"/reference/email","matchLevel":0},"tr":{"href":"/reference/email","matchLevel":0},"pt-BR":{"href":"/reference/email","matchLevel":0},"es":{"href":"/reference/email","matchLevel":0},"fr":{"href":"/reference/email","matchLevel":0}}},"lastModified":"2026-01-28T10:02:07.014Z","originalFileLocation":"reference/email.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 email channel.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OneSignal Documentation\">\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=\"Email - OneSignal Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Send a message using the email channel.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OneSignal Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://documentation.onesignal.com/reference/email\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://onesignal.mintlify.site/_mintlify/api/og/v2?division=Messages\u0026amp;title=Email\u0026amp;description=Send+a+message+using+the+email+channel.\u0026amp;theme=8d648f04f85028b307bd669b\u0026amp;signature=6357b1c8fdb499b2f63ee7133b92c219aec91335253ef7f03ce62ee0be836dd5\">\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=\"Email - OneSignal Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Send a message using the email channel.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://onesignal.mintlify.site/_mintlify/api/og/v2?division=Messages\u0026amp;title=Email\u0026amp;description=Send+a+message+using+the+email+channel.\u0026amp;theme=8d648f04f85028b307bd669b\u0026amp;signature=6357b1c8fdb499b2f63ee7133b92c219aec91335253ef7f03ce62ee0be836dd5\">\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/email\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/email.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://documentation.onesignal.com/#organization\",\"name\":\"OneSignal Documentation\",\"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 Documentation\",\"url\":\"https://documentation.onesignal.com\",\"publisher\":{\"@id\":\"https://documentation.onesignal.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://documentation.onesignal.com/reference/email#webpage\",\"url\":\"https://documentation.onesignal.com/reference/email\",\"name\":\"Email\",\"description\":\"Send a message using the email channel.\",\"dateModified\":\"2026-01-28T10:02:07.014Z\",\"isPartOf\":{\"@id\":\"https://documentation.onesignal.com#website\"},\"breadcrumb\":{\"@id\":\"https://documentation.onesignal.com/reference/email#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://documentation.onesignal.com/reference/email#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\":\"Email\",\"item\":\"https://documentation.onesignal.com/reference/email\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://documentation.onesignal.com/reference/email#apireference\",\"headline\":\"Email\",\"name\":\"Email\",\"description\":\"Send a message using the email channel.\",\"url\":\"https://documentation.onesignal.com/reference/email\",\"mainEntityOfPage\":{\"@id\":\"https://documentation.onesignal.com/reference/email#webpage\"},\"dateModified\":\"2026-01-28T10:02:07.014Z\",\"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 Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"OneSignal Documentation","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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":"Get Journey schema","tag":"BETA","openapi":"GET /journeys/schema","href":"/reference/get-journey-schema"},{"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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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","description":"Send a message using the push notification channel.","href":"/reference/push-notification"},{"title":"Email","openapi":"POST /notifications?c=email","href":"/reference/email"},{"title":"SMS","openapi":"POST /notifications?c=sms","description":"Send a message using the SMS channel.","href":"/reference/sms"},{"title":"View message","openapi":"GET /notifications/{message_id}?app_id={app_id}","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":"Email - OneSignal Documentation","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","Page-Dr40SSJq.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js","Markdown-D_k0dg6k.js","clsx-DK3K4Z1S.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DE3EVdvd.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-fN9H9n9g.js"]}