For AI agents: this page in Markdown: https://www.pubnub.com/docs/admin-api/create-a-new-relationship-class.md. Documentation index: https://www.pubnub.com/llms-full.txt.
Create a new relationship class
POST/v2/datasync/subkeys/:subKey/relationship-classes/:relationshipClass/versions/:relationshipClassVersion
Creates a new relationship class that defines a type of relationship between entities. Version numbers need not be consecutive, but the version number of a deleted version cannot be reused: creating it again returns 400 with DS-0006. This applies independently to each subkey and class name. A live duplicate version returns 409, including a version recreated before reuse was prohibited: the live duplicate takes precedence over any deleted history with the same version number.
Permissions: datasync:write on keyset
Request
Response Headers
LocationURI of the created relationship class
Example
{
"data": {
"description": "Represents a parent-child relationship between entities",
"directed": true,
"cardinality": "one-to-many",
"entityAClass": "Parent",
"entityBClass": "Child",
"properties": [
{
"name": "role",
"path": "/payload/role",
"valueKind": "string",
"filtering": "full"
}
]
},
"meta": {
"next_cursor": "string",
"has_next": true,
"prev_cursor": "string",
"has_prev": false,
"limit": 20
}
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
"Accept header value is not acceptable. Supported values are [application/json]"Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}Example
{
"errors": [
{
"errorCode": "DS-0100",
"message": "Entity not found: user-42",
"path": "/payload/score",
"location": {
"offset": 6,
"length": 5
}
}
]
}