{"record":{"id":"efea126841169355","repo":"Significant-Gravitas/AutoGPT","slug":"credentials-not-found-efea12","errorCode":null,"errorMessage":"Credentials not found","messagePattern":"Credentials not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"info","filePath":"autogpt_platform/backend/backend/api/features/integrations/router.py","lineNumber":438,"sourceCode":"    credentials = await creds_manager.store.get_creds_by_provider(user_id, provider)\n\n    return [\n        to_meta_response(cred) for cred in credentials if not is_sdk_default(cred.id)\n    ]\n\n\n@router.get(\n    \"/{provider}/credentials/{cred_id}\", summary=\"Get Specific Credential By ID\"\n)\nasync def get_credential(\n    provider: Annotated[\n        ProviderName, Path(title=\"The provider to retrieve credentials for\")\n    ],\n    cred_id: Annotated[str, Path(title=\"The ID of the credentials to retrieve\")],\n    user_id: Annotated[str, Security(get_user_id)],\n) -> CredentialsMetaResponse:\n    if is_sdk_default(cred_id):\n        raise HTTPException(\n            status_code=status.HTTP_404_NOT_FOUND, detail=\"Credentials not found\"\n        )\n    credential = await creds_manager.get(user_id, cred_id)\n    if not credential:\n        raise HTTPException(\n            status_code=status.HTTP_404_NOT_FOUND, detail=\"Credentials not found\"\n        )\n    if not provider_matches(credential.provider, provider):\n        raise HTTPException(\n            status_code=status.HTTP_404_NOT_FOUND, detail=\"Credentials not found\"\n        )\n    return to_meta_response(credential)\n\n\nclass PickerTokenResponse(BaseModel):\n    \"\"\"Short-lived OAuth access token shipped to the browser for rendering a\n    provider-hosted picker UI (e.g. Google Drive Picker). Deliberately narrow:\n    only the fields the client needs to initialize the picker widget. Issued","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/integrations/router.py#L420-L456","documentation":"GET /integrations/{provider}/credentials/{cred_id} returns 404 'Credentials not found' when the cred_id ends with the reserved SDK-default suffix '-default' (is_sdk_default). These pseudo-IDs (e.g. 'google-default', minted by sdk/builder.py) are internal defaults and must never be exposed or fetched through the API.","triggerScenarios":"GET /integrations/{provider}/credentials/{provider}-default — any cred_id whose string ends in '-default'.","commonSituations":"A client or block resolves a provider name into '{provider}-default' and tries to fetch or dereference it like a normal credential ID; SDK-generated presets leak the default ID into a graph preset that is later opened in the platform UI.","solutions":["Do not construct credential IDs by convention; list real credentials via GET /integrations/{provider}/credentials and use an actual ID","If a preset/node stores a '-default' ID, clear the credential binding and re-select a concrete credential","SDK authors: resolve default credentials inside the SDK, never pass the '-default' ID across the API boundary"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if cred_id.endswith('-default'):\n    raise ValueError(f\"{cred_id!r} is an SDK-default ID; fetch a real credential ID via GET /integrations/{provider}/credentials\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat any '-default' suffix as non-addressable through the REST API","Store only concrete credential IDs (uuid) in presets and node inputs"],"tags":["credentials","sdk","reserved-id","http-404"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}