## List Organizations `client.User.Organizations.List(ctx, query) (*V4PagePaginationArray[Organization], error)` **get** `/user/organizations` Lists organizations the user is associated with. ### Parameters - `query OrganizationListParams` - `Direction param.Field[OrganizationListParamsDirection]` Direction to order organizations. - `const OrganizationListParamsDirectionAsc OrganizationListParamsDirection = "asc"` - `const OrganizationListParamsDirectionDesc OrganizationListParamsDirection = "desc"` - `Match param.Field[OrganizationListParamsMatch]` Whether to match all search requirements or at least one (any). - `const OrganizationListParamsMatchAny OrganizationListParamsMatch = "any"` - `const OrganizationListParamsMatchAll OrganizationListParamsMatch = "all"` - `Name param.Field[string]` Organization name. - `Order param.Field[OrganizationListParamsOrder]` Field to order organizations by. - `const OrganizationListParamsOrderID OrganizationListParamsOrder = "id"` - `const OrganizationListParamsOrderName OrganizationListParamsOrder = "name"` - `const OrganizationListParamsOrderStatus OrganizationListParamsOrder = "status"` - `Page param.Field[float64]` Page number of paginated results. - `PerPage param.Field[float64]` Number of organizations per page. - `Status param.Field[OrganizationListParamsStatus]` Whether the user is a member of the organization or has an inivitation pending. - `const OrganizationListParamsStatusMember OrganizationListParamsStatus = "member"` - `const OrganizationListParamsStatusInvited OrganizationListParamsStatus = "invited"` ### Returns - `type Organization struct{…}` - `ID string` Identifier - `Name string` Organization name. - `Permissions []Permission` Access permissions for this User. - `Roles []string` List of roles that a user has within an organization. - `Status Status` Whether the user is a member of the organization or has an invitation pending. - `const StatusMember Status = "member"` - `const StatusInvited Status = "invited"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/user" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) page, err := client.User.Organizations.List(context.TODO(), user.OrganizationListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "name": "Cloudflare, Inc.", "permissions": [ "#zones:read" ], "roles": [ "All Privileges - Super Administrator" ], "status": "member" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ```