Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerBridge/llms.txt

Use this file to discover all available pages before exploring further.

The /v2/log endpoint writes an arbitrary message to the Minecraft server console at a chosen log level. This is useful for external services that need to emit status messages, alerts, or debug output directly into the server log without executing a command. Messages are emitted through HungerBridge’s internal Logger abstraction, which maps to the server’s native logging system on both Fabric and Paper.

Request

Method: POST
Path: /v2/log
Content-Type: application/json

Headers

HeaderRequiredDescription
X-Auth-KeyYesAuthentication key from config.yamlauth.key
Content-TypeRecommendedShould be application/json

Configuration

This endpoint can be disabled in config.yaml under v2-endpoints.log. It is enabled by default.
v2-endpoints:
  log: true

Request Body

message
string
required
The text to write to the server console. The value is passed directly to the internal logger and appears as-is in the log output. A 400 error is returned only when the message field is absent from the request body entirely.
level
string
default:"info"
The log level at which to emit the message. Defaults to "info" when the field is not present in the request body. The value is uppercased before being passed to the logger, so "warn", "WARN", and "Warn" are all equivalent. Common values:
  • "info" — standard informational output (default)
  • "warn" — warning-level output
  • "error" — error-level output
  • "debug" — debug-level output (may be suppressed depending on server log configuration)
Any other string value is forwarded as-is (uppercased); behaviour depends on the underlying logging implementation.

Response

ok
boolean
required
Always true on success. The message has been handed off to the logger by the time this response is returned.

Example Response

{
  "ok": true
}

Error Responses

Statuserror fieldmessage fieldCause
400bad_requestMissing field: messageRequest body is missing or does not contain the message field
401unauthorizedInvalid X-Auth-KeyMissing or incorrect X-Auth-Key header
403forbiddenv2 log disabledEndpoint disabled via v2-endpoints.log: false
405method_not_allowedUse POSTRequest method was not POST
{
  "ok": false,
  "error": "bad_request",
  "message": "Missing field: message"
}

curl Examples

Log an info message (default level)

curl -s -X POST http://localhost:30007/v2/log \
  -H "X-Auth-Key: your-auth-key" \
  -H "Content-Type: application/json" \
  -d '{"message": "Backup started by external scheduler"}'

Log a warning

curl -s -X POST http://localhost:30007/v2/log \
  -H "X-Auth-Key: your-auth-key" \
  -H "Content-Type: application/json" \
  -d '{"message": "Disk usage above 90%", "level": "warn"}'

Log an error

curl -s -X POST http://localhost:30007/v2/log \
  -H "X-Auth-Key: your-auth-key" \
  -H "Content-Type: application/json" \
  -d '{"message": "External payment gateway unreachable", "level": "error"}'
The level field is case-insensitive — "WARN", "warn", and "Warn" are all treated identically. The value is uppercased internally before being passed to the logger.

Build docs developers (and LLMs) love