API v1
v1
View as Markdown

Delete a template

DELETE /api/v1/templates/{template}

Delete a template that no record is rendered from.

A template still rendering records is refused rather than deleted. Move those records to another template first, or stop offering this one instead, which takes it out of the way without touching anything already using it.

The last contact template of the account is refused too, because a new vault starts its owner’s contact from one.

A vault starting new records from the deleted template moves to Basic contact or Basic animal, then to the next template the product supplied, then to one of the account’s own. It loses its default only when no template of that kind is left.

The deletion is recoverable, and the slug stays taken so a link that already went out cannot later land on a different template.

Path parameters

Sent as JSON. Anything not listed here is ignored.

template uuid Required

The id of the template. A path that is not a uuid answers 404 without a query being run, so neither the slug nor a sequential number reaches anything here.

Returns

Nothing. A template still rendering records, or the last contact template, answers 422, and one belonging to somebody else answers 404.

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://my.monicahq.com/api/v1/templates/7b1c4e92-3d58-4f07-9a26-8c5b0e14d3af \
-X DELETE \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/templates/7b1c4e92-3d58-4f07-9a26-8c5b0e14d3af', {
method: 'DELETE',
headers: { Authorization: `Bearer ${token}` },
})
$response = Http::withToken($token)->delete('https://my.monicahq.com/api/v1/templates/7b1c4e92-3d58-4f07-9a26-8c5b0e14d3af');
Response 204

No content.

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