---
title: Create a child organization
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Organizations
---

# Create a child organization{% #create-a-child-organization %}
Copy pageCopied
{% tab title="v1" %}

| Datadog site      | API endpoint                                  |
| ----------------- | --------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v1/org |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v1/org |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v1/org      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v1/org      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v1/org  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v1/org     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v1/org |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v1/org |

### Overview



Create a child organization.

This endpoint requires the [multi-organization account](https://docs.datadoghq.com/account_management/multi_organization.md) feature and must be enabled by [contacting support](https://docs.datadoghq.com/help/).

Once a new child organization is created, you can interact with it by using the `org.public_id`, `api_key.key`, and `application_key.hash` provided in the response.
This endpoint requires the `org_management` permission.


### Request

#### Body Data (required)

Organization object that needs to be created

{% tab title="Model" %}

| Parent field | Field                  | Type   | Description                                                            |
| ------------ | ---------------------- | ------ | ---------------------------------------------------------------------- |
|              | billing                | object | **DEPRECATED**: A JSON array of billing type.                          |
| billing      | type                   | string | The type of billing. Only `parent_billing` is supported.               |
|              | name [*required*] | string | The name of the new child-organization, limited to 32 characters.      |
|              | subscription           | object | **DEPRECATED**: Subscription definition.                               |
| subscription | type                   | string | The subscription type. Types available are `trial`, `free`, and `pro`. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "billing": {
    "type": "string"
  },
  "name": "New child org",
  "subscription": {
    "type": "string"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response object for an organization creation.

| Parent field                  | Field                         | Type     | Description                                                                                                                                                                                                 |
| ----------------------------- | ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | api_key                       | object   | Datadog API key.                                                                                                                                                                                            |
| api_key                       | created                       | string   | Date of creation of the API key.                                                                                                                                                                            |
| api_key                       | created_by                    | string   | Datadog user handle that created the API key.                                                                                                                                                               |
| api_key                       | key                           | string   | API key.                                                                                                                                                                                                    |
| api_key                       | name                          | string   | Name of your API key.                                                                                                                                                                                       |
|                               | application_key               | object   | An application key with its associated metadata.                                                                                                                                                            |
| application_key               | hash                          | string   | Hash of an application key.                                                                                                                                                                                 |
| application_key               | name                          | string   | Name of an application key.                                                                                                                                                                                 |
| application_key               | owner                         | string   | Owner of an application key.                                                                                                                                                                                |
|                               | org                           | object   | Create, edit, and manage organizations.                                                                                                                                                                     |
| org                           | billing                       | object   | **DEPRECATED**: A JSON array of billing type.                                                                                                                                                               |
| billing                       | type                          | string   | The type of billing. Only `parent_billing` is supported.                                                                                                                                                    |
| org                           | created                       | string   | Date of the organization creation.                                                                                                                                                                          |
| org                           | description                   | string   | Description of the organization.                                                                                                                                                                            |
| org                           | name                          | string   | The name of the child organization, limited to 32 characters.                                                                                                                                               |
| org                           | public_id                     | string   | The `public_id` of the organization you are operating within.                                                                                                                                               |
| org                           | settings                      | object   | A JSON array of settings.                                                                                                                                                                                   |
| settings                      | private_widget_share          | boolean  | Whether or not the organization users can share widgets outside of Datadog.                                                                                                                                 |
| settings                      | saml                          | object   | Set the boolean property enabled to enable or disable single sign on with SAML. See the SAML documentation for more information about all SAML settings.                                                    |
| saml                          | enabled                       | boolean  | Whether or not SAML is enabled for this organization.                                                                                                                                                       |
| settings                      | saml_autocreate_access_role   | enum     | The access role of the user. Options are **st** (standard user), **adm** (admin user), or **ro** (read-only user). Allowed enum values: `st,adm,ro,ERROR`                                                   |
| settings                      | saml_autocreate_users_domains | object   | Has two properties, `enabled` (boolean) and `domains`, which is a list of domains without the @ symbol.                                                                                                     |
| saml_autocreate_users_domains | domains                       | [string] | List of domains where the SAML automated user creation is enabled.                                                                                                                                          |
| saml_autocreate_users_domains | enabled                       | boolean  | Whether or not the automated user creation based on SAML domain is enabled.                                                                                                                                 |
| settings                      | saml_can_be_enabled           | boolean  | Whether or not SAML can be enabled for this organization.                                                                                                                                                   |
| settings                      | saml_idp_endpoint             | string   | Identity provider endpoint for SAML authentication.                                                                                                                                                         |
| settings                      | saml_idp_initiated_login      | object   | Has one property enabled (boolean).                                                                                                                                                                         |
| saml_idp_initiated_login      | enabled                       | boolean  | Whether SAML IdP initiated login is enabled, learn more in the [SAML documentation](https://docs.datadoghq.com/account_management/saml.md#idp-initiated-login).                                             |
| settings                      | saml_idp_metadata_uploaded    | boolean  | Whether or not a SAML identity provider metadata file was provided to the Datadog organization.                                                                                                             |
| settings                      | saml_login_url                | string   | URL for SAML logging.                                                                                                                                                                                       |
| settings                      | saml_strict_mode              | object   | Has one property enabled (boolean).                                                                                                                                                                         |
| saml_strict_mode              | enabled                       | boolean  | Whether or not the SAML strict mode is enabled. If true, all users must log in with SAML. Learn more on the [SAML Strict documentation](https://docs.datadoghq.com/account_management/saml.md#saml-strict). |
| org                           | subscription                  | object   | **DEPRECATED**: Subscription definition.                                                                                                                                                                    |
| subscription                  | type                          | string   | The subscription type. Types available are `trial`, `free`, and `pro`.                                                                                                                                      |
| org                           | trial                         | boolean  | Only available for MSP customers. Allows child organizations to be created on a trial plan.                                                                                                                 |
|                               | user                          | object   | Create, edit, and disable users.                                                                                                                                                                            |
| user                          | access_role                   | enum     | The access role of the user. Options are **st** (standard user), **adm** (admin user), or **ro** (read-only user). Allowed enum values: `st,adm,ro,ERROR`                                                   |
| user                          | disabled                      | boolean  | The new disabled status of the user.                                                                                                                                                                        |
| user                          | email                         | string   | The new email of the user.                                                                                                                                                                                  |
| user                          | handle                        | string   | The user handle, must be a valid email.                                                                                                                                                                     |
| user                          | icon                          | string   | Gravatar icon associated to the user.                                                                                                                                                                       |
| user                          | name                          | string   | The name of the user.                                                                                                                                                                                       |
| user                          | verified                      | boolean  | Whether or not the user logged in Datadog at least once.                                                                                                                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "api_key": {
    "created": "2019-08-02 15:31:07",
    "created_by": "john@example.com",
    "key": "1234512345123456abcabc912349abcd",
    "name": "example user"
  },
  "application_key": {
    "hash": "1234512345123459cda4eb9ced49a3d84fd0138c",
    "name": "example user",
    "owner": "example.com"
  },
  "org": {
    "billing": {
      "type": "string"
    },
    "created": "2019-09-26T17:28:28Z",
    "description": "some description",
    "name": "New child org",
    "public_id": "abcdef12345",
    "settings": {
      "private_widget_share": false,
      "saml": {
        "enabled": false
      },
      "saml_autocreate_access_role": "ro",
      "saml_autocreate_users_domains": {
        "domains": [
          "example.com"
        ],
        "enabled": false
      },
      "saml_can_be_enabled": false,
      "saml_idp_endpoint": "https://my.saml.endpoint",
      "saml_idp_initiated_login": {
        "enabled": false
      },
      "saml_idp_metadata_uploaded": false,
      "saml_login_url": "https://my.saml.login.url",
      "saml_strict_mode": {
        "enabled": false
      }
    },
    "subscription": {
      "type": "string"
    },
    "trial": false
  },
  "user": {
    "access_role": "ro",
    "disabled": false,
    "email": "test@datadoghq.com",
    "handle": "test@datadoghq.com",
    "icon": "/path/to/matching/gravatar/icon",
    "name": "test user",
    "verified": true
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v1/org" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "billing": {
    "type": "parent_billing"
  },
  "name": "New child org",
  "subscription": {
    "type": "pro"
  }
}
EOF 
                
##### 

```python
"""
Create a child organization returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.organizations_api import OrganizationsApi
from datadog_api_client.v1.model.organization_billing import OrganizationBilling
from datadog_api_client.v1.model.organization_create_body import OrganizationCreateBody
from datadog_api_client.v1.model.organization_subscription import OrganizationSubscription

body = OrganizationCreateBody(
    billing=OrganizationBilling(
        type="parent_billing",
    ),
    name="New child org",
    subscription=OrganizationSubscription(
        type="pro",
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OrganizationsApi(api_client)
    response = api_instance.create_child_org(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Create a child organization returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::OrganizationsAPI.new

body = DatadogAPIClient::V1::OrganizationCreateBody.new({
  billing: DatadogAPIClient::V1::OrganizationBilling.new({
    type: "parent_billing",
  }),
  name: "New child org",
  subscription: DatadogAPIClient::V1::OrganizationSubscription.new({
    type: "pro",
  }),
})
p api_instance.create_child_org(body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Create a child organization returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	body := datadogV1.OrganizationCreateBody{
		Billing: &datadogV1.OrganizationBilling{
			Type: datadog.PtrString("parent_billing"),
		},
		Name: "New child org",
		Subscription: &datadogV1.OrganizationSubscription{
			Type: datadog.PtrString("pro"),
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewOrganizationsApi(apiClient)
	resp, r, err := api.CreateChildOrg(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.CreateChildOrg`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.CreateChildOrg`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Create a child organization returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.OrganizationsApi;
import com.datadog.api.client.v1.model.OrganizationBilling;
import com.datadog.api.client.v1.model.OrganizationCreateBody;
import com.datadog.api.client.v1.model.OrganizationCreateResponse;
import com.datadog.api.client.v1.model.OrganizationSubscription;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);

    OrganizationCreateBody body =
        new OrganizationCreateBody()
            .billing(new OrganizationBilling().type("parent_billing"))
            .name("New child org")
            .subscription(new OrganizationSubscription().type("pro"));

    try {
      OrganizationCreateResponse result = apiInstance.createChildOrg(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrganizationsApi#createChildOrg");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Create a child organization returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI;
use datadog_api_client::datadogV1::model::OrganizationBilling;
use datadog_api_client::datadogV1::model::OrganizationCreateBody;
use datadog_api_client::datadogV1::model::OrganizationSubscription;

#[tokio::main]
async fn main() {
    let body = OrganizationCreateBody::new("New child org".to_string())
        .billing(OrganizationBilling::new().type_("parent_billing".to_string()))
        .subscription(OrganizationSubscription::new().type_("pro".to_string()));
    let configuration = datadog::Configuration::new();
    let api = OrganizationsAPI::with_config(configuration);
    let resp = api.create_child_org(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Create a child organization returns "OK" response
 */

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.OrganizationsApi(configuration);

const params: v1.OrganizationsApiCreateChildOrgRequest = {
  body: {
    billing: {
      type: "parent_billing",
    },
    name: "New child org",
    subscription: {
      type: "pro",
    },
  },
};

apiInstance
  .createChildOrg(params)
  .then((data: v1.OrganizationCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
