Monica
Log in
API v1
v1
View as Markdown

Get a change of template

GET QUERY /api/v1/vaults/{vault}/template-changes/{templateChange}

Say how far a change of template is, and once it has finished, what became of each record.

This endpoint answers GET and QUERY alike, and both return the same answer. GET sends the parameters in the address, QUERY in the request body. How QUERY works.

Path parameters

Path parameters go in the address. GET sends the others in the address too, QUERY sends them as JSON in the request body. Anything not listed here is ignored.

vault uuid Required

The id of the vault.

templateChange uuid Required

The id of the change, as POST /vaults/{vault}/record-kinds/{recordKind}/template-changes gives it.

Returns

The change. A vault or a change of another account answers 404.

data object

The change.

data.type string

Always template_change.

data.id uuid

The id of the change.

data.attributes object

What the change is and how far it is.

data.attributes.status string

running while some records are still waiting, then finished.

data.attributes.record_kind string

contacts, or the id of the entity type.

data.attributes.from uuid

The id of the template the records leave.

data.attributes.to uuid

The id of the template the records move onto.

data.attributes.to_version integer

The number of the version they move onto.

data.attributes.counts object

How many records the change took and what became of them.

data.attributes.counts.total integer

How many records the change took.

data.attributes.counts.done integer

How many of them have been dealt with so far.

data.attributes.counts.moved integer

How many moved. Written once the change has finished, 0 before.

data.attributes.counts.skipped integer

How many were left as they were, because they changed, were archived or were deleted after the preview. Written once the change has finished.

data.attributes.counts.failed integer

How many could not be moved. Nothing was changed on them. Written once the change has finished.

data.attributes.not_moved array

The first hundred records that were skipped or failed.

data.attributes.not_moved[] object

One record.

data.attributes.not_moved[].id uuid

The id of the record.

data.attributes.not_moved[].name string

Its name.

data.attributes.not_moved[].outcome string

skipped or failed.

data.attributes.not_moved[].reason string

Why, in a sentence for the reader.

data.attributes.created_at timestamp

When the change was confirmed.

data.attributes.ended_at timestamp

When the last record was dealt with. Null while the change runs.

data.links object

Where the change lives.

data.links.self string

The URL of the change.

Rate limit

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

GET
curl https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27 \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27');
QUERY
curl https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27 \
-X QUERY \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27', {
method: 'QUERY',
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->query('https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27');
Response 200
{
"data": {
"type": "template_change",
"id": "6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27",
"attributes": {
"status": "finished",
"record_kind": "5b8e2f1a-7c3d-4e9a-b6f0-1d2c3e4f5a6b",
"from": "3e7a1c9b-2d4f-4a6e-8b0c-5f9d1e3a7c2b",
"to": "8b3c2d1e-4f5a-4b6c-9d7e-0f1a2b3c4d5e",
"to_version": 3,
"counts": {
"total": 4,
"done": 4,
"moved": 3,
"skipped": 1,
"failed": 0
},
"not_moved": [
{
"id": "2f9c4b7e-1a3d-4e6f-8b0c-7d5a9e1f3c2b",
"name": "Bijou",
"outcome": "skipped",
"reason": "This Animal’s template changed after the preview."
}
],
"created_at": 1764079200,
"ended_at": 1764079212
},
"links": {
"self": "https://my.monicahq.com/api/v1/vaults/9f1c2b7a-4e3d-4a6b-8c5d-2e7f1a9b3c4d/template-changes/6a1d3f8c-9b2e-4c7a-a5d0-3e8f1b4c9d27"
}
}
}

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