Projects
ListProjects
List projects
Lists projects filtered by organization. Requires org_id query parameter.
Usage
result, err := client.Projects.ListProjects(ctx, &pgbeam.ListProjectsParams{
OrgID: "org_xxx",
})Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ctx | context.Context | Yes | Request context |
| params | *pgbeam.ListProjectsParams | Yes | Query parameters |
| params.OrgID | string | Yes | Organization ID to filter projects. |
| params.PageSize | int | No | Maximum number of items to return (1-100, default 20). |
| params.PageToken | string | No | Opaque token for cursor-based pagination. |
| params.SortBy | string | No | Sort field for projects list. |
Response
(*pgbeam.ListProjectsResponse, error) — list of projects.
Example
import pgbeam "github.com/pgbeam/pgbeam-go"
client := pgbeam.NewClient(&pgbeam.ClientOptions{
APIKey: "pgb_your_api_key",
})
result, err := client.Projects.ListProjects(ctx, &pgbeam.ListProjectsParams{
OrgID: "org_xxx",
PageSize: 20,
PageToken: "...",
SortBy: "...",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result)Errors
| Status | Description |
|---|---|
| 400 | Invalid request parameters. |
| 401 | Missing or invalid authentication. |
| 403 | Operation not allowed by current plan limits. |
| 429 | Rate limited. Try again later. |