# Reword a relationship type

`PUT /api/v1/relationship-types/{relationshipType}`

Change what a type is called, how it reads from each side, and which category it sits in.

This works on a type the product supplied as readily as on one you added. A French household preferring Conjoint to Spouse writes it here, and what the product does with that type is untouched: its system_behavior, its direction and its identity all stay.

Rewording the two roles of a directed type never swaps the people over. The first person keeps role_a in every relationship already written, so correcting a word cannot quietly turn parents into children.

The direction stays as it is unless you send is_symmetric. Send it against a type the product supplied, or one that relationships already use, and the request is refused rather than quietly ignored, because turning a type round would rewrite what people wrote years ago.

Whether the type is offered, and where it sits, are not changed here. Each has an endpoint of its own below.

## Parameters

- `relationshipType` (uuid, required): The id of the type. A path that is not a uuid answers 404 without a query being run.
- `relationship_category_id` (uuid, optional): The category the type sits in. Moving it between categories changes nothing about what the product does with it. It cannot be null.
- `name` (string, optional): What the link is called. A name another type of your account carries is refused. It cannot be null.
- `role_a` (string, optional): How the first person relates to the second. It cannot be null.
- `role_b` (string, optional): How the second person relates to the first. Left out, it keeps the role it has rather than copying role_a. It cannot be null while the type is directed.
- `is_symmetric` (boolean, optional): Send it only to change the direction. Left out, the direction holds. Refused for a supplied type and for one in use.

## Returns

The relationship type object as it now reads.

- `data` (object): The type.
- `data.type` (string): Always relationship_type. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
- `data.id` (string): The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
- `data.attributes` (object): Everything the record holds.
- `data.attributes.relationship_category_id` (uuid): The category the type is filed under. It groups the list and the picker and has no other effect: moving a type between categories never changes what the product does with it.
- `data.attributes.name` (string): What the link is called: Parent / Child, Sibling, Colleague. A type the product supplied reads in the language you ask for, until somebody rewrites it, after which their words stand in every language. Up to 255 characters, reduced to plain text.
- `data.attributes.role_a` (string): How the first person relates to the second. In a Parent / Child link the first person is the Parent. It is read in the same way the name is.
- `data.attributes.role_b` (string): How the second person relates to the first. A symmetric type carries the same word here as in role_a, and rewording the two never swaps the people over: the first role stays on the first person of every relationship already written.
- `data.attributes.is_symmetric` (boolean): Whether both people read the same word, as Friend does, rather than a different one on each side, as Parent / Child does. It is frozen once the product supplied the type or a relationship uses it, because turning it round would rewrite what people wrote years ago.
- `data.attributes.system_behavior` (string): Either genealogy_parentage, which feeds the family tree, or romantic, which feeds romantic history, or null. It is attached to the supplied type itself rather than to its name or its category, so renaming one or moving it elsewhere changes the words on screen and nothing more. A type you invent never acquires one.
- `data.attributes.position` (integer): Where the type sits inside its category, counting from 1. Retired types are numbered along with the rest.
- `data.attributes.is_system` (boolean): Whether the product supplied the type with the account. A supplied type may be reworded, moved and retired, never deleted, and its direction never changes.
- `data.attributes.is_active` (boolean): Whether the type is offered when a new relationship is written. False stops it being chosen again and touches nothing already written.
- `data.attributes.relationship_count` (integer): How many relationships are written with this type, across every vault of your account. A relationship in the bin is not counted. It decides both whether the type may be deleted and whether its direction may still move.
- `data.attributes.created_at` (timestamp): When the type was added, as a count of seconds since 1970 rather than a written date.
- `data.attributes.updated_at` (timestamp): When it last changed, as a count of seconds. Equal to created_at until it first changes.
- `data.links` (object): Where to find this record.
- `data.links.self` (string): The absolute address this record is read from.

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48 \
  -X PUT \
  -H "Authorization: Bearer $MONICA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
      "relationship_category_id": "7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14",
      "name": "Godparent / Godchild",
      "role_a": "Godparent",
      "role_b": "Godchild",
      "is_symmetric": "false"
  }'
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48', {
  method: 'PUT',
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    relationship_category_id: '7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14',
    name: 'Godparent / Godchild',
    role_a: 'Godparent',
    role_b: 'Godchild',
    is_symmetric: 'false',
  }),
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->put('https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48', [
    'relationship_category_id' => '7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14',
    'name' => 'Godparent / Godchild',
    'role_a' => 'Godparent',
    'role_b' => 'Godchild',
    'is_symmetric' => 'false',
]);
```

## Response

`200`

```json
{
    "data": {
        "type": "relationship_type",
        "id": "c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48",
        "attributes": {
            "relationship_category_id": "7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14",
            "name": "Godparent / Godchild",
            "role_a": "Godparent",
            "role_b": "Godchild",
            "is_symmetric": false,
            "system_behavior": null,
            "position": 6,
            "is_system": false,
            "is_active": true,
            "relationship_count": 0,
            "created_at": 1756339200,
            "updated_at": 1756425600
        },
        "links": {
            "self": "https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48"
        }
    }
}
```
