Skip to content

Error Codes

Every error response includes a code field alongside the human-readable error message:

{
"error": "Category not found",
"code": "CATEGORY_NOT_FOUND"
}

Use code for programmatic error handling. Use error for display to end users.


CodeHTTPDescription
AUTH_REQUIRED401No session cookie and no Bearer token was provided.
AUTH_INVALID_KEY401The Bearer token does not match any active access key, or the key has expired.
AUTH_SCOPE_REQUIRED403The access key exists but lacks the required scope for this endpoint. The error message names the missing scope.

CodeHTTPDescription
VALIDATION_ERROR400The request body failed schema validation. The error message describes which field failed and why.

CodeHTTPDescription
CATEGORY_NOT_FOUND404The requested category does not exist or is not owned by the authenticated user.
CATEGORY_SIMPLE_REQUIRES_ENV_VAR400keyType is simple but envVarName was not provided.
CATEGORY_GROUP_REQUIRES_FIELDS400keyType is group but fieldDefinitions was not provided or is empty.

CodeHTTPDescription
ENTRY_NOT_FOUND404The requested entry does not exist or is not owned by the authenticated user.

CodeHTTPDescription
TWO_FACTOR_NOT_FOUND404The requested 2FA token set does not exist or is not owned by the authenticated user.

CodeHTTPDescription
ACCESS_KEY_NOT_FOUND404The requested access key does not exist or is not owned by the authenticated user.

CodeHTTPDescription
ENV_PROJECT_NOT_FOUND404The requested env project does not exist or is not owned by the authenticated user.
ENV_FILE_NOT_FOUND404The requested env file does not exist or is not owned by the authenticated user.

CodeHTTPDescription
UPLOAD_NO_FILE400The multipart form request did not contain a file field.
UPLOAD_FILE_TOO_LARGE400The uploaded file exceeds the 1 MB size limit.
UPLOAD_INVALID_TYPE400The uploaded file’s MIME type is not in the allow-list (text/*, application/json, application/x-pem-file, application/octet-stream).

CodeHTTPDescription
AI_EXTRACTION_FAILED500The AI extraction request failed due to a model error or an unprocessable prompt.

CodeHTTPDescription
INTERNAL_ERROR500An unexpected server-side error occurred. Check the server logs for details.

const res = await fetch('/api/entries/abc', {
headers: { Authorization: `Bearer ${key}` }
})
if (!res.ok) {
const { error, code } = await res.json()
switch (code) {
case 'AUTH_REQUIRED':
case 'AUTH_INVALID_KEY':
// redirect to login
break
case 'AUTH_SCOPE_REQUIRED':
// show "insufficient permissions" UI
break
case 'ENTRY_NOT_FOUND':
// show 404 state
break
default:
console.error(`[${code}] ${error}`)
}
}