POST
/
crm-object-schemas
/
v3
/
schemas
Create a new schema
curl --request POST \
  --url https://api.hubapi.com/crm-object-schemas/v3/schemas \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "my_object",
  "labels": {
    "singular": "My object",
    "plural": "My objects"
  },
  "primaryDisplayProperty": "my_object_property",
  "requiredProperties": [
    "my_object_property"
  ],
  "properties": [
    {
      "name": "my_object_property",
      "label": "My object property",
      "isPrimaryDisplayLabel": true
    }
  ],
  "associatedObjects": [
    "CONTACT"
  ],
  "metaType": "PORTAL_SPECIFIC"
}'
{
  "id": "123456",
  "createdAt": "2020-02-20T18:07:11.390Z",
  "updatedAt": "2020-02-20T18:09:07.555Z",
  "properties": [
    {
      "updatedAt": "2020-02-20T18:07:11.802Z",
      "createdAt": "2020-02-20T18:07:11.802Z",
      "name": "my_object_property",
      "label": "My object property",
      "type": "string",
      "fieldType": "text",
      "groupName": "my_object_information",
      "displayOrder": -1,
      "calculated": false,
      "externalOptions": false,
      "archived": false,
      "hasUniqueValue": false
    }
  ],
  "associations": [
    {
      "id": "123",
      "fromObjectTypeId": "2-123456",
      "toObjectTypeId": "0-1",
      "name": "my_object_to_contact"
    }
  ],
  "labels": {
    "singular": "My object",
    "plural": "My objects"
  },
  "requiredProperties": [
    "my_object_property"
  ],
  "searchableProperties": [
    "my_object_property"
  ],
  "primaryDisplayProperty": "my_object_property",
  "metaType": "PORTAL_SPECIFIC",
  "fullyQualifiedName": "p7878787_my_object\"",
  "name": "my_object"
}
Supported products
Requires one of the following products or higher.
Marketing HubMarketing HubEnterprise
Sales HubSales HubEnterprise
Service HubService HubEnterprise
Content HubContent HubEnterprise

Body

application/json

Object schema definition, including properties and associations.

Defines a new object type, its properties, and associations.

Response

201
application/json

successful operation

Defines an object schema, including its properties and associations.