# Orgs ## List organizations `client.Orgs.List(ctx) (*OrgListResponse, error)` **get** `/v0/orgs` List organizations accessible to the current authentication method. ### Returns - `type OrgListResponse struct{…}` - `Data []Org` - `DisplayName string` - `EnableAICommitMessages bool` - `Object OrgObject` - `const OrgObjectOrg OrgObject = "org"` - `Slug string` - `HasMore bool` - `NextCursor string` ### Example ```go package main import ( "context" "fmt" "github.com/stainless-api/stainless-api-go" "github.com/stainless-api/stainless-api-go/option" ) func main() { client := stainless.NewClient( option.WithAPIKey("My API Key"), ) orgs, err := client.Orgs.List(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", orgs.Data) } ``` #### Response ```json { "data": [ { "display_name": "display_name", "enable_ai_commit_messages": true, "object": "org", "slug": "slug" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Retrieve an organization `client.Orgs.Get(ctx, org) (*Org, error)` **get** `/v0/orgs/{org}` Retrieve an organization by name. ### Parameters - `org string` ### Returns - `type Org struct{…}` - `DisplayName string` - `EnableAICommitMessages bool` - `Object OrgObject` - `const OrgObjectOrg OrgObject = "org"` - `Slug string` ### Example ```go package main import ( "context" "fmt" "github.com/stainless-api/stainless-api-go" "github.com/stainless-api/stainless-api-go/option" ) func main() { client := stainless.NewClient( option.WithAPIKey("My API Key"), ) org, err := client.Orgs.Get(context.TODO(), "org") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", org.DisplayName) } ``` #### Response ```json { "display_name": "display_name", "enable_ai_commit_messages": true, "object": "org", "slug": "slug" } ``` ## Domain Types ### Org - `type Org struct{…}` - `DisplayName string` - `EnableAICommitMessages bool` - `Object OrgObject` - `const OrgObjectOrg OrgObject = "org"` - `Slug string`