post https://{youraccountname}.api-us1.com/api/3/customObjects/schemas/public
The key differences between creating a private and public schema (besides the API endpoint) are specifying "visibility": "public"
and including an appId
. An App ID can be generated by creating a new app in App Studio. Once a new app is created, the App ID can be found in App Details under Description.
Public Schema Slug
When a public schema is created, the
slug
property is updated to be"app-" + appId + slug
. This is to ensure the slug is unique across all public schemas.
{
"schema": {
"slug": "event-tickets",
"appId": "cxapp-studio-app-id",
"labels": {
"singular": "Event Ticket",
"plural": "Event Tickets"
},
"description": "Event Tickets",
"fields": [
{
"id": "name",
"labels": {
"singular": "Name",
"plural": "Names"
},
"type": "textarea"
}
],
"relationships": [
{
"id": "primary-contact",
"labels": {
"singular": "Primary Contact",
"plural": "Primary Contacts"
},
"description": "Primary contact that owns a ticket",
"namespace": "contacts"
}
]
}
}
{
"schema": {
"id": "230f6065-a8e5-4df2-a70a-f6832d004d8d",
"slug": "app-230f6065-a8e5-4df2-a70a-f6832d004d8d-event-tickets",
"visibility": "public",
"labels": {"singular": "Event Ticket", "plural": "Event Tickets"},
"description": "Event Tickets",
"appId": "cxapp-studio-app-id",
"fields": [
{
"id": "name",
"labels": {"singular": "Name", "plural": "Names"},
"type": "textarea"
}
],
"relationships": [
{
"id": "primary-contact",
"labels": {
"singular": "Primary Contact",
"plural": "Primary Contacts"
},
"description": "Primary contact that owns a ticket",
"namespace": "contacts",
"hasMany": false,
"inherited": false
}
],
"icons": {
"default": "https://d226aj4ao1t61q.cloudfront.net/n9mayqo2d_customobject.png"
}
}
}