Monica
Log in
API v1
v1
View as Markdown

Restore an item of the trash

PUT /api/v1/vaults/{vault}/trash/{kind}/{item}/restoration

Bring one item back where it was, with everything deleted at the same time as it. A person or a group gets back the reminders their deletion stopped.

An item deleted with a person or a group still in the trash answers 422 on item, saying to restore them first. So does a relationship or a membership whose other end is in the trash, and a record whose type was deleted from the account settings.

Path parameters

Sent as JSON. Anything not listed here is ignored.

vault string Required

The vault the trash belongs to, named either by the readable name it reports as slug or by its id.

kind string Required

The kind of the item, as the list gives it: contact, entity, group, relationship, life-event, reminder, group-membership, group-note or group-file.

item uuid Required

The id of the item, as the list gives it. One not in the trash of this vault, or belonging to another account, answers 404.

Returns

What came back.

data object

The item.

data.type string

Always trash_item. 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.kind string

What the item is.

data.attributes.title string

What the item is called.

data.attributes.restored_with array

What came back with it, one entry per kind. Empty when nothing did.

data.attributes.restored_with[] object

One kind that came back.

data.attributes.restored_with[].kind string

The kind of what came back.

data.attributes.restored_with[].count integer

How many items of that kind came back.

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://monica-789392842564.asia-southeast1.run.app/api/v1/vaults/dunder-mifflin/trash/contact/7c2e9a41-5b8d-4f63-a1e0-3d94b6f2c815/restoration \
-X PUT \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://monica-789392842564.asia-southeast1.run.app/api/v1/vaults/dunder-mifflin/trash/contact/7c2e9a41-5b8d-4f63-a1e0-3d94b6f2c815/restoration', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->put('https://monica-789392842564.asia-southeast1.run.app/api/v1/vaults/dunder-mifflin/trash/contact/7c2e9a41-5b8d-4f63-a1e0-3d94b6f2c815/restoration');
Response 200
{
"data": {
"type": "trash_item",
"id": "7c2e9a41-5b8d-4f63-a1e0-3d94b6f2c815",
"attributes": {
"kind": "contact",
"title": "Jan Levinson",
"restored_with": [
{
"kind": "relationship",
"count": 1
}
]
}
}
}

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