API v1
v1
View as Markdown

Move a page

PUT /api/v1/templates/{template}/versions/{version}/pages/{page}/position

Put a tab at a given place, counting from 1.

Every page of the version is numbered from 1 again afterwards, so the positions stay a run of whole numbers with no gaps. A place past the end puts the page last rather than being refused.

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.

page uuid Required

The id of the page.

position integer Required

Where to put the page, counting from 1.

Returns

The page with the place it now holds.

data object

The page.

data.type string

Always structure_version_page. 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.key string

How the page is addressed in a browser link. It is settled when the page is added and survives every rename.

data.attributes.label string

What the tab says.

data.attributes.position integer

Where the tab sits, counting from 1.

data.attributes.sections array

The blocks placed on this page. Empty here, since these endpoints answer with the page itself rather than with what is on it. Read the version to get the whole structure.

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/templates/7b1c4e92-3d58-4f07-9a26-8c5b0e14d3af/versions/4/pages/a1f7b3c8-6e42-4d09-8b57-1c9e0f2a4d36/position \
-X PUT \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"position": 1
}'
const response = await fetch('https://my.monicahq.com/api/v1/templates/7b1c4e92-3d58-4f07-9a26-8c5b0e14d3af/versions/4/pages/a1f7b3c8-6e42-4d09-8b57-1c9e0f2a4d36/position', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
position: 1,
}),
})
const data = await response.json()
$response = Http::withToken($token)->put('https://my.monicahq.com/api/v1/templates/7b1c4e92-3d58-4f07-9a26-8c5b0e14d3af/versions/4/pages/a1f7b3c8-6e42-4d09-8b57-1c9e0f2a4d36/position', [
'position' => 1,
]);
Response 200
{
"data": {
"type": "structure_version_page",
"id": "a1f7b3c8-6e42-4d09-8b57-1c9e0f2a4d36",
"attributes": {
"key": "medical",
"label": "Medical",
"position": 2,
"sections": []
}
}
}

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