API v1
v1
View as Markdown

Export the account

POST /api/v1/exports

Ask for a file holding everything in the chosen vaults, or in every vault of the account.

The file holds every contact, value, relationship, life event, reminder and file of those vaults, sensitive fields included, and it is not encrypted. Only a key holding the sensitive fields scope can ask for one: any other key answers 403. A key minted for everything does not count, the scope has to be asked for by name.

The file is prepared in the background. Ask for the export until its status is ready, then download it with GET /exports/{accountExport}/download.

An account prepares one export at a time. Asking for another while one is being prepared answers 422.

Body parameters

Sent as JSON. Anything not listed here is ignored.

vaults array Optional

The vaults to put in the file, each named by its slug or its id. Leave it out to export every vault of the account. An empty list answers 422, and a vault of another account answers 404.

Returns

The export object, being prepared.

data object

The export.

data.type string

Always account_export. 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.status string

Where the export stands: preparing, ready, failed or expired. The file is prepared in the background, and an email says when it is ready.

data.attributes.vaults array

The vaults the file holds.

data.attributes.vaults[] uuid

The id of one of those vaults. A vault deleted since the export was asked for is left out.

data.attributes.size_in_bytes integer

The size of the file in bytes, or null until it is ready.

data.attributes.ready_at timestamp

When the file was complete, as a count of seconds since 1970, or null until it is ready.

data.attributes.expires_at timestamp

When the file is deleted, seven days after it was ready unless a newer export of the account is ready first, as a count of seconds since 1970, or null until it is ready. From that moment it can no longer be downloaded.

data.attributes.created_at timestamp

When the export was asked for, as a count of seconds since 1970.

data.links object

Where to find this record.

data.links.self string

The absolute address this record is read from.

Rate limit

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

POST
curl https://my.monicahq.com/api/v1/exports \
-X POST \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"vaults": [
"9b2d4f6a-1e3c-4a5b-8c7d-0f1e2d3c4b5a"
]
}'
const response = await fetch('https://my.monicahq.com/api/v1/exports', {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
vaults: ["9b2d4f6a-1e3c-4a5b-8c7d-0f1e2d3c4b5a"],
}),
})
const data = await response.json()
$response = Http::withToken($token)->post('https://my.monicahq.com/api/v1/exports', [
'vaults' => ['9b2d4f6a-1e3c-4a5b-8c7d-0f1e2d3c4b5a'],
]);
Response 202
{
"data": {
"type": "account_export",
"id": "e7a1d9c4-3b6f-4f2a-8d15-6c0b9e2a4f73",
"attributes": {
"status": "preparing",
"vaults": [
"9b2d4f6a-1e3c-4a5b-8c7d-0f1e2d3c4b5a",
"c4e6a8b0-2d4f-4a6b-9c8d-1e3f5a7b9c0d"
],
"size_in_bytes": null,
"ready_at": null,
"expires_at": null,
"created_at": 1792310400
},
"links": {
"self": "https://my.monicahq.com/api/v1/exports/e7a1d9c4-3b6f-4f2a-8d15-6c0b9e2a4f73"
}
}
}

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