{"record":{"id":"fcc5016d75075289","repo":"portainer/portainer","slug":"invalid-resourceid","errorCode":null,"errorMessage":"Invalid ResourceID","messagePattern":"Invalid ResourceID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/http/handler/webhooks/webhook_create.go","lineNumber":27,"sourceCode":"\t\"github.com/portainer/portainer/api/internal/registryutils/access\"\n\thttperror \"github.com/portainer/portainer/pkg/libhttp/error\"\n\t\"github.com/portainer/portainer/pkg/libhttp/request\"\n\t\"github.com/portainer/portainer/pkg/libhttp/response\"\n\n\t\"github.com/google/uuid\"\n)\n\ntype webhookCreatePayload struct {\n\tResourceID string\n\tEndpointID portainer.EndpointID\n\tRegistryID portainer.RegistryID\n\t// Type of webhook (1 - service)\n\tWebhookType portainer.WebhookType\n}\n\nfunc (payload *webhookCreatePayload) Validate(r *http.Request) error {\n\tif len(payload.ResourceID) == 0 {\n\t\treturn errors.New(\"Invalid ResourceID\")\n\t}\n\tif payload.EndpointID == 0 {\n\t\treturn errors.New(\"Invalid EndpointID\")\n\t}\n\tif payload.WebhookType != portainer.ServiceWebhook {\n\t\treturn errors.New(\"Invalid WebhookType\")\n\t}\n\treturn nil\n}\n\n// @summary Create a webhook\n// @description **Access policy**: authenticated\n// @security ApiKeyAuth\n// @security jwt\n// @tags webhooks\n// @accept json\n// @produce json\n// @param body body webhookCreatePayload true \"Webhook data\"","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/http/handler/webhooks/webhook_create.go#L9-L45","documentation":"Error \"Invalid ResourceID\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/http/handler/webhooks/webhook_create.go:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}