API v1
v1
View as Markdown

Offer or retire a relationship type

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

Say whether a type may still be chosen when a new relationship is written.

This is the answer wherever deletion is refused. A type the product supplied cannot go, and neither can one that relationships already use, but either can be retired, which takes it out of the choice and leaves every relationship written with it reading exactly as before.

The type keeps the place it had, so offering it again puts it back where it was rather than at the end. Its wording is untouched.

Send the state you want rather than asking for a toggle, so sending the same value twice confirms it instead of inverting it.

Parameters

Sent as JSON. Anything not listed here is ignored.

relationshipType uuid Required

The id of the type. A path that is not a uuid answers 404 without a query being run.

is_active boolean Required

True to offer the type again, false to retire it.

Returns

The relationship type object in the state you asked for.

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.

PUT
curl https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48/activation \
-X PUT \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_active": "false"
}'
const response = await fetch('https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48/activation', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
is_active: 'false',
}),
})
const data = await response.json()
$response = Http::withToken($token)->put('https://my.monicahq.com/api/v1/relationship-types/c60d8f14-9a27-4b53-8e01-2d7f5c3a6b48/activation', [
'is_active' => 'false',
]);
Response 200
{
"data": {
"type": "relationship_type",
"id": "3a9c5e21-7b40-4f68-8d13-6e2f0a4b9c57",
"attributes": {
"relationship_category_id": "7d1f4a83-2c06-4e59-9b27-8f3a5d0e6c14",
"name": "Parent / Child",
"role_a": "Parent",
"role_b": "Child",
"is_symmetric": false,
"system_behavior": "genealogy_parentage",
"position": 1,
"is_system": true,
"is_active": true,
"relationship_count": 12,
"created_at": 1756252800,
"updated_at": 1756252800
},
"links": {
"self": "https://my.monicahq.com/api/v1/relationship-types/3a9c5e21-7b40-4f68-8d13-6e2f0a4b9c57"
}
}
}

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