PgBeam Docs
Analytics

UpdateSpendLimit

Update spend limit

Sets the monthly spend limit for an organization. Null removes the limit.

Usage

result, err := client.Analytics.UpdateSpendLimit(ctx, "org_abc123", pgbeam.UpdateSpendLimitRequest{

  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
orgIDstringYesUnique organization identifier.
reqpgbeam.UpdateSpendLimitRequestYesRequest body
req.SpendLimit*float64NoMonthly spend limit in dollars. Null to remove the limit.

Response

(*pgbeam.OrganizationPlan, error) — spend limit updated.

Example

import pgbeam "go.pgbeam.com/sdk"

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

result, err := client.Analytics.UpdateSpendLimit(ctx, "org_abc123", pgbeam.UpdateSpendLimitRequest{
    SpendLimit: 500,
  })
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.
429Rate limited. Try again later.

On this page