Get Journey schema
curl --request GET \
--url https://api.onesignal.com/journeys/schemaconst options = {method: 'GET'};
fetch('https://api.onesignal.com/journeys/schema', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onesignal.com/journeys/schema"
response = requests.get(url)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onesignal.com/journeys/schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onesignal.com/journeys/schema"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.onesignal.com/journeys/schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://api.onesignal.com/journeys/schema")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.onesignal.com/journeys/schema");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"operation": "create",
"document": "body",
"schema": {}
}{
"errors": [
{
"code": "invalid-payload",
"title": "operation must be create, duplicate, update, or update_node",
"meta": {
"attribute": "base",
"path": "operation"
}
}
]
}Get Journey schema
Retrieve the JSON Schema for creating, duplicating, or updating a Journey or step before you construct a request.
GET
/
journeys
/
schema
Get Journey schema
curl --request GET \
--url https://api.onesignal.com/journeys/schemaconst options = {method: 'GET'};
fetch('https://api.onesignal.com/journeys/schema', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onesignal.com/journeys/schema"
response = requests.get(url)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onesignal.com/journeys/schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onesignal.com/journeys/schema"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.onesignal.com/journeys/schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://api.onesignal.com/journeys/schema")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.onesignal.com/journeys/schema");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"operation": "create",
"document": "body",
"schema": {}
}{
"errors": [
{
"code": "invalid-payload",
"title": "operation must be create, duplicate, update, or update_node",
"meta": {
"attribute": "base",
"path": "operation"
}
}
]
}Retrieve the JSON Schema for the Journey document you plan to send.
Omitting
Beta. The Journeys API is in beta. Endpoints and response fields can still change.
Access to schemas
The HTTP schema endpoint is public and app-independent. It requires no authentication or App ID. Retrieve the schema without a source Journey or available creation quota. Schema retrieval does not grant access to Journey data or writes. Other Journey endpoints still require authentication and app permissions.Choose an operation
Send the requiredoperation query parameter:
GET /journeys/schema?operation=create
curl --get 'https://api.onesignal.com/journeys/schema' \
--data-urlencode 'operation=create'
| Operation | document | What the schema describes |
|---|---|---|
create | body | The Journey document to create |
duplicate | overrides | Optional fields to apply to the copy |
update | patch | The partial update to a Journey |
update_node | merged_node | The complete node after applying a partial update, not the patch alone |
operation or sending an unsupported value returns 400.
You can also send HEAD to the same path and query. A successful HEAD request returns headers without a response body.
Use the response
Readoperation, document, and schema from the response. The schema object is a self-contained JSON Schema Draft 6 document with local $defs references.
Validate the relevant document against schema, not the complete HTTP or MCP request. Routing IDs and concurrency_key are request metadata, not fields you must add to the schema document.
The schema describes JSON structure. Write requests also enforce permissions, resource ownership, entitlements, and Journey rules.
Create and duplicate
Use Create Journey for writable fields and local node references. Use Duplicate Journey for copy behavior and overrides.Journey updates
Use theupdate schema for the partial Journey document. Omitted top-level fields remain unchanged. Supplied nested objects and array members still need to satisfy their schema requirements.
The schema also includes server-controlled fields from the Journey representation. Acceptance by the schema does not make every field writable. See Update Journey for applied fields, identity rules, and lifecycle restrictions.
Step updates
Useupdate_node to validate the complete node after applying a partial update. Do not validate a sparse node patch against this schema alone.
For example, a patch that only changes duration_seconds does not need to repeat the existing node’s kind. The merged node still needs a valid kind.
See Update Journey node for merge behavior and node restrictions.
FAQ
Does the response include instructions for calling MCP tools?
No. The response contains onlyoperation, document, and schema. For MCP argument objects, schema retrieval, and concurrency requirements, see Manage Journeys with MCP.
Can I use a schema to check whether a write will succeed?
Not completely. A document can satisfy the schema and still fail permission, resource, entitlement, or Journey checks on the write request.Query Parameters
Response
The schema and its applicability.
Was this page helpful?