Health check
Overview
The HEALTH_CHECK_TOKEN parameter is used to activate the /api/v1/app/health-check endpoint, which checks the status of Passwork. To access the endpoint, a token must be provided — standard authorization is not used. If the token is not set, the endpoint is considered disabled.
Activation
In the config.env file, specify the following parameter with a value:
- config.env
HEALTH_CHECK_TOKEN=custom_token
The configuration file config.env is located in the following directories (depending on the Passwork installation choice):
- Linux —
/var/www/init/config.env - Windows Server —
C:\inetpub\wwwroot\passwork\init\config.env - Docker —
/<passwork>/conf/keys/config.env
Example request
- POST
- GET
curl --request POST \
--url "https://passwork.example.com/api/v1/app/health-check" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"token": "custom_token"
}'
curl --request GET \
--url "https://passwork.example.com/api/v1/app/health-check?token=custom_token" \
--header 'Accept: application/json'
Example output
- JSON
{"states":{"mongodb":"ok"},"errors":[]}
If the response received from Passwork is in the format:
- base64
{
"format": "base64",
"content": "eyJzdGF0ZXMiOnsibW9uZ29kYiI6Im9rIn0sImVycm9ycyI6W119"
}
You need to decode the content value:
- Linux
# Command
echo "eyJzdGF0ZXMiOnsibW9uZ29kYiI6Im9rIn0sImVycm9ycyI6W119" | base64 -d | jq .
# Output
{
"states": {
"mongodb": "ok"
},
"errors": []
}