{"record":{"id":"ab366d4996380086","repo":"n8n-io/n8n","slug":"invalid-credential-type-credentialtype","errorCode":null,"errorMessage":"Invalid Credential type: \"${credentialType}\"","messagePattern":"Invalid Credential type: \"(.+?)\"","errorType":"exception","errorClass":"BadRequestError","httpStatus":400,"severity":"warning","filePath":"packages/cli/src/controllers/translation.controller.ts","lineNumber":31,"sourceCode":"export const NODE_HEADERS_PATH = safeJoinPath(NODES_BASE_DIR, 'dist/nodes/headers');\n\nexport declare namespace TranslationRequest {\n\texport type Credential = Request<{}, {}, {}, { credentialType: string }>;\n}\n\n@RestController('/')\nexport class TranslationController {\n\tconstructor(\n\t\tprivate readonly credentialTypes: CredentialTypes,\n\t\tprivate readonly globalConfig: GlobalConfig,\n\t) {}\n\n\t@Get('/credential-translation')\n\tasync getCredentialTranslation(req: TranslationRequest.Credential) {\n\t\tconst { credentialType } = req.query;\n\n\t\tif (!this.credentialTypes.recognizes(credentialType))\n\t\t\tthrow new BadRequestError(`Invalid Credential type: \"${credentialType}\"`);\n\n\t\tconst { defaultLocale } = this.globalConfig;\n\t\tconst translationPath = safeJoinPath(\n\t\t\tCREDENTIAL_TRANSLATIONS_DIR,\n\t\t\tdefaultLocale,\n\t\t\t`${credentialType}.json`,\n\t\t);\n\n\t\ttry {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn require(translationPath);\n\t\t} catch (error) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@Get('/node-translation-headers')\n\tasync getNodeTranslationHeaders() {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/controllers/translation.controller.ts#L13-L49","documentation":"The credential-translation endpoint validates the requested credential type against registered credential types via credentialTypes.recognizes(credentialType). An unrecognized type is rejected with 400 BadRequestError, echoing the supplied value.","triggerScenarios":"GET /credential-translation?credentialType=Foo where 'Foo' is not a registered/loaded credential type.","commonSituations":"Typo in the query param; a community/custom node providing the credential is not installed or failed to load; the credential type was renamed across versions; calling before nodes-base finished loading.","solutions":["Verify the credential type is installed and loaded (check the node/credential registry).","Correct the query param spelling/casing to match the registered type exactly.","If a custom credential, ensure the node package is installed and registered before the request."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm the type is registered before requesting its translation.\nasync function isKnownCredentialType(listCredentialTypes, type) {\n  const known = await listCredentialTypes();\n  return known.includes(type);\n}","typeGuard":"function isRegisteredCredentialType(type, knownTypes) {\n  return typeof type === 'string' && Array.isArray(knownTypes) && knownTypes.includes(type);\n}","tryCatchPattern":"try {\n  await api.get('/credential-translation', { params: { credentialType } });\n} catch (e) {\n  if (e.status === 400 && /Invalid Credential type/.test(e.message)) {\n    // fix the type name/casing or ensure the credential is loaded, then retry\n  } else { throw e; }\n}","preventionTips":["Drive the type from the loaded credential registry, not a hardcoded string.","Validate query param casing matches the registered type exactly."],"tags":["credentials","validation","i18n","nodes"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}