Monica
Log in
API v1
v1
View as Markdown

Check status

GET QUERY /api/v1/status no token

Tells you whether the instance is up and which release it runs. No token needed, so you can point a monitor at it.

This endpoint answers GET and QUERY alike. It takes no parameters, so both requests return the same answer. How QUERY works.

Returns

The state of the instance, or a 503 status when something it depends on is unreachable.

status string

Always ok in this answer. An instance that cannot reach its database answers 503 instead, carrying status of error and nothing else, and one that is not running answers nothing at all. Those three are what a monitor watches for.

version string

The release the instance runs, as a semantic version such as 3.0.0. It is how a caller can tell whether a capability it needs has landed here yet.

instance string

The host answering, so a monitor watching several self hosted instances can tell them apart.

mobile object

How the Monica mobile apps sign in to this instance.

mobile.api_version integer

The version of this API the apps use. An app that needs a higher one asks for Monica to be updated.

mobile.client_id string

The identifier of the public OAuth client of the apps. Every instance holds it, created when Monica was installed or updated.

mobile.scope string

The scope the apps ask for: api, which reaches this API like a key without extra scopes.

mobile.registration_enabled boolean

Whether the instance accepts new accounts, so the app can say so before opening the registration page.

mobile.minimum_android_version string

The oldest version of the Android app this instance still works with, such as 1.2.0, or null when it accepts every version.

mobile.minimum_ios_version string

The oldest version of the iOS app this instance still works with, such as 1.2.0, or null when it accepts every version.

Rate limit

Sixty requests per minute, per address. Every answer carries the budget left in X-RateLimit-Remaining.

GET
curl https://monica-789392842564.asia-southeast1.run.app/api/v1/status
const response = await fetch('https://monica-789392842564.asia-southeast1.run.app/api/v1/status')
const data = await response.json()
$response = Http::get('https://monica-789392842564.asia-southeast1.run.app/api/v1/status');
QUERY
curl https://monica-789392842564.asia-southeast1.run.app/api/v1/status \
-X QUERY
const response = await fetch('https://monica-789392842564.asia-southeast1.run.app/api/v1/status', {
method: 'QUERY',
})
const data = await response.json()
$response = Http::query('https://monica-789392842564.asia-southeast1.run.app/api/v1/status');
Response 200
{
"status": "ok",
"version": "3.0.0",
"instance": "app.monicahq.com",
"mobile": {
"api_version": 1,
"client_id": "0198f6a4-7c2e-7d3b-9a61-5e0b4c8d2f17",
"scope": "api",
"registration_enabled": true,
"minimum_android_version": null,
"minimum_ios_version": null
}
}

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