API v1
v1
View as Markdown

Add a relationship category

POST /api/v1/relationship-categories

Add a category of your own, when the five the product supplies do not sort your list the way you think of it.

The category goes at the end of the list and is offered straight away. It holds nothing until you file types under it, and a category holding nothing is a perfectly ordinary state: Other is supplied that way.

A category does no work beyond grouping. Adding one called Family of my own does not make anything filed under it genealogical.

Body parameters

Sent as JSON. Anything not listed here is ignored.

name string Required

What the category is called. Up to 255 characters. Markup and surrounding blank space are stripped, and a name left with nothing in it is refused.

Returns

The relationship category object that was added.

data object

The 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.

Rate limit

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

POST
curl https://my.monicahq.com/api/v1/relationship-categories \
-X POST \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Neighbourhood"
}'
const response = await fetch('https://my.monicahq.com/api/v1/relationship-categories', {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Neighbourhood',
}),
})
const data = await response.json()
$response = Http::withToken($token)->post('https://my.monicahq.com/api/v1/relationship-categories', [
'name' => 'Neighbourhood',
]);
Response 201
{
"data": {
"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"
}
}
}

Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.