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
| Parameter | Type | Required | Description |
|---|---|---|---|
| ctx | context.Context | Yes | Request 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
| Status | Description |
|---|---|
| 401 | Missing or invalid authentication. |
| 429 | Rate limited. Try again later. |