PgBeam Docs
Projects

UpdateProject

Update a project

Partially updates a project. Only provided fields are modified.

Usage

result, err := client.Projects.UpdateProject(ctx, "prj_xxx", pgbeam.UpdateProjectRequest{

  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
reqpgbeam.UpdateProjectRequestYesRequest body
req.Name*stringNoUpdated project name.
req.Description*stringNoUpdated project description.
req.Tags*[]stringNoReplacement set of user-defined project labels.
req.Status*pgbeam.ProjectStatusNo
req.AllowedCidrs*[]pgbeam.CidrEntryNoIP filtering rules as CIDR ranges with optional labels. Empty array means allow all. Both IPv4 and IPv6 CIDR notation are supported.
req.DefaultPolicyProfileID*stringNoWhen set, passthrough/human connections are enforced against this policy profile. Send an empty string to clear.
req.AgentsDisabled*boolNoProject-level kill-switch. Set true to block ALL agent-credential connections to this project (live agent sessions are dropped within seconds); set false to re-enable them. Passthrough/human connections are unaffected. Engaging the kill-switch emits a kill_switch webhook event.

Response

(*pgbeam.Project, error) — project updated.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Projects.UpdateProject(ctx, "prj_xxx", pgbeam.UpdateProjectRequest{
    Name: "my-app",
    Description: "Production database proxy",
    Tags: production,us-east-1,
    Status: pgbeam.ProjectStatus{ /* ... */ },
    AllowedCidrs: [object Object],[object Object],
    DefaultPolicyProfileID: "pol_01h455vb4pex5vsknk084sn02q",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
429Rate limited. Try again later.

On this page