## List Organizations

`client.Organizations.List(ctx, query) (*Cursor[Organization], error)`

**get** `/v1/organizations`

List organizations

### Parameters

- `query OrganizationListParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type Organization struct{…}`

  Organization response.

  - `ID string`

    Organization ID.

  - `BillingEmail string`

    Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

  - `CreatedAt Time`

    When the Organization was created.

  - `Domains []OrganizationDomain`

    Domains associated with the organization.

    - `ID string`

      Domain ID.

    - `Domain string`

      Domain name.

    - `Verified bool`

      Whether the domain has been verified.

  - `MetronomeCustomerID string`

    Metronome customer ID.

  - `Name string`

    Organization name.

  - `Personal bool`

    Whether the organization is a personal Organization.

  - `Services OrganizationServices`

    Services that the Organization has access to.

    - `Cloud bool`

      Whether cloud services are enabled for the organization.

    - `JitProvisioning bool`

      Whether just-in-time provisioning is enabled for the organization.

    - `SCIM bool`

      Whether SCIM provisioning is enabled for the organization.

    - `SIEM bool`

      Whether SIEM integration is enabled for the organization.

    - `SSO bool`

      Whether single sign-on is enabled for the organization.

  - `StripeCustomerID string`

    Stripe customer ID.

  - `Type OrganizationType`

    Organization type.

    - `const OrganizationTypePersonal OrganizationType = "personal"`

    - `const OrganizationTypeCompany OrganizationType = "company"`

  - `UpdatedAt Time`

    When the Organization was updated.

  - `AuthID string`

    Authentication provider organization ID.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
  "github.com/nirvana-labs/nirvana-go/organizations"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Organizations.List(context.TODO(), organizations.OrganizationListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "billing_email": "billing@example.com",
      "created_at": "2025-01-01T00:00:00Z",
      "domains": [
        {
          "id": "456e7890-e89b-12d3-a456-426614174000",
          "domain": "example.com",
          "verified": true
        }
      ],
      "metronome_customer_id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "My Organization",
      "personal": false,
      "services": {
        "cloud": true,
        "jit_provisioning": true,
        "scim": false,
        "siem": false,
        "sso": false
      },
      "stripe_customer_id": "cus_1234567890",
      "type": "company",
      "updated_at": "2025-01-01T00:00:00Z",
      "auth_id": "org_01H8GQBX3Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
