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.
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": "eyJpIjoiMjAiLCJzdiI6WyJBZGEiXSwiYiI6ZmFsc2UsInMiOiJuYW1lOmFzYyIsImUiOiJkYiJ9",
"has_next": true,
"prev_cursor": "eyJpIjoiMjAiLCJzdiI6WyJBZGEiXSwiYiI6dHJ1ZSwicyI6Im5hbWU6YXNjIiwiZSI6ImRiIn0",
"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
}
}
]
}