TheDocumentation 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.
/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:POSTPath:
/v2/logContent-Type:
application/json
Headers
| Header | Required | Description |
|---|---|---|
X-Auth-Key | Yes | Authentication key from config.yaml → auth.key |
Content-Type | Recommended | Should be application/json |
Configuration
This endpoint can be disabled inconfig.yaml under v2-endpoints.log. It is enabled by default.
Request Body
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.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)
Response
Always
true on success. The message has been handed off to the logger by the time this response is returned.Example Response
Error Responses
| Status | error field | message field | Cause |
|---|---|---|---|
400 | bad_request | Missing field: message | Request body is missing or does not contain the message field |
401 | unauthorized | Invalid X-Auth-Key | Missing or incorrect X-Auth-Key header |
403 | forbidden | v2 log disabled | Endpoint disabled via v2-endpoints.log: false |
405 | method_not_allowed | Use POST | Request method was not POST |
curl Examples
Log an info message (default level)
Log a warning
Log an 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.