Skip to main content

Error Responses

Konifer returns JSON errors from the Assets and Rule Evaluation APIs:

{
"code": "INVALID_TRANSFORMATION",
"message": "Invalid transformation"
}

Use code to distinguish failure categories and the HTTP status to determine the general outcome. Use message for display or troubleshooting. Message wording can change; avoid parsing it to make application decisions. Konifer omits message when it has no explanation. The field also accepts JSON null.

Codes​

CodeHTTP statusMeaning
INVALID_REQUEST400Invalid request structure, JSON, metadata, rule definitions, limits, multipart parts, missing/conflicting sources, or unknown DELETE query parameters.
INVALID_PATH400Invalid asset path, entry ID, or selectors.
INVALID_TRANSFORMATION400Invalid transformation parameter, combination, limit, or unknown variant profile.
TRANSFORMATION_NOT_ALLOWED400Transformation conflicts with configured restrictions or the selected profile.
ASSET_REJECTED400Upload rules rejected the image.
ASSET_TOO_LARGE400, 413, 422An asset or request body exceeds its size limit.
INVALID_SOURCE422Invalid external source reference or response.
SOURCE_UNAVAILABLE502, 504External source retrieval failed (502) or timed out (504).
FORBIDDEN403Missing/invalid signature, disallowed image format, or forbidden external source.
NOT_FOUND404No matching asset or API route; includes a disabled Rule Evaluation API.
UNSUPPORTED_MEDIA_TYPE415Request content type must be application/json or multipart/form-data.
INTERNAL_ERROR500Unexpected server failure. The message is Internal server error.

Size errors retain their existing HTTP statuses: 413 for the request body limit, 422 for remotely retrieved assets, and 400 for asset-data limits enforced within upload processing.

An empty asset collection returns a successful response. Deleting a selection with no matches also succeeds. See Fetch Assets and Delete Assets.

Client compatibility​

The Kotlin and Java clients expose the code through KoniferResult.Failure.Http.code, alongside statusCode and message. See Handle results for examples.

The client uses ErrorCode.UNKNOWN when an older server omits the code or a newer server returns an unfamiliar value. It preserves a readable message and the HTTP status. For an empty or unreadable error body, it retains the HTTP status and uses UNKNOWN with a null message. Konifer does not emit UNKNOWN as a server error code.

Handle unfamiliar codes with a fallback based on the HTTP status. Proxies and storage/CDN delivery hosts can return their own response formats. Once content streaming has started, a connection failure cannot become a JSON error. Health endpoints retain their own response format; see Health.