Monica
Log in
API v1
v1
View as Markdown

Delete several contacts

DELETE /api/v1/vaults/{vault}/contacts

Delete up to 500 contacts of a vault at once, each exactly as deleting it alone would.

Each contact goes as it would one by one: what it took part in is kept, its reminders go quiet and say why, private links onto its page stop opening, and the deletion is written to the account log.

The contact representing you cannot be deleted. It is kept and listed with the reason, and the others are still deleted. No endpoint here brings a contact back today, so treat the deletion as final.

Parameters

Sent as JSON. Anything not listed here is ignored.

vault string Required

The vault the contact lives in, named either by the readable name it reports as slug or by its id. Both answer.

contacts array Required

The ids or the addresses of the contacts of this vault to delete. At most 500.

Returns

Which contacts were deleted, which were kept with the reason, and which of the ids given match no contact of the vault. A vault belonging to somebody else answers 404. More than 500 contacts answers 422 on contacts, and nothing is deleted then. An id matching no contact of the vault, whether unknown or belonging to another vault, is skipped and listed in missing, and the others are still deleted. A contact already deleted is skipped and appears in neither deleted nor kept.

data object

What the deletion did.

data.type string

Always contact_deletion.

data.attributes object

Who was deleted, who was kept and which ids were not found.

data.attributes.deleted array

The contacts deleted.

data.attributes.deleted[] string

The id of one of them.

data.attributes.kept array

The contacts that could not be deleted.

data.attributes.kept[] object

One of them.

data.attributes.kept[].contact string

The id of the contact.

data.attributes.kept[].reason string

Why it was kept, in the language of the account.

data.attributes.missing array

The ids given that match no contact of this vault, as given, without repeats and in the order given.

data.attributes.missing[] string

One of them.

Rate limit

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

DELETE
curl https://monica-789392842564.asia-southeast1.run.app/api/v1/vaults/9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31/contacts \
-X DELETE \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
"c4a1f7b2-8e36-4d59-b0a7-2f5c9d81e364"
]
}'
const response = await fetch('https://monica-789392842564.asia-southeast1.run.app/api/v1/vaults/9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31/contacts', {
method: 'DELETE',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
contacts: ["c4a1f7b2-8e36-4d59-b0a7-2f5c9d81e364"],
}),
})
const data = await response.json()
$response = Http::withToken($token)->delete('https://monica-789392842564.asia-southeast1.run.app/api/v1/vaults/9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31/contacts', [
'contacts' => ['c4a1f7b2-8e36-4d59-b0a7-2f5c9d81e364'],
]);
Response 200
{
"data": {
"type": "contact_deletion",
"attributes": {
"deleted": [
"c4a1f7b2-8e36-4d59-b0a7-2f5c9d81e364"
],
"kept": [
{
"contact": "6f3c1d2e-8a4b-4c5d-9e6f-7a8b9c0d1e2f",
"reason": "This is the contact that represents you, and it stays. Everything on the record is written from its point of view."
}
],
"missing": [
"0b9d6f1a-3c2e-4d7b-8a5f-1e2d3c4b5a69"
]
}
}
}

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