gitroomhq/postiz-app · error · BadRequestException
Integration with id ${post?.integration?.id} not found
Error message
Integration with id ${post?.integration?.id} not found What it means
PostsService.validatePosts re-resolves every post's integration by id within the organization during post update/validation. A missing integration aborts validation with the offending id in the message, mirroring the create-time check but on the update path.
Source
Thrown at libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts:782
orgId: string,
posts: Array<{
integration: { id: string };
value: Array<{
content?: string;
image?: Array<{ path: string; thumbnail?: string }>;
}>;
settings?: any;
}>
) {
return Promise.all(
(posts || []).map(async (post) => {
const integration = await this._integrationService.getIntegrationById(
orgId,
post?.integration?.id
);
if (!integration) {
throw new BadRequestException(
`Integration with id ${post?.integration?.id} not found`
);
}
const provider = this._integrationManager.getSocialIntegration(
integration.providerIdentifier
);
let additionalSettings: any[] = [];
try {
additionalSettings = JSON.parse(
integration.additionalSettings || '[]'
);
} catch {
additionalSettings = [];
}
const settings = post.settings || {};View on GitHub (pinned to 0f1647f749)
Solutions
- Refresh the integrations list and reselect the channel before saving the edit
- Reconnect the social channel to create a new integration and update the post to use it
- Delete and recreate the post if the original integration is gone and republishing is acceptable
- Guard client-side: confirm the integration id exists before calling the update endpoint
Example fix
// before
await updatePost(orgId, { ...post, posts: post.posts }); // may contain dead integration id
// after
const valid = await Promise.all(post.posts.map(p => integrationExists(orgId, p.integration.id)));
if (valid.every(Boolean)) await updatePost(orgId, post); Defensive patterns
Strategy: validation
Validate before calling
const ids = new Set((await fetchIntegrations(orgId)).integrations.map((i) => i.id)); if (post.posts.every((p) => ids.has(p.integration.id))) await updatePost(orgId, post);
Try / catch
try {
await updatePost(orgId, post);
} catch (e) {
if (/Integration with id .* not found/.test(String(e?.response?.message ?? e))) {
await promptReconnectChannel();
} else throw e;
} Prevention
- Revalidate integration ids on edit-open, not just on submit
- Handle channel disconnect events by invalidating posts referencing removed integrations
When it happens
Trigger: Updating a post (type 'update' or action 'update') whose payload references an integration id that no longer exists in the organization — e.g. the channel was disconnected between scheduling and editing.
Common situations: Editing a scheduled post after the connected account was removed; integration ids from a different org leaking into update payloads; switching organizations in the UI while an editor session holds old ids.
Related errors
- Integration with id ${post.integration.id} not found
- Integration not found
- All posts must have an integration id
- Only scheduled posts that were not published yet (or drafts)
- The publish time of this post already passed, it cannot be u
AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27).
Data as JSON: /api/errors/c03c2ad9c1b0286d.
Report an issue: GitHub.