API reference
Service
Service health and the deployed version. These endpoints require no authentication.
Service health
GET/healthPublic
Returns service and PostgreSQL connectivity status.
Requires no authentication.
Response 200
statusstringrequiredValues:
okdatabasestringrequiredValues:
ok
Errors
400Invalid request503Service unavailable
curl https://api.autopic.io/healthconst res = await fetch('https://api.autopic.io/health', {
method: 'GET',
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.autopic.io/health",
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/health');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [],
]);
$data = json_decode(curl_exec($ch), true);{
"status": "ok",
"database": "ok"
}Deployed version
GET/versionPublic
Reports the commit the running binary was built from. Public and unauthenticated: checking what is deployed should not need the admin key.
Requires no authentication.
Response 200
commitstringshortCommitstringbuildTimestringdirtybooleanBuilt from a working tree with uncommitted changes.
sourcestringWhere the commit came from.
Values:
ldflags,environment,buildinfo,unavailable
curl https://api.autopic.io/versionconst res = await fetch('https://api.autopic.io/version', {
method: 'GET',
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.autopic.io/version",
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/version');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [],
]);
$data = json_decode(curl_exec($ch), true);{
"commit": "98af74ad3e1f0c2b4a5d6e7f8a9b0c1d2e3f4a5b",
"shortCommit": "98af74a",
"buildTime": "string",
"dirty": true,
"source": "ldflags"
}