# List relationship categories

`GET /api/v1/relationship-categories`

List the categories your account files its relationship types under, in the order you arranged them.

A category groups the list and nothing more. Moving a type into Family does not make it genealogical, and moving a genealogical one out of it does not take that behaviour away.

Every account starts with five: Family, Romantic, Friendship, Professional and Other. Those five are marked with is_system, may be moved and retired, and can never be renamed or deleted. Any category you add yourself carries none of those restrictions.

Retired categories are listed with the rest, because one that is off is meant to be found again and switched back on.

This endpoint also answers QUERY, with the same parameters sent in the request body. [How QUERY works](https://my.monicahq.com/docs/api/query-method).

## Query parameters

- `page` (integer, optional, defaults to 1): Which page to answer with.
- `per_page` (integer, optional, defaults to 25): How many categories one page holds, between 1 and 100. A number outside the range is brought back into it rather than refused.

## Returns

A page of relationship category objects, and how many there are in all.

- `data` (array): The categories on this page. An empty list rather than an error when there are none.
- `data[]` (object): One category.
- `data[].type` (string): Always relationship_category. 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.name` (string): What the category is called. A category 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, so no markup survives here.
- `data[].attributes.position` (integer): Where the category sits in the settings and in the picker, counting from 1. Retired categories are numbered along with the rest, so one switched back on finds the place it had.
- `data[].attributes.is_system` (boolean): Whether the product supplied the category with the account. A supplied category may be moved and retired, never renamed and never deleted, because the wording it falls back to belongs to the product.
- `data[].attributes.is_active` (boolean): Whether the category and the types under it are offered when a new relationship is written. False removes the whole category from that choice and touches nothing already written: every relationship stays readable.
- `data[].attributes.type_count` (integer): How many relationship types sit under the category, retired ones counted. It is what decides whether the category may be deleted, since one still holding a type cannot go.
- `data[].attributes.created_at` (timestamp): When the category 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.
- `meta` (object): Where you are in the collection.
- `meta.page` (integer): The page this is, counting from 1.
- `meta.per_page` (integer): How many one page holds, which is the size that was asked for once it has been brought into the allowed range.
- `meta.total` (integer): How many categories there are in all, not how many are on this page.

## 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-categories \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/relationship-categories', {
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/relationship-categories');
```

## Response

`200`

```json
{
    "data": [
        {
            "type": "relationship_category",
            "id": "7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14",
            "attributes": {
                "name": "Family",
                "position": 1,
                "is_system": true,
                "is_active": true,
                "type_count": 5,
                "created_at": 1756252800,
                "updated_at": 1756252800
            },
            "links": {
                "self": "https://my.monicahq.com/api/v1/relationship-categories/7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14"
            }
        },
        {
            "type": "relationship_category",
            "id": "b42e9c07-5a18-4d73-8e60-1c9f2b7a4d35",
            "attributes": {
                "name": "Neighbourhood",
                "position": 6,
                "is_system": false,
                "is_active": true,
                "type_count": 0,
                "created_at": 1756339200,
                "updated_at": 1756425600
            },
            "links": {
                "self": "https://my.monicahq.com/api/v1/relationship-categories/b42e9c07-5a18-4d73-8e60-1c9f2b7a4d35"
            }
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 25,
        "total": 2
    }
}
```
