OS1 Services
...
Entity
How to use Entities?
How to: Create an Entity Type
1min
for information about prerequisites, see how to use entities? docid\ f5dbrxwuq321l b2mes3v to create an entity type, call the create a new entity type docid\ hlxymnweobpzmaohxqtk0 endpoint and pass a request body similar to the following { "name" { "plural" "cars", "singular" "car" }, "alias" { "plural" "automobiles", "singular" "automobile" }, "category" \[ { "name" "sedan", "description" "a passenger vehicle with four doors", "subcategory" \[ "compact", "mid size", "full size" ] } ], "attributes" \[ { "alias" "brand", "name" "make", "description" "the manufacturer of the vehicle", "isreadpublic" true, "tag" \[ "info", "specs" ], "datatype" "string", "indexed" true, "defaultvalue" "", "validation" { "range" { "min" 0, "max" 0 }, "regex" "^\[a za z0 9\\\s]{1,50}$", "valueoneof" \[ "toyota", "honda", "ford", "chevrolet" ], "required" true } }, { "alias" "model", "name" "model", "description" "the specific model of the vehicle", "isreadpublic" true, "tag" \[ "info", "specs" ], "datatype" "string", "indexed" true, "defaultvalue" "", "validation" { "range" { "min" 0, "max" 0 }, "regex" "^\[a za z0 9\\\s]{1,50}$", "valueoneof" \[], "required" true } }, { "alias" "year", "name" "manufacturingyear", "description" "the year the vehicle was manufactured", "isreadpublic" true, "tag" \[ "info", "specs" ], "datatype" "number", "indexed" true, "defaultvalue" 0, "validation" { "range" { "min" 1900, "max" 2023 }, "regex" "", "valueoneof" \[], "required" true } } ], "coreattributes" \[ { "name" "uniquecode", "alias" "vin" } ], "callback" { "url" "https //example com/callback", "meta" { "authtoken" "abcdef123456" } }, "isstatemachineenabled" true, "events" \[ "created", "updated", "deleted" ], "entitycode" "car", "terminalttl" "1h", "enableorchestrator" true } in the above payload, we have created an entity type with the plural name vehicles this entity type has a category called four wheeler and three sub categories the payload also has core attributes defined