PgBeam
PgBeam Docs
Account

ListOrganizations

List organizations

Lists the organizations visible to the caller's credential. An organization-scoped API key (pbo_) returns exactly the organization it belongs to. A user credential (account-scoped API key or dashboard session token) returns the organizations the user is a member of, including the caller's role in each.

Usage

result, err := client.Account.ListOrganizations(ctx)

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context

Response

(*pgbeam.ListOrganizationsResponse, error): organizations visible to the caller.

Example

import pgbeam "go.pgbeam.com/sdk"

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

result, err := client.Account.ListOrganizations(ctx)
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
401Missing or invalid authentication.
429Rate limited. Try again later.

On this page