{"record":{"id":"9895063cebd6529b","repo":"Mintplex-Labs/anything-llm","slug":"you-are-missing-required-metadata-key-value-pairs","errorCode":null,"errorMessage":"You are missing required metadata key:value pairs in your request. Required metadata key:values are ${requiredMetadata.map((v) => `'${v}'`).join(\", \")}","messagePattern":"You are missing required metadata key:value pairs in your request\\. Required metadata key:values are (.+?)'`\\)\\.join\\(\", \"\\)\\}","errorType":"http","errorClass":null,"httpStatus":422,"severity":"error","filePath":"server/endpoints/api/document/index.js","lineNumber":542,"sourceCode":"\n        if (!processingOnline) {\n          return response\n            .status(500)\n            .json({\n              success: false,\n              error: `Document processing API is not online. Request will not be processed.`,\n            })\n            .end();\n        }\n\n        if (\n          !requiredMetadata.every(\n            (reqKey) =>\n              Object.keys(metadata).includes(reqKey) && !!metadata[reqKey]\n          )\n        ) {\n          return response\n            .status(422)\n            .json({\n              success: false,\n              error: `You are missing required metadata key:value pairs in your request. Required metadata key:values are ${requiredMetadata\n                .map((v) => `'${v}'`)\n                .join(\", \")}`,\n            })\n            .end();\n        }\n\n        if (!textContent || textContent?.length === 0) {\n          return response\n            .status(422)\n            .json({\n              success: false,\n              error: `The 'textContent' key cannot have an empty value.`,\n            })\n            .end();\n        }","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/api/document/index.js#L524-L560","documentation":"Validation guard in the raw-text embed API: the request's metadata object is missing one or more required keys (at minimum 'title') or has them empty, so the endpoint responds 422 enumerating exactly which key:value pairs must be supplied.","triggerScenarios":"Thrown at server/endpoints/api/document/index.js:542 when the library encounters an invalid state.","commonSituations":"Submitting a document via the API without one or more metadata keys that the workspace configuration requires.","solutions":["Include all required metadata key:value pairs listed in the error in the request body.","Check the workspace/document schema for the required metadata keys."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}