Skip to content
FeedbackDashboard

List organizations

client.Orgs.List(ctx) (*OrgListResponse, error)
get/v0/orgs

List organizations accessible to the current authentication method.

ReturnsExpand Collapse
type OrgListResponse struct{…}
Data []Org
DisplayName string
Object OrgObject
Slug string
HasMore bool
NextCursor stringoptional
List organizations
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)
}
{
  "data": [
    {
      "display_name": "display_name",
      "object": "org",
      "slug": "slug"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}
Returns Examples
{
  "data": [
    {
      "display_name": "display_name",
      "object": "org",
      "slug": "slug"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}