Create a new entity class
POST/v2/datasync/subkeys/:subKey/entity-classes/:entityClass/versions/:entityClassVersion
Creates a new entity class with its registry configuration, property definitions. The first-created version in the continued class history establishes its inheritance: subsequent versions must remain standalone or extend the same parent class at the same level. They must select the same or a higher parent version than the highest version of that parent previously used in this history, including deleted versions. Legacy classes may have independent histories established before these restrictions, such as after deletion and recreation or concurrent creation. New versions continue the history containing the most recently created version, even if it is deleted. Other histories do not determine inheritance or the minimum parent version, but still count toward the version-number maximum. Version numbers must strictly increase; gaps are allowed and the first version need not be 1. Deleted versions still count toward the highest version number and do not reset the inheritance rule or allow version number reuse. These rules apply independently to each subkey, class name and class level. A live duplicate version returns 409; an inheritance change, a parent version downgrade or a version number not greater than the historical maximum returns 400 with DS-0006. After request fields and required configuration have been validated, version and inheritance errors have this precedence: a live duplicate version (409); a version number not greater than the historical maximum (400, DS-0006); adding, removing or renaming the parent, or selecting a lower parent version (400, DS-0006); a referenced parent version that does not exist (404, DS-0100); a parent that is not on a higher class level or is not the same parent class (400, DS-0006). If any version in the continued history, including a deleted version, references a parent definition that is no longer available, creation returns 404 with DS-0100 after the version-number checks and before inheritance checks.
Permissions: datasync:write on keyset
Request
LocationURI of the created entity class
{
"data": {
"name": "user-profile",
"description": "Entity class for storing user profile information including basic details and preferences",
"version": 1,
"config": {
"ttlSec": 2678400
},
"properties": [
{
"name": "username",
"path": "/payload/username",
"valueKind": "string",
"filtering": "full"
},
{
"name": "email",
"path": "/payload/email",
"valueKind": "string",
"filtering": "simple",
"isNullable": true
},
{
"name": "dateOfBirth",
"path": "/payload/dateOfBirth",
"valueKind": "date",
"filtering": "simple"
},
{
"name": "isActive",
"path": "/payload/isActive",
"valueKind": "boolean",
"filtering": "simple"
},
{
"name": "score",
"path": "/payload/score",
"valueKind": "number",
"filtering": "simple"
}
]
},
"meta": {
"next_cursor": "string",
"has_next": true,
"prev_cursor": "string",
"has_prev": false,
"limit": 20
}
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}"Accept header value is not acceptable. Supported values are [application/json]"{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}