API v1
v1
View as Markdown

Throw a draft away

DELETE /api/v1/templates/{template}/versions/{version}

Discard a draft and everything laid out in it.

Only a draft can be thrown away. A version that has been published is refused, because records point at it and the promise that a published version goes on working is the whole of the versioning design. Stop offering the template instead if you want it out of the way.

Nothing that was published changes, and the number the draft held is not given out again.

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.

version integer Required

The number of the version within its template, counting from 1, which is the number shown in the version history and the number a change note refers to. It is not a row id, so version 1 of one template and version 1 of another are different things reached through different templates.

Returns

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

No content.

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