# Rename a relationship or set its principal

Renames, re-kinds or re-notes one entity group, and sets or clears its PRINCIPAL — the member everything else hangs off, which must already be in the group. An absent field is left alone; an explicit null on primaryRowId clears the principal.

Access class: `def:read`.

## Endpoint

`PATCH /v1/definitions/{key}/entity-groups/{groupId}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| groupId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "kind": "string",
    "name": "string",
    "notes": "string",
    "primaryRowId": ""
  },
  "params": {
    ":groupId": "",
    ":key": "string"
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "createdAt": "string",
    "createdByUserId": 1.5,
    "id": "",
    "kind": "string",
    "memberCount": 1.5,
    "name": "string",
    "notes": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
