Update Schema
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>"
}
'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>"
}
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>'
})
};
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>'
]),
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}")
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}")
.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}"
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>",
"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": [],
"description": "<string>"
}
],
"dataConnectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_query": "<string>",
"sourceQuery": "<string>",
"deactivated_at": "<string>",
"deactivatedAt": "<string>",
"exposeNameJsonPath": "<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>"
]
}
]
}
}Schema Definitions
Update Schema
Updates an existing schema definition. The update can take up to 3 mins to take effect.
POST
/
partner
/
schema-definitions
/
{schemaIdOrName}
Update Schema
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>"
}
'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>"
}
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>'
})
};
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>'
]),
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}")
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}")
.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}"
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>",
"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": [],
"description": "<string>"
}
],
"dataConnectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_query": "<string>",
"sourceQuery": "<string>",
"deactivated_at": "<string>",
"deactivatedAt": "<string>",
"exposeNameJsonPath": "<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
application/json
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.
Available options:
contacts_schema, transactions_schema, custom_schema, combined_schema, locations_schema, customer_fields ⌘I