{"record":{"id":"498ada23aa512546","repo":"gitroomhq/postiz-app","slug":"integration-not-found-498ada","errorCode":null,"errorMessage":"Integration not found","messagePattern":"Integration not found","errorType":"http","errorClass":"HttpException","httpStatus":404,"severity":"error","filePath":"apps/backend/src/public-api/routes/v1/public.integrations.controller.ts","lineNumber":456,"sourceCode":"      }\n    }\n\n    return this._integrationService.deleteChannel(org.id, id);\n  }\n\n  @Get('/integration-settings/:id')\n  async getIntegrationSettings(\n    @GetOrgFromRequest() org: Organization,\n    @Param('id') id: string\n  ) {\n    Sentry.metrics.count('public_api-request', 1);\n    const loadIntegration = await this._integrationService.getIntegrationById(\n      org.id,\n      id\n    );\n\n    if (!loadIntegration) {\n      throw new HttpException({ msg: 'Integration not found' }, 404);\n    }\n\n    const verified =\n      JSON.parse(loadIntegration.additionalSettings || '[]')?.find(\n        (p: any) => p?.title === 'Verified'\n      )?.value || false;\n\n    const integration = socialIntegrationList.find(\n      (p) => p.identifier === loadIntegration.providerIdentifier\n    )!;\n\n    if (!integration) {\n      return {\n        output: { rules: '', maxLength: 0, settings: {}, tools: [] as any[] },\n      };\n    }\n\n    const maxLength = integration.maxLength(verified);","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/apps/backend/src/public-api/routes/v1/public.integrations.controller.ts#L438-L474","documentation":"The public API endpoint getIntegrationSettings could not find an integration with the given id belonging to the authenticated organization. The backend calls _integrationService.getIntegrationById(org.id, id), which scopes the lookup to the organization of the API key, and any miss results in an HTTP 404 with msg 'Integration not found'. It does not distinguish 'wrong org' from 'nonexistent id', so both look identical to the caller.","triggerScenarios":"GET on the public v1 integrations settings route with an id that (a) does not exist, (b) was deleted, or (c) belongs to a different organization than the one the API key maps to. Passing an internal integration id from another workspace, or reusing an id captured before the channel was disconnected/removed, produces this 404.","commonSituations":"Hardcoding an integration id in scripts after the channel was reconnected (which creates a new integration row); copying ids between environments (staging vs production); using an org-scoped API key and assuming it can read any integration id; typos or truncated ids from the public integrations list endpoint.","solutions":["Verify the id by listing the org's integrations via the public integrations endpoint and confirm the id appears there before requesting settings","Confirm the API key / organization context matches the workspace that owns the integration","If the channel was reconnected recently, re-fetch integrations — the old id is likely stale because a reconnect creates a new integration record","Check that the integration was not deleted or disconnected by a team member in the Postiz UI"],"exampleFix":"// before\nconst settings = await publicApi.getIntegrationSettings('12345'); // 404\n\n// after\nconst list = await publicApi.listIntegrations();\nconst target = list.find((i) => i.id === '12345');\nif (!target) throw new Error(`Integration 12345 not visible to this API key`);\nconst settings = await publicApi.getIntegrationSettings(target.id);","handlingStrategy":"validation","validationCode":"const integrations = await publicApi.listIntegrations();\nconst exists = integrations.some((i) => i.id === requestedId);\nif (!exists) throw new Error(`Integration ${requestedId} not found in this org`);","typeGuard":"const isIntegration = (i: unknown, id: string): i is { id: string } =>\n  !!i && typeof i === 'object' && (i as any).id === id;","tryCatchPattern":"try {\n  await getIntegrationSettings(id);\n} catch (e: any) {\n  if (e?.status === 404) { /* refresh integration list; id is stale or wrong org */ }\n  else throw e;\n}","preventionTips":["Always resolve integration ids from a fresh listIntegrations() call rather than caching them","Scope stored ids per environment and per organization","Re-fetch ids after any channel reconnect or disconnect event"],"tags":["public-api","integration","not-found","http-404"],"backgroundTag":"resource-not-found","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}