| [ Web Proxy ] |
| Viewing: https://documentation.onesignal.com/reference/create-user | [Back] [Original] |
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cURL
curl --request POST \
--url https://api.onesignal.com/apps/{app_id}/users \
--header 'Content-Type: application/json' \
--data '
{
"properties": {
"tags": {},
"language": "en",
"timezone_id": "America/Los_Angeles",
"lat": 123,
"long": 123,
"country": "US",
"first_active": 123,
"last_active": 123,
"ip": "<string>",
"test_user_name": "<string>"
},
"identity": {
"external_id": "<string>"
},
"subscriptions": [
{
"token": "<string>",
"enabled": true,
"notification_types": 123,
"session_time": 123,
"session_count": 123,
"app_version": "<string>",
"device_model": "<string>",
"device_os": "<string>",
"test_type": 123,
"sdk": "<string>",
"web_auth": "<string>",
"web_p256": "<string>"
}
]
}
'import Onesignal from '@onesignal/node-onesignal';
const configuration = Onesignal.createConfiguration({
restApiKey: 'YOUR_REST_API_KEY',
});
const apiInstance = new Onesignal.DefaultApi(configuration);
// string
const appId: string = "YOUR_APP_ID";
// User
const user: Onesignal.User = {
properties: {
tags: {},
language: "en",
timezone_id: "America/Los_Angeles",
lat: 3.14,
long: 3.14,
country: "US",
first_active: 1,
last_active: 1,
amount_spent: 3.14,
purchases: [
{
sku: "com.example.coins100",
amount: "0.99",
iso: "USD",
count: 1,
},
],
ip: "203.0.113.10",
},
identity: {
"key": "key_example",
},
subscriptions: [
{
id: "e4e87830-b954-4363-b7bc-1f01dbaee5c8",
type: "iOSPush",
token: "d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7",
enabled: true,
notification_types: 1,
session_time: 60,
session_count: 1,
sdk: "5.2.0",
device_model: "iPhone14,2",
device_os: "17.1",
rooted: true,
test_type: 1,
app_version: "1.0.0",
net_type: 1,
carrier: "Verizon",
web_auth: "5DUmpGmLuTxWCLj5lJpwLQ",
web_p256: "BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A",
},
],
};
try {
const response = await apiInstance.createUser(appId, user);
console.log(response);
} 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("createUser failed: HTTP " + e.code, e.errorMessages);
} else {
throw e;
}
}import onesignal
from onesignal.api import default_api
from onesignal.models import *
from pprint import pprint
# 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
)
# Enter a context with an instance of the API client
with onesignal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = default_api.DefaultApi(api_client)
app_id = "YOUR_APP_ID"
user = User(
properties=PropertiesObject(
tags={},
language="en",
timezone_id="America/Los_Angeles",
lat=3.14,
long=3.14,
country="US",
first_active=1,
last_active=1,
amount_spent=3.14,
purchases=[
Purchase(
sku="com.example.coins100",
amount="0.99",
iso="USD",
count=1,
),
],
ip="203.0.113.10",
),
identity=IdentityObject(
key="key_example",
),
subscriptions=[
Subscription(
id="e4e87830-b954-4363-b7bc-1f01dbaee5c8",
type="iOSPush",
token="d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7",
enabled=True,
notification_types=1,
session_time=60,
session_count=1,
sdk="5.2.0",
device_model="iPhone14,2",
device_os="17.1",
rooted=True,
test_type=1,
app_version="1.0.0",
net_type=1,
carrier="Verizon",
web_auth="5DUmpGmLuTxWCLj5lJpwLQ",
web_p256="BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A",
),
],
)
try:
api_response = api_instance.create_user(app_id, user)
pprint(api_response)
except onesignal.ApiException as e:
print("Exception when calling DefaultApi->create_user: %s\n" % e)
print("Status Code: %s" % e.status)
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(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = 'YOUR_APP_ID'; // string
$user = new \onesignal\client\model\User(); // \onesignal\client\model\User
try {
$result = $apiInstance->createUser($app_id, $user);
print_r($result);
} catch (\onesignal\client\ApiException $e) {
echo 'Exception when calling DefaultApi->createUser: ', $e->getMessage(), PHP_EOL;
echo 'Status Code: ', $e->getCode(), PHP_EOL;
// getErrorMessages() flattens any error-envelope shape to a string[];
// the raw body remains on getResponseBody().
echo 'Error Messages: ', implode(', ', $e->getErrorMessages()), PHP_EOL;
echo 'Response Body: ', $e->getResponseBody(), PHP_EOL;
} catch (\Exception $e) {
echo 'Exception when calling DefaultApi->createUser: ', $e->getMessage(), PHP_EOL;
}package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api/v5"
)
func main() {
appId := "YOUR_APP_ID" // string |
user := *onesignal.NewUser() // User |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
restAuth := context.WithValue(context.Background(), onesignal.RestApiKey, "YOUR_REST_API_KEY") // App REST API key required for most endpoints
resp, r, err := apiClient.DefaultApi.CreateUser(restAuth, appId).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
if apiErr, ok := err.(*onesignal.GenericOpenAPIError); ok {
// ErrorMessages() flattens any error-envelope shape to a []string;
// the raw body remains on Body().
fmt.Fprintf(os.Stderr, "Error Messages: %v\n", apiErr.ErrorMessages())
fmt.Fprintf(os.Stderr, "Response Body: %s\n", apiErr.Body())
}
}
// response from `CreateUser`: User
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateUser`: %v\n", resp)
}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
app_id = 'YOUR_APP_ID' # String |
user = OneSignal::User.new # User |
begin
result = api_instance.create_user(app_id, user)
p result
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->create_user: #{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 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");
// Configure HTTP bearer authorization: rest_api_key
HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
rest_api_key.setBearerToken("YOUR_REST_API_KEY");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String appId = "YOUR_APP_ID"; // String |
User user = new User(); // User |
try {
User result = apiInstance.createUser(appId, user);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#createUser");
System.err.println("Status code: " + e.getCode());
// getErrorMessages() flattens any error-envelope shape to a List<String>;
// the raw body remains on getResponseBody().
System.err.println("Error messages: " + e.getErrorMessages());
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 CreateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.onesignal.com";
// Configure Bearer token for authorization: rest_api_key
config.AccessToken = "YOUR_REST_API_KEY";
var apiInstance = new DefaultApi(config);
var appId = "YOUR_APP_ID"; // string |
var user = new User(); // User |
try
{
User result = apiInstance.CreateUser(appId, user);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.CreateUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
// e.ErrorMessages flattens any error-envelope shape to an IReadOnlyList<string>;
// the raw body remains on e.ErrorContent.
Debug.Print("Error Messages: " + string.Join(", ", e.ErrorMessages));
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;
#[tokio::main]
async fn main() {
let mut configuration = Configuration::new();
configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());
// Realistic values are pulled from the spec's `example:` fields where present.
let app_id: &str = "YOUR_APP_ID";
let user: models::User = todo!();
match default_api::create_user(&configuration, app_id, user).await {
Ok(resp) => println!("{:?}", resp),
Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
// `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
// the raw response remains on the ResponseError variant.
eprintln!("create_user failed: {:?}", e.error_messages());
}
Err(e) => eprintln!("create_user failed: {:?}", e),
}
}{
"identity": {
"onesignal_id": "567491ee-9105-4a87-9cbc-ed78a571645b"
},
"properties": {
"tags": {
"first_name": "John",
"last_name": "Smith"
}
}
}{
"identity": {
"onesignal_id": "567491ee-9105-4a87-9cbc-ed78a571645b",
"external_id": "test_external_id-101101"
},
"subscriptions": [
{
"id": "f67491ee-9105-4a87-9cbc-ed78a571645b",
"app_id": "a67491ee-9105-4a87-9cbc-ed78a571645b",
"token": "joe@example.com",
"type": "email"
}
],
"properties": {
"tags": {
"color": "red"
}
}
}{
"errors": [
{
"code": "internal error code",
"title": "example error title",
"meta": {}
}
]
}{
"errors": [
{
"code": "internal error code",
"title": "example error title",
"meta": {}
}
]
}{
"errors": [
{
"code": "Rate Limit Exceeded",
"title": "API rate limit exceeded"
}
]
}{
"errors": [
"Service temporarily unavailable"
]
}Create a new user or modify the subscriptions associated with an existing User.
cURL
curl --request POST \
--url https://api.onesignal.com/apps/{app_id}/users \
--header 'Content-Type: application/json' \
--data '
{
"properties": {
"tags": {},
"language": "en",
"timezone_id": "America/Los_Angeles",
"lat": 123,
"long": 123,
"country": "US",
"first_active": 123,
"last_active": 123,
"ip": "<string>",
"test_user_name": "<string>"
},
"identity": {
"external_id": "<string>"
},
"subscriptions": [
{
"token": "<string>",
"enabled": true,
"notification_types": 123,
"session_time": 123,
"session_count": 123,
"app_version": "<string>",
"device_model": "<string>",
"device_os": "<string>",
"test_type": 123,
"sdk": "<string>",
"web_auth": "<string>",
"web_p256": "<string>"
}
]
}
'import Onesignal from '@onesignal/node-onesignal';
const configuration = Onesignal.createConfiguration({
restApiKey: 'YOUR_REST_API_KEY',
});
const apiInstance = new Onesignal.DefaultApi(configuration);
// string
const appId: string = "YOUR_APP_ID";
// User
const user: Onesignal.User = {
properties: {
tags: {},
language: "en",
timezone_id: "America/Los_Angeles",
lat: 3.14,
long: 3.14,
country: "US",
first_active: 1,
last_active: 1,
amount_spent: 3.14,
purchases: [
{
sku: "com.example.coins100",
amount: "0.99",
iso: "USD",
count: 1,
},
],
ip: "203.0.113.10",
},
identity: {
"key": "key_example",
},
subscriptions: [
{
id: "e4e87830-b954-4363-b7bc-1f01dbaee5c8",
type: "iOSPush",
token: "d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7",
enabled: true,
notification_types: 1,
session_time: 60,
session_count: 1,
sdk: "5.2.0",
device_model: "iPhone14,2",
device_os: "17.1",
rooted: true,
test_type: 1,
app_version: "1.0.0",
net_type: 1,
carrier: "Verizon",
web_auth: "5DUmpGmLuTxWCLj5lJpwLQ",
web_p256: "BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A",
},
],
};
try {
const response = await apiInstance.createUser(appId, user);
console.log(response);
} 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("createUser failed: HTTP " + e.code, e.errorMessages);
} else {
throw e;
}
}import onesignal
from onesignal.api import default_api
from onesignal.models import *
from pprint import pprint
# 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
)
# Enter a context with an instance of the API client
with onesignal.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = default_api.DefaultApi(api_client)
app_id = "YOUR_APP_ID"
user = User(
properties=PropertiesObject(
tags={},
language="en",
timezone_id="America/Los_Angeles",
lat=3.14,
long=3.14,
country="US",
first_active=1,
last_active=1,
amount_spent=3.14,
purchases=[
Purchase(
sku="com.example.coins100",
amount="0.99",
iso="USD",
count=1,
),
],
ip="203.0.113.10",
),
identity=IdentityObject(
key="key_example",
),
subscriptions=[
Subscription(
id="e4e87830-b954-4363-b7bc-1f01dbaee5c8",
type="iOSPush",
token="d5d4d1a8-1c9e-42fb-b3f2-56d3a5a9a8b7",
enabled=True,
notification_types=1,
session_time=60,
session_count=1,
sdk="5.2.0",
device_model="iPhone14,2",
device_os="17.1",
rooted=True,
test_type=1,
app_version="1.0.0",
net_type=1,
carrier="Verizon",
web_auth="5DUmpGmLuTxWCLj5lJpwLQ",
web_p256="BM5-r8DauQXOb2E-3PgLPjSvjT0Ao9v5oJhw8bZ0cW7Vh6BbmPYcqbbCEJ1P2sK0hZ7HxSh9zGyU5pQk1jJmZ8A",
),
],
)
try:
api_response = api_instance.create_user(app_id, user)
pprint(api_response)
except onesignal.ApiException as e:
print("Exception when calling DefaultApi->create_user: %s\n" % e)
print("Status Code: %s" % e.status)
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(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = 'YOUR_APP_ID'; // string
$user = new \onesignal\client\model\User(); // \onesignal\client\model\User
try {
$result = $apiInstance->createUser($app_id, $user);
print_r($result);
} catch (\onesignal\client\ApiException $e) {
echo 'Exception when calling DefaultApi->createUser: ', $e->getMessage(), PHP_EOL;
echo 'Status Code: ', $e->getCode(), PHP_EOL;
// getErrorMessages() flattens any error-envelope shape to a string[];
// the raw body remains on getResponseBody().
echo 'Error Messages: ', implode(', ', $e->getErrorMessages()), PHP_EOL;
echo 'Response Body: ', $e->getResponseBody(), PHP_EOL;
} catch (\Exception $e) {
echo 'Exception when calling DefaultApi->createUser: ', $e->getMessage(), PHP_EOL;
}package main
import (
"context"
"fmt"
"os"
"github.com/OneSignal/onesignal-go-api/v5"
)
func main() {
appId := "YOUR_APP_ID" // string |
user := *onesignal.NewUser() // User |
configuration := onesignal.NewConfiguration()
apiClient := onesignal.NewAPIClient(configuration)
restAuth := context.WithValue(context.Background(), onesignal.RestApiKey, "YOUR_REST_API_KEY") // App REST API key required for most endpoints
resp, r, err := apiClient.DefaultApi.CreateUser(restAuth, appId).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
if apiErr, ok := err.(*onesignal.GenericOpenAPIError); ok {
// ErrorMessages() flattens any error-envelope shape to a []string;
// the raw body remains on Body().
fmt.Fprintf(os.Stderr, "Error Messages: %v\n", apiErr.ErrorMessages())
fmt.Fprintf(os.Stderr, "Response Body: %s\n", apiErr.Body())
}
}
// response from `CreateUser`: User
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateUser`: %v\n", resp)
}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
app_id = 'YOUR_APP_ID' # String |
user = OneSignal::User.new # User |
begin
result = api_instance.create_user(app_id, user)
p result
rescue OneSignal::ApiError => e
puts "Error when calling DefaultApi->create_user: #{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 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");
// Configure HTTP bearer authorization: rest_api_key
HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
rest_api_key.setBearerToken("YOUR_REST_API_KEY");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String appId = "YOUR_APP_ID"; // String |
User user = new User(); // User |
try {
User result = apiInstance.createUser(appId, user);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#createUser");
System.err.println("Status code: " + e.getCode());
// getErrorMessages() flattens any error-envelope shape to a List<String>;
// the raw body remains on getResponseBody().
System.err.println("Error messages: " + e.getErrorMessages());
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 CreateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.onesignal.com";
// Configure Bearer token for authorization: rest_api_key
config.AccessToken = "YOUR_REST_API_KEY";
var apiInstance = new DefaultApi(config);
var appId = "YOUR_APP_ID"; // string |
var user = new User(); // User |
try
{
User result = apiInstance.CreateUser(appId, user);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.CreateUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
// e.ErrorMessages flattens any error-envelope shape to an IReadOnlyList<string>;
// the raw body remains on e.ErrorContent.
Debug.Print("Error Messages: " + string.Join(", ", e.ErrorMessages));
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;
#[tokio::main]
async fn main() {
let mut configuration = Configuration::new();
configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string());
// Realistic values are pulled from the spec's `example:` fields where present.
let app_id: &str = "YOUR_APP_ID";
let user: models::User = todo!();
match default_api::create_user(&configuration, app_id, user).await {
Ok(resp) => println!("{:?}", resp),
Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => {
// `e.error_messages()` flattens any error-envelope shape to a Vec<String>;
// the raw response remains on the ResponseError variant.
eprintln!("create_user failed: {:?}", e.error_messages());
}
Err(e) => eprintln!("create_user failed: {:?}", e),
}
}{
"identity": {
"onesignal_id": "567491ee-9105-4a87-9cbc-ed78a571645b"
},
"properties": {
"tags": {
"first_name": "John",
"last_name": "Smith"
}
}
}{
"identity": {
"onesignal_id": "567491ee-9105-4a87-9cbc-ed78a571645b",
"external_id": "test_external_id-101101"
},
"subscriptions": [
{
"id": "f67491ee-9105-4a87-9cbc-ed78a571645b",
"app_id": "a67491ee-9105-4a87-9cbc-ed78a571645b",
"token": "joe@example.com",
"type": "email"
}
],
"properties": {
"tags": {
"color": "red"
}
}
}{
"errors": [
{
"code": "internal error code",
"title": "example error title",
"meta": {}
}
]
}{
"errors": [
{
"code": "internal error code",
"title": "example error title",
"meta": {}
}
]
}{
"errors": [
{
"code": "Rate Limit Exceeded",
"title": "API rate limit exceeded"
}
]
}{
"errors": [
"Service temporarily unavailable"
]
}login, addEmail, and addSms. See Users and Subscriptions for conceptual guidance.
identity or subscriptions.identity field (such as an external_id). The user is created with zero subscriptions and can be updated, targeted, and connected to subscriptions later. See User lifecycle.properties).external_id (the recommended identifier). They allow you to reference users across platforms or external systems. Up to 10 custom aliases are supported. Each alias key and value has a maximum length of 128 characters.
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
The subscriptions object allows for creating or transferring subscriptions to a specified user. See Subscriptions.
Show child attributes
Was this page helpful?
| Web Proxy Viewer | New URL | Original Page |