---
source_url: https://www.pubnub.com/docs/admin-api/create-a-new-relationship-class
title: Create a new relationship class
---

# Create a new relationship class

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

Creates a new relationship class that defines a type of relationship between entities.

## Request

Response Headers

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
      }
    }
  ]
}
```
