{"record":{"id":"153ea0298f2f9cc2","repo":"pulumi/pulumi","slug":"creating-organization-webhook-w","errorCode":null,"errorMessage":"creating organization webhook: %w","messagePattern":"creating organization webhook: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/org/org_webhook_new.go","lineNumber":307,"sourceCode":"\t\tformatPtr = nil\n\t}\n\n\treq := apitype.Webhook{\n\t\tOrganizationName: orgName,\n\t\tDisplayName:      name,\n\t\tPayloadURL:       webhookURL,\n\t\tActive:           c.active,\n\t\tFormat:           formatPtr,\n\t\tGroups:           groups,\n\t\tFilters:          events,\n\t}\n\tif c.secret != \"\" {\n\t\treq.Secret = c.secret\n\t}\n\n\tcreated, err := cloudBackend.Client().CreateOrgWebhook(ctx, orgName, req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating organization webhook: %w\", err)\n\t}\n\n\treturn c.output.Get()(c, created)\n}\n\nfunc (c *orgWebhookNewCmd) renderText(wh apitype.Webhook) error {\n\tfmt.Fprintf(c.w, \"Created webhook %q\\n\", wh.Name)\n\treturn nil\n}\n\nfunc (c *orgWebhookNewCmd) renderJSON(wh apitype.Webhook) error {\n\tenc := json.NewEncoder(c.w)\n\tenc.SetEscapeHTML(false)\n\tenc.SetIndent(\"\", \"  \")\n\treturn enc.Encode(toOrgWebhookJSON(wh))\n}\n\n// orgFiltersNotCoveredByGroups returns event filters not covered by selected groups.","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/org/org_webhook_new.go#L289-L325","documentation":"After building the CreateOrgWebhook request (filters, name, URL, optional secret), the command calls `cloudBackend.Client().CreateOrgWebhook(ctx, orgName, req)`. Any failure from that API call is wrapped as `creating organization webhook: %w`, keeping the server/transport error visible.","triggerScenarios":"`pulumi org webhook new` with valid local inputs when the CreateOrgWebhooks API call fails: 401/403 (no org admin rights), 404 (org not found), 400 for invalid payload (e.g. disallowed URL), or network/5xx errors.","commonSituations":"User is a member but not admin of the org, token without webhook scopes, invalid characters in --name, unreachable or rejected payload URL, transient Pulumi Cloud incidents.","solutions":["Inspect the wrapped cause; for 403, ensure your token/account can manage webhooks for that org (org admin)","Verify --name, --url, and --filters values satisfy the API (URL reachable/https, valid group/event names via --filters)","Re-authenticate with `pulumi login` for 401 causes; retry if cause is 5xx/timeout"],"exampleFix":"// before (non-admin token)\npulumi org webhook new --org my-org --name wh --url https://example.com/hook  # 403\n// after\npulumi login  # with an org admin account, then retry\npulumi org webhook new --org my-org --name wh --url https://example.com/hook","handlingStrategy":"retry","validationCode":"pulumi org list 2>/dev/null | grep -qx \"$ORG\" || { echo \"No admin access to $ORG\"; exit 1; }","typeGuard":"// n/a: server-side authorization; use a pre-flight permissions check instead","tryCatchPattern":"for i in 1 2 3; do out=$(pulumi org webhook new ... 2>&1) && break; case \"$out\" in *'creating organization webhook: '*403*) break;; esac; sleep $((2**i)); done","preventionTips":["Run with an account/token that can manage org webhooks (admin scope)","Validate --name/--url against API constraints before creating","Retry only transient (5xx/timeout) causes, not 403/400","Check status.pulumi.com for incidents"],"tags":["cli","pulumi-cloud","api-error"],"backgroundTag":"api-request-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}