Budibase/budibase · error · HTTPError
Webhook not found
Error message
Webhook not found
What it means
buildSchema looks up the webhook document by ctx.params.id via tryGet. Because tryGet returns null rather than throwing on a missing doc, the controller explicitly raises a 404 HTTPError when the webhook does not exist in the given workspace.
Source
Thrown at packages/server/src/api/controllers/webhook.ts:116
}
autoOutputs.properties[prop] = {
type: def.type as AutomationIOType,
description: AUTOMATION_DESCRIPTION,
}
}
await db.put(automation)
}
return await db.put(webhook)
}
export async function buildSchema(ctx: BuildSchemaCtx) {
assertSchemaWorkspace(ctx.params.instance)
await context.doInWorkspaceContext(ctx.params.instance, async () => {
const db = context.getWorkspaceDB()
const webhook = await db.tryGet<Webhook>(ctx.params.id)
if (!webhook) {
throw new HTTPError("Webhook not found", 404)
}
ctx.body = await updateWebhookSchema(ctx.request.body, webhook, db)
})
}
export async function buildSchemaWithToken(ctx: BuildSchemaWithTokenCtx) {
assertSchemaWorkspace(ctx.params.instance)
await context.doInWorkspaceContext(ctx.params.instance, async () => {
const db = context.getWorkspaceDB()
const webhook = await db.tryGet<Webhook>(ctx.params.id)
if (
!webhook?.schemaToken ||
webhook.schemaToken !== ctx.params.schemaToken
) {
throw new HTTPError("Invalid webhook schema token", 403)
}
View on GitHub (pinned to a81a902e9a)
Solutions
- Fetch the webhook list (GET /webhooks) for the workspace and use a valid webhook _id.
- Confirm the app/instance ID in the request matches the app that owns the webhook.
- Recreate the webhook if it was deleted, then retry the schema build.
- Check for typos/truncation in the webhook ID path parameter.
Defensive patterns
Strategy: try-catch
Validate before calling
const db = context.getWorkspaceDB()
const webhook = await db.tryGet<Webhook>(webhookId)
if (!webhook) throw new Error(`Webhook ${webhookId} does not exist in this workspace`) Type guard
const webhookExists = async (db: any, id: string): webhook is Webhook => Boolean(await db.tryGet<Webhook>(id))
Try / catch
try {
await api.post(`/webhooks/schema/${appId}/${webhookId}`)
} catch (e) {
if (e.status === 404 && e.message === "Webhook not found") {
const webhooks = await api.get(`/webhooks`)
// pick the correct current webhook id from webhooks
} else throw e
} Prevention
- Fetch the webhook list before calling the schema build to confirm the ID.
- Always pair the webhook ID with its owning app ID.
- Recreate webhooks instead of reusing old IDs after deletions.
- Watch for ID truncation when copying from logs/URLs.
When it happens
Trigger: POSTing to the webhook schema build endpoint with a webhook ID that is not present in the specified workspace's DB (wrong app ID, deleted webhook, ID typo).
Common situations: Using a webhook ID from a different app; webhook deleted while an external tool still holds its URL; case-sensitivity or truncation issues when copying IDs.
Related errors
- Automation not found
- Operation not found for this agent
- Custom REST template not found
- Resource not found: ${body.resourceId}
- Agent log detail not found
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/5bbd5a8d3448eebf.
Report an issue: GitHub.