curl --request POST \
--url https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName} \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"schema": {},
"fieldsToExpose": [
{
"name": "<string>",
"jsonPath": "<string>",
"exposure": [],
"description": "<string>"
}
],
"exposeNameJsonPath": "<string>",
"external_id_field": "<string>",
"externalIdField": "<string>",
"displayMetadata": {
"icon": {
"type": "lucide"
},
"color": "<string>",
"reporting": {
"status": {
"path": "<string>"
},
"effectiveDate": {
"path": "<string>"
},
"resourceLink": {
"source": "field",
"path": "<string>"
}
}
}
}
'import requests
url = "https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}"
payload = {
"description": "<string>",
"schema": {},
"fieldsToExpose": [
{
"name": "<string>",
"jsonPath": "<string>",
"exposure": [],
"description": "<string>"
}
],
"exposeNameJsonPath": "<string>",
"external_id_field": "<string>",
"externalIdField": "<string>",
"displayMetadata": {
"icon": { "type": "lucide" },
"color": "<string>",
"reporting": {
"status": { "path": "<string>" },
"effectiveDate": { "path": "<string>" },
"resourceLink": {
"source": "field",
"path": "<string>"
}
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
schema: {},
fieldsToExpose: [
{name: '<string>', jsonPath: '<string>', exposure: [], description: '<string>'}
],
exposeNameJsonPath: '<string>',
external_id_field: '<string>',
externalIdField: '<string>',
displayMetadata: {
icon: {type: 'lucide'},
color: '<string>',
reporting: {
status: {path: '<string>'},
effectiveDate: {path: '<string>'},
resourceLink: {source: 'field', path: '<string>'}
}
}
})
};
fetch('https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'schema' => [
],
'fieldsToExpose' => [
[
'name' => '<string>',
'jsonPath' => '<string>',
'exposure' => [
],
'description' => '<string>'
]
],
'exposeNameJsonPath' => '<string>',
'external_id_field' => '<string>',
'externalIdField' => '<string>',
'displayMetadata' => [
'icon' => [
'type' => 'lucide'
],
'color' => '<string>',
'reporting' => [
'status' => [
'path' => '<string>'
],
'effectiveDate' => [
'path' => '<string>'
],
'resourceLink' => [
'source' => 'field',
'path' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"schema\": {},\n \"fieldsToExpose\": [\n {\n \"name\": \"<string>\",\n \"jsonPath\": \"<string>\",\n \"exposure\": [],\n \"description\": \"<string>\"\n }\n ],\n \"exposeNameJsonPath\": \"<string>\",\n \"external_id_field\": \"<string>\",\n \"externalIdField\": \"<string>\",\n \"displayMetadata\": {\n \"icon\": {\n \"type\": \"lucide\"\n },\n \"color\": \"<string>\",\n \"reporting\": {\n \"status\": {\n \"path\": \"<string>\"\n },\n \"effectiveDate\": {\n \"path\": \"<string>\"\n },\n \"resourceLink\": {\n \"source\": \"field\",\n \"path\": \"<string>\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"schema\": {},\n \"fieldsToExpose\": [\n {\n \"name\": \"<string>\",\n \"jsonPath\": \"<string>\",\n \"exposure\": [],\n \"description\": \"<string>\"\n }\n ],\n \"exposeNameJsonPath\": \"<string>\",\n \"external_id_field\": \"<string>\",\n \"externalIdField\": \"<string>\",\n \"displayMetadata\": {\n \"icon\": {\n \"type\": \"lucide\"\n },\n \"color\": \"<string>\",\n \"reporting\": {\n \"status\": {\n \"path\": \"<string>\"\n },\n \"effectiveDate\": {\n \"path\": \"<string>\"\n },\n \"resourceLink\": {\n \"source\": \"field\",\n \"path\": \"<string>\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"schema\": {},\n \"fieldsToExpose\": [\n {\n \"name\": \"<string>\",\n \"jsonPath\": \"<string>\",\n \"exposure\": [],\n \"description\": \"<string>\"\n }\n ],\n \"exposeNameJsonPath\": \"<string>\",\n \"external_id_field\": \"<string>\",\n \"externalIdField\": \"<string>\",\n \"displayMetadata\": {\n \"icon\": {\n \"type\": \"lucide\"\n },\n \"color\": \"<string>\",\n \"reporting\": {\n \"status\": {\n \"path\": \"<string>\"\n },\n \"effectiveDate\": {\n \"path\": \"<string>\"\n },\n \"resourceLink\": {\n \"source\": \"field\",\n \"path\": \"<string>\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"plural_name": "<string>",
"pluralName": "<string>",
"description": "<string>",
"category": "contacts_schema",
"version_number": 123,
"versionNumber": 123,
"reference_schemas": [
"<string>"
],
"referenceSchemas": [
"<string>"
],
"schema": {},
"external_id_field": "<string>",
"externalIdField": "<string>",
"created_at": "<string>",
"createdAt": "<string>",
"updated_at": "<string>",
"updatedAt": "<string>",
"fieldsToExpose": [
{
"name": "<string>",
"jsonPath": "<string>",
"exposure": [
"segments"
],
"description": "<string>"
}
],
"dataConnectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_query": "<string>",
"sourceQuery": "<string>",
"deactivated_at": "<string>",
"deactivatedAt": "<string>",
"exposeNameJsonPath": "<string>",
"displayMetadata": {
"icon": {
"type": "lucide",
"value": "User"
},
"color": "<string>",
"reporting": {
"status": {
"path": "<string>"
},
"effectiveDate": {
"path": "<string>"
},
"resourceLink": {
"source": "field",
"path": "<string>"
}
}
}
}
}{
"message": "<string>",
"success": false,
"errors": [
"<string>"
]
}{
"success": true,
"message": "<string>",
"data": {
"error": "Cannot remove fields that are in use by existing resources",
"message": "<string>",
"conflicts": [
{
"field": "<string>",
"resourceExternalIds": [
"<string>"
]
}
]
}
}Update Schema
Updates an existing schema definition. The update can take up to 3 mins to take effect.
curl --request POST \
--url https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName} \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"schema": {},
"fieldsToExpose": [
{
"name": "<string>",
"jsonPath": "<string>",
"exposure": [],
"description": "<string>"
}
],
"exposeNameJsonPath": "<string>",
"external_id_field": "<string>",
"externalIdField": "<string>",
"displayMetadata": {
"icon": {
"type": "lucide"
},
"color": "<string>",
"reporting": {
"status": {
"path": "<string>"
},
"effectiveDate": {
"path": "<string>"
},
"resourceLink": {
"source": "field",
"path": "<string>"
}
}
}
}
'import requests
url = "https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}"
payload = {
"description": "<string>",
"schema": {},
"fieldsToExpose": [
{
"name": "<string>",
"jsonPath": "<string>",
"exposure": [],
"description": "<string>"
}
],
"exposeNameJsonPath": "<string>",
"external_id_field": "<string>",
"externalIdField": "<string>",
"displayMetadata": {
"icon": { "type": "lucide" },
"color": "<string>",
"reporting": {
"status": { "path": "<string>" },
"effectiveDate": { "path": "<string>" },
"resourceLink": {
"source": "field",
"path": "<string>"
}
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
schema: {},
fieldsToExpose: [
{name: '<string>', jsonPath: '<string>', exposure: [], description: '<string>'}
],
exposeNameJsonPath: '<string>',
external_id_field: '<string>',
externalIdField: '<string>',
displayMetadata: {
icon: {type: 'lucide'},
color: '<string>',
reporting: {
status: {path: '<string>'},
effectiveDate: {path: '<string>'},
resourceLink: {source: 'field', path: '<string>'}
}
}
})
};
fetch('https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'schema' => [
],
'fieldsToExpose' => [
[
'name' => '<string>',
'jsonPath' => '<string>',
'exposure' => [
],
'description' => '<string>'
]
],
'exposeNameJsonPath' => '<string>',
'external_id_field' => '<string>',
'externalIdField' => '<string>',
'displayMetadata' => [
'icon' => [
'type' => 'lucide'
],
'color' => '<string>',
'reporting' => [
'status' => [
'path' => '<string>'
],
'effectiveDate' => [
'path' => '<string>'
],
'resourceLink' => [
'source' => 'field',
'path' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"schema\": {},\n \"fieldsToExpose\": [\n {\n \"name\": \"<string>\",\n \"jsonPath\": \"<string>\",\n \"exposure\": [],\n \"description\": \"<string>\"\n }\n ],\n \"exposeNameJsonPath\": \"<string>\",\n \"external_id_field\": \"<string>\",\n \"externalIdField\": \"<string>\",\n \"displayMetadata\": {\n \"icon\": {\n \"type\": \"lucide\"\n },\n \"color\": \"<string>\",\n \"reporting\": {\n \"status\": {\n \"path\": \"<string>\"\n },\n \"effectiveDate\": {\n \"path\": \"<string>\"\n },\n \"resourceLink\": {\n \"source\": \"field\",\n \"path\": \"<string>\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"schema\": {},\n \"fieldsToExpose\": [\n {\n \"name\": \"<string>\",\n \"jsonPath\": \"<string>\",\n \"exposure\": [],\n \"description\": \"<string>\"\n }\n ],\n \"exposeNameJsonPath\": \"<string>\",\n \"external_id_field\": \"<string>\",\n \"externalIdField\": \"<string>\",\n \"displayMetadata\": {\n \"icon\": {\n \"type\": \"lucide\"\n },\n \"color\": \"<string>\",\n \"reporting\": {\n \"status\": {\n \"path\": \"<string>\"\n },\n \"effectiveDate\": {\n \"path\": \"<string>\"\n },\n \"resourceLink\": {\n \"source\": \"field\",\n \"path\": \"<string>\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embedreach.com/partner/schema-definitions/{schemaIdOrName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"schema\": {},\n \"fieldsToExpose\": [\n {\n \"name\": \"<string>\",\n \"jsonPath\": \"<string>\",\n \"exposure\": [],\n \"description\": \"<string>\"\n }\n ],\n \"exposeNameJsonPath\": \"<string>\",\n \"external_id_field\": \"<string>\",\n \"externalIdField\": \"<string>\",\n \"displayMetadata\": {\n \"icon\": {\n \"type\": \"lucide\"\n },\n \"color\": \"<string>\",\n \"reporting\": {\n \"status\": {\n \"path\": \"<string>\"\n },\n \"effectiveDate\": {\n \"path\": \"<string>\"\n },\n \"resourceLink\": {\n \"source\": \"field\",\n \"path\": \"<string>\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"plural_name": "<string>",
"pluralName": "<string>",
"description": "<string>",
"category": "contacts_schema",
"version_number": 123,
"versionNumber": 123,
"reference_schemas": [
"<string>"
],
"referenceSchemas": [
"<string>"
],
"schema": {},
"external_id_field": "<string>",
"externalIdField": "<string>",
"created_at": "<string>",
"createdAt": "<string>",
"updated_at": "<string>",
"updatedAt": "<string>",
"fieldsToExpose": [
{
"name": "<string>",
"jsonPath": "<string>",
"exposure": [
"segments"
],
"description": "<string>"
}
],
"dataConnectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_query": "<string>",
"sourceQuery": "<string>",
"deactivated_at": "<string>",
"deactivatedAt": "<string>",
"exposeNameJsonPath": "<string>",
"displayMetadata": {
"icon": {
"type": "lucide",
"value": "User"
},
"color": "<string>",
"reporting": {
"status": {
"path": "<string>"
},
"effectiveDate": {
"path": "<string>"
},
"resourceLink": {
"source": "field",
"path": "<string>"
}
}
}
}
}{
"message": "<string>",
"success": false,
"errors": [
"<string>"
]
}{
"success": true,
"message": "<string>",
"data": {
"error": "Cannot remove fields that are in use by existing resources",
"message": "<string>",
"conflicts": [
{
"field": "<string>",
"resourceExternalIds": [
"<string>"
]
}
]
}
}Path Parameters
The ID or name of the schema definition to update
Body
The description of the schema
The JSONSchema schema definition for the resource
The fields to expose on the segment builder or merge fields.
Show child attributes
Show child attributes
The JSON path to the field in the schema that will be used to expose the resource to the user. If not provided, the resource will not be exposed to the user.
[Deprecated] Please use externalIdField instead. The field in the schema that is used as the unique ID in the partner system.
The field in the schema that is used as the unique ID in the partner system.
The category of the schema. Cannot be changed if it is used in active schema mappings.
contacts_schema, transactions_schema, custom_schema, combined_schema, locations_schema, customer_fields Partial presentation and reporting metadata update. Null clears all metadata; nested nulls clear individual settings.
Show child attributes
Show child attributes