API v1
v1
View as Markdown

Update a vault

PUT /api/v1/vaults/{vault}

Change what a vault is called, what it is for, and the colour it is told apart by.

Send only what changes. A name or a colour sent as null is refused with 422, and a description sent as null is cleared.

What the vault holds is untouched, and so are its place in your list and whether it is the vault records land in by default.

Parameters

Sent as JSON. Anything not listed here is ignored.

vault string Required

The vault, named either by the readable name it reports as slug or by its id. Both answer, whichever the account builds its own addresses from. A readable name is rebuilt whenever the record is renamed, and the previous one stops answering, so a client that stores a reference stores the id. A name a record has released is never given to another.

name string Optional

What the vault is called. Up to 255 characters. It cannot be null.

description string or null Optional

What the vault is for. Up to 65535 characters. Null clears it.

colour string Optional

Exactly one of #3f5fd0, #4f8a49, #9a6a24, #9a3f2b, #6b4fa8, #2f7f86, #a8447a or #4a4a52, written in lower case.

is_default boolean Optional

True makes this the vault records land in when nothing says which, and takes that over from whichever vault held it. False, or saying nothing, changes nothing: exactly one of your vaults is it while you have a vault at all, so there would be nothing to hand it to.

structure_version_id integer Optional

The published version of one of your active contact templates. A new contact in this vault starts from it. Contacts already created keep the version they were created on. A draft, a version belonging to somebody else, and a version describing something other than a contact are each refused.

Returns

The vault object as it now reads. A vault belonging to somebody else answers 404 and is left as it was.

data object

The vault.

data.type string

Always vault. 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.slug string

The readable name the vault is addressed by, built from its name and unique within your account. It is not stable: renaming the vault rebuilds it and the previous one stops answering, which is why a stored reference should be the id. Nothing lets you choose or edit it.

data.attributes.name string

What the vault is called. Up to 255 characters. Reduced to plain text when it was written down, so no markup survives here.

data.attributes.description string

What the vault is for, up to 65535 characters, or null when nobody said. Null is the ordinary state of a vault nobody described, not a sign of anything missing.

data.attributes.colour string

Exactly one of #3f5fd0, #4f8a49, #9a6a24, #9a3f2b, #6b4fa8, #2f7f86, #a8447a or #4a4a52, written in lower case. It is how vaults are told apart at a glance, and it is decoration: nothing depends on it.

data.attributes.position integer

Where the vault sits in your list, counting from 1. It is the order you arranged, and it is the order the list endpoint answers in.

data.attributes.is_default boolean

Whether records land here when nothing says which vault. Exactly one of your vaults is true while you hold a vault at all, and none is while you hold none.

data.attributes.contact_count integer

How many contacts the vault holds, counting the archived and the partial ones. It is a running count kept as contacts are written down and deleted, rather than something counted when you ask.

data.attributes.created_at timestamp

When the vault was opened, as a count of seconds since 1970 rather than a written date.

data.attributes.updated_at timestamp

When its wording last changed, as a count of seconds. Equal to created_at until it first changes.

data.links object

Where to find this record.

data.links.self string

The absolute address this record is read from.

data.links.web string

The page of the vault in the application, which opens for somebody signed in rather than for a key. It is the link to give a person.

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/vaults/9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31 \
-X PUT \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Scranton",
"description": "The branch, and everybody who walks through it.",
"colour": "#9a3f2b"
}'
const response = await fetch('https://my.monicahq.com/api/v1/vaults/9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31', {
method: 'PUT',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Scranton',
description: 'The branch, and everybody who walks through it.',
colour: '#9a3f2b',
}),
})
const data = await response.json()
$response = Http::withToken($token)->put('https://my.monicahq.com/api/v1/vaults/9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31', [
'name' => 'Scranton',
'description' => 'The branch, and everybody who walks through it.',
'colour' => '#9a3f2b',
]);
Response 200
{
"data": {
"type": "vault",
"id": "9d4f1c2e-7b3a-4f88-9a2d-6c1e5b0f7a31",
"attributes": {
"slug": "dunder-mifflin",
"name": "Dunder Mifflin",
"description": "Everybody at the Scranton branch.",
"colour": "#4f8a49",
"position": 1,
"is_default": true,
"contact_count": 12,
"created_at": 1756252800,
"updated_at": 1756339200
},
"links": {
"self": "https://my.monicahq.com/api/v1/vaults/dunder-mifflin",
"web": "https://my.monicahq.com/vaults/dunder-mifflin"
}
}
}

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