## Create Organization

`client.organizations.create(OrganizationCreateParamsbody, RequestOptionsoptions?): Organization`

**post** `/v1/organizations`

Create a new organization

### Parameters

- `body: OrganizationCreateParams`

  - `name: string`

    Organization name.

  - `billing_email?: string`

    Optional billing email. When omitted, the oldest owner's email is used.

### Returns

- `Organization`

  Organization response.

  - `id: string`

    Organization ID.

  - `billing_email: string | null`

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

  - `created_at: string`

    When the Organization was created.

  - `domains: Array<OrganizationDomain>`

    Domains associated with the organization.

    - `id: string`

      Domain ID.

    - `domain: string`

      Domain name.

    - `verified: boolean`

      Whether the domain has been verified.

  - `metronome_customer_id: string | null`

    Metronome customer ID.

  - `name: string`

    Organization name.

  - `personal: boolean`

    Whether the organization is a personal Organization.

  - `services: OrganizationServices`

    Services that the Organization has access to.

    - `cloud: boolean`

      Whether cloud services are enabled for the organization.

    - `jit_provisioning: boolean`

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

    - `scim: boolean`

      Whether SCIM provisioning is enabled for the organization.

    - `siem: boolean`

      Whether SIEM integration is enabled for the organization.

    - `sso: boolean`

      Whether single sign-on is enabled for the organization.

  - `stripe_customer_id: string | null`

    Stripe customer ID.

  - `type: OrganizationType`

    Organization type.

    - `"personal"`

    - `"company"`

  - `updated_at: string`

    When the Organization was updated.

  - `auth_id?: string`

    Authentication provider organization ID.

### Example

```typescript
import NirvanaLabs from '@nirvana-labs/nirvana';

const client = new NirvanaLabs({
  apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
});

const organization = await client.organizations.create({ name: 'My Organization' });

console.log(organization.id);
```

#### Response

```json
{
  "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"
}
```
