Organizations
Incident Management is now generally available! Incident Management is now generally available!

Organizations

Create, edit, and manage your organizations. Read more about multi-org accounts.

POST https://api.datadoghq.eu/api/v1/orghttps://api.ddog-gov.com/api/v1/orghttps://api.datadoghq.com/api/v1/orghttps://api.us3.datadoghq.com/api/v1/org

Overview

Create a child organization.

This endpoint requires the multi-organization account feature and must be enabled by contacting support.

Once a new child organization is created, you can interact with it by using the org.public_id, pi_key.key, and application_key.hash provided in the response.

Request

Body Data (required)

Organization object that needs to be created

Expand All

Field

Type

Description

billing

object

DEPRECATED: A JSON array of billing type.

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.

type

string

The subscription type. Types available are trial, free, and pro.

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

Response

OK

Response object for an organization creation.

Expand All

Field

Type

Description

api_key

object

Datadog API key.

created

string

Date of creation of the API key.

created_by

string

Datadog user handle that created the API key.

key

string

API key.

name

string

Name of your API key.

application_key

object

An application key with its associated metadata.

hash

string

Hash of an application key.

name

string

Name of an application key.

owner

string

Owner of an application key.

org

object

Create, edit, and manage organizations.

billing

object

DEPRECATED: A JSON array of billing type.

type

string

The type of billing. Only parent_billing is supported.

created

string

Date of the organization creation.

description

string

Description of the organization.

name

string

The name of the new child-organization, limited to 32 characters.

public_id

string

The public_id of the organization you are operating within.

settings

object

A JSON array of settings.

private_widget_share

boolean

Whether or not the organization users can share widgets outside of Datadog.

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.

enabled

boolean

Whether or not SAML is enabled for this organization.

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

saml_autocreate_users_domains

object

Has two properties, enabled (boolean) and domains, which is a list of domains without the @ symbol.

domains

[string]

List of domains where the SAML automated user creation is enabled.

enabled

boolean

Whether or not the automated user creation based on SAML domain is enabled.

saml_can_be_enabled

boolean

Whether or not SAML can be enabled for this organization.

saml_idp_endpoint

string

Identity provider endpoint for SAML authentication.

saml_idp_initiated_login

object

Has one property enabled (boolean).

enabled

boolean

Whether SAML IdP initiated login is enabled, learn more in the SAML documentation.

saml_idp_metadata_uploaded

boolean

Whether or not a SAML identity provider metadata file was provided to the Datadog organization.

saml_login_url

string

URL for SAML logging.

saml_strict_mode

object

Has one property enabled (boolean).

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.

subscription

object

DEPRECATED: Subscription definition.

type

string

The subscription type. Types available are trial, free, and pro.

user

object

Create, edit, and disable users.

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

disabled

boolean

The new disabled status of the user.

email

email

The new email of the user.

handle

email

The user handle, must be a valid email.

icon

string

Gravatar icon associated to the user.

name

string

The name of the user.

verified

boolean

Whether or not the user logged in Datadog at least once.

{
  "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": "st",
      "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"
    }
  },
  "user": {
    "access_role": "st",
    "disabled": false,
    "email": "test@datadoghq.com",
    "handle": "test@datadoghq.com",
    "icon": "/path/to/matching/gravatar/icon",
    "name": "test user",
    "verified": true
  }
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Code Example


# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/org" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
  "name": "New child org"
}
EOF
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    if site, ok := os.LookupEnv("DD_SITE"); ok {
        ctx = context.WithValue(
            ctx,
            datadog.ContextServerVariables,
            map[string]string{"site": site},
        )
    }

    body := *datadog.NewOrganizationCreateBody("New child org") // OrganizationCreateBody | Organization object that needs to be created

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.OrganizationsApi.CreateChildOrg(ctx).Body(body).Execute()
    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)
    }
    // response from `CreateChildOrg`: OrganizationCreateResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from OrganizationsApi.CreateChildOrg:\n%s\n", response_content)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" go "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.OrganizationsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
        OrganizationCreateBody body = new OrganizationCreateBody(); // OrganizationCreateBody | Organization object that needs to be created
        try {
            OrganizationCreateResponse result = apiInstance.createChildOrg()
                .body(body)
                .execute();
            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 and then save the example to Example.java and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import organizations_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Defining the site is optional and defaults to datadoghq.com
if "DD_SITE" in os.environ:
    configuration.server_variables["site"] = os.environ["DD_SITE"]

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = organizations_api.OrganizationsApi(api_client)
    body = OrganizationCreateBody(
        billing=OrganizationBilling(
            type="type_example",
        ),
        name="New child org",
        subscription=OrganizationSubscription(
            type="type_example",
        ),
    )  # OrganizationCreateBody | Organization object that needs to be created

    # example passing only required values which don't have defaults set
    try:
        # Create a child organization
        api_response = api_instance.create_child_org(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling OrganizationsApi->create_child_org: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" python3 "example.py"
require 'time'
require 'datadog_api_client'

DatadogAPIClient::V1.configure do |config|
  # Defining the site is optional and defaults to datadoghq.com
  config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE'

  # setup authorization
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
end

api_instance = DatadogAPIClient::V1::OrganizationsApi.new
body = DatadogAPIClient::V1::OrganizationCreateBody.new({name: 'New child org'}) # OrganizationCreateBody | Organization object that needs to be created

begin
  # Create a child organization
  result = api_instance.create_child_org(body)
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling OrganizationsApi->create_child_org: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" rb "example.rb"

GET https://api.datadoghq.eu/api/v1/org/{public_id}https://api.ddog-gov.com/api/v1/org/{public_id}https://api.datadoghq.com/api/v1/org/{public_id}https://api.us3.datadoghq.com/api/v1/org/{public_id}

Overview

Get organization information.

Arguments

Path Parameters

Name

Type

Description

public_id [required]

string

The public_id of the organization you are operating within.

Response

OK

Response with an organization.

Expand All

Field

Type

Description

org

object

Create, edit, and manage organizations.

billing

object

DEPRECATED: A JSON array of billing type.

type

string

The type of billing. Only parent_billing is supported.

created

string

Date of the organization creation.

description

string

Description of the organization.

name

string

The name of the new child-organization, limited to 32 characters.

public_id

string

The public_id of the organization you are operating within.

settings

object

A JSON array of settings.

private_widget_share

boolean

Whether or not the organization users can share widgets outside of Datadog.

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.

enabled

boolean

Whether or not SAML is enabled for this organization.

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

saml_autocreate_users_domains

object

Has two properties, enabled (boolean) and domains, which is a list of domains without the @ symbol.

domains

[string]

List of domains where the SAML automated user creation is enabled.

enabled

boolean

Whether or not the automated user creation based on SAML domain is enabled.

saml_can_be_enabled

boolean

Whether or not SAML can be enabled for this organization.

saml_idp_endpoint

string

Identity provider endpoint for SAML authentication.

saml_idp_initiated_login

object

Has one property enabled (boolean).

enabled

boolean

Whether SAML IdP initiated login is enabled, learn more in the SAML documentation.

saml_idp_metadata_uploaded

boolean

Whether or not a SAML identity provider metadata file was provided to the Datadog organization.

saml_login_url

string

URL for SAML logging.

saml_strict_mode

object

Has one property enabled (boolean).

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.

subscription

object

DEPRECATED: Subscription definition.

type

string

The subscription type. Types available are trial, free, and pro.

{
  "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": "st",
      "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"
    }
  }
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Code Example


# Path parameters
export public_id="abc123"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/org/${public_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    if site, ok := os.LookupEnv("DD_SITE"); ok {
        ctx = context.WithValue(
            ctx,
            datadog.ContextServerVariables,
            map[string]string{"site": site},
        )
    }

    publicId := "abc123" // string | The `public_id` of the organization you are operating within.

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.OrganizationsApi.GetOrg(ctx, publicId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.GetOrg``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetOrg`: OrganizationResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from OrganizationsApi.GetOrg:\n%s\n", response_content)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" go "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.OrganizationsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
        String publicId = "abc123"; // String | The `public_id` of the organization you are operating within.
        try {
            OrganizationResponse result = apiInstance.getOrg(publicId)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrganizationsApi#getOrg");
            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 and then save the example to Example.java and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import organizations_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Defining the site is optional and defaults to datadoghq.com
if "DD_SITE" in os.environ:
    configuration.server_variables["site"] = os.environ["DD_SITE"]

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = organizations_api.OrganizationsApi(api_client)
    public_id = "abc123"  # str | The `public_id` of the organization you are operating within.

    # example passing only required values which don't have defaults set
    try:
        # Get organization information
        api_response = api_instance.get_org(public_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling OrganizationsApi->get_org: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" python3 "example.py"
require 'time'
require 'datadog_api_client'

DatadogAPIClient::V1.configure do |config|
  # Defining the site is optional and defaults to datadoghq.com
  config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE'

  # setup authorization
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
end

api_instance = DatadogAPIClient::V1::OrganizationsApi.new
public_id = 'abc123' # String | The `public_id` of the organization you are operating within.

begin
  # Get organization information
  result = api_instance.get_org(public_id)
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling OrganizationsApi->get_org: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" rb "example.rb"

GET https://api.datadoghq.eu/api/v1/orghttps://api.ddog-gov.com/api/v1/orghttps://api.datadoghq.com/api/v1/orghttps://api.us3.datadoghq.com/api/v1/org

Overview

List your managed organizations.

Response

OK

Response with the list of organizations.

Expand All

Field

Type

Description

orgs

[object]

Array of organization objects.

billing

object

DEPRECATED: A JSON array of billing type.

type

string

The type of billing. Only parent_billing is supported.

created

string

Date of the organization creation.

description

string

Description of the organization.

name

string

The name of the new child-organization, limited to 32 characters.

public_id

string

The public_id of the organization you are operating within.

settings

object

A JSON array of settings.

private_widget_share

boolean

Whether or not the organization users can share widgets outside of Datadog.

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.

enabled

boolean

Whether or not SAML is enabled for this organization.

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

saml_autocreate_users_domains

object

Has two properties, enabled (boolean) and domains, which is a list of domains without the @ symbol.

domains

[string]

List of domains where the SAML automated user creation is enabled.

enabled

boolean

Whether or not the automated user creation based on SAML domain is enabled.

saml_can_be_enabled

boolean

Whether or not SAML can be enabled for this organization.

saml_idp_endpoint

string

Identity provider endpoint for SAML authentication.

saml_idp_initiated_login

object

Has one property enabled (boolean).

enabled

boolean

Whether SAML IdP initiated login is enabled, learn more in the SAML documentation.

saml_idp_metadata_uploaded

boolean

Whether or not a SAML identity provider metadata file was provided to the Datadog organization.

saml_login_url

string

URL for SAML logging.

saml_strict_mode

object

Has one property enabled (boolean).

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.

subscription

object

DEPRECATED: Subscription definition.

type

string

The subscription type. Types available are trial, free, and pro.

{
  "orgs": [
    {
      "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": "st",
        "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"
      }
    }
  ]
}

Forbidden

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Code Example


# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/org" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    if site, ok := os.LookupEnv("DD_SITE"); ok {
        ctx = context.WithValue(
            ctx,
            datadog.ContextServerVariables,
            map[string]string{"site": site},
        )
    }


    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.OrganizationsApi.ListOrgs(ctx).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.ListOrgs``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListOrgs`: OrganizationListResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from OrganizationsApi.ListOrgs:\n%s\n", response_content)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" go "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.OrganizationsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
        try {
            OrganizationListResponse result = apiInstance.listOrgs()
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrganizationsApi#listOrgs");
            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 and then save the example to Example.java and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import organizations_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Defining the site is optional and defaults to datadoghq.com
if "DD_SITE" in os.environ:
    configuration.server_variables["site"] = os.environ["DD_SITE"]

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = organizations_api.OrganizationsApi(api_client)

    # example, this endpoint has no required or optional parameters
    try:
        # List your managed organizations
        api_response = api_instance.list_orgs()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling OrganizationsApi->list_orgs: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" python3 "example.py"
require 'time'
require 'datadog_api_client'

DatadogAPIClient::V1.configure do |config|
  # Defining the site is optional and defaults to datadoghq.com
  config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE'

  # setup authorization
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
end

api_instance = DatadogAPIClient::V1::OrganizationsApi.new

begin
  # List your managed organizations
  result = api_instance.list_orgs
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling OrganizationsApi->list_orgs: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" rb "example.rb"

PUT https://api.datadoghq.eu/api/v1/org/{public_id}https://api.ddog-gov.com/api/v1/org/{public_id}https://api.datadoghq.com/api/v1/org/{public_id}https://api.us3.datadoghq.com/api/v1/org/{public_id}

Overview

Update your organization.

Arguments

Path Parameters

Name

Type

Description

public_id [required]

string

The public_id of the organization you are operating within.

Request

Body Data (required)

Expand All

Field

Type

Description

billing

object

DEPRECATED: A JSON array of billing type.

type

string

The type of billing. Only parent_billing is supported.

created

string

Date of the organization creation.

description

string

Description of the organization.

name

string

The name of the new child-organization, limited to 32 characters.

public_id

string

The public_id of the organization you are operating within.

settings

object

A JSON array of settings.

private_widget_share

boolean

Whether or not the organization users can share widgets outside of Datadog.

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.

enabled

boolean

Whether or not SAML is enabled for this organization.

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

saml_autocreate_users_domains

object

Has two properties, enabled (boolean) and domains, which is a list of domains without the @ symbol.

domains

[string]

List of domains where the SAML automated user creation is enabled.

enabled

boolean

Whether or not the automated user creation based on SAML domain is enabled.

saml_can_be_enabled

boolean

Whether or not SAML can be enabled for this organization.

saml_idp_endpoint

string

Identity provider endpoint for SAML authentication.

saml_idp_initiated_login

object

Has one property enabled (boolean).

enabled

boolean

Whether SAML IdP initiated login is enabled, learn more in the SAML documentation.

saml_idp_metadata_uploaded

boolean

Whether or not a SAML identity provider metadata file was provided to the Datadog organization.

saml_login_url

string

URL for SAML logging.

saml_strict_mode

object

Has one property enabled (boolean).

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.

subscription

object

DEPRECATED: Subscription definition.

type

string

The subscription type. Types available are trial, free, and pro.

{
  "billing": {
    "type": "string"
  },
  "description": "some description",
  "name": "New child org",
  "public_id": "abcdef12345",
  "settings": {
    "private_widget_share": false,
    "saml": {
      "enabled": false
    },
    "saml_autocreate_access_role": "st",
    "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"
  }
}

Response

OK

Response with an organization.

Expand All

Field

Type

Description

org

object

Create, edit, and manage organizations.

billing

object

DEPRECATED: A JSON array of billing type.

type

string

The type of billing. Only parent_billing is supported.

created

string

Date of the organization creation.

description

string

Description of the organization.

name

string

The name of the new child-organization, limited to 32 characters.

public_id

string

The public_id of the organization you are operating within.

settings

object

A JSON array of settings.

private_widget_share

boolean

Whether or not the organization users can share widgets outside of Datadog.

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.

enabled

boolean

Whether or not SAML is enabled for this organization.

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

saml_autocreate_users_domains

object

Has two properties, enabled (boolean) and domains, which is a list of domains without the @ symbol.

domains

[string]

List of domains where the SAML automated user creation is enabled.

enabled

boolean

Whether or not the automated user creation based on SAML domain is enabled.

saml_can_be_enabled

boolean

Whether or not SAML can be enabled for this organization.

saml_idp_endpoint

string

Identity provider endpoint for SAML authentication.

saml_idp_initiated_login

object

Has one property enabled (boolean).

enabled

boolean

Whether SAML IdP initiated login is enabled, learn more in the SAML documentation.

saml_idp_metadata_uploaded

boolean

Whether or not a SAML identity provider metadata file was provided to the Datadog organization.

saml_login_url

string

URL for SAML logging.

saml_strict_mode

object

Has one property enabled (boolean).

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.

subscription

object

DEPRECATED: Subscription definition.

type

string

The subscription type. Types available are trial, free, and pro.

{
  "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": "st",
      "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"
    }
  }
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Code Example


# Path parameters
export public_id="abc123"
# Curl command curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/org/${public_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF {} EOF
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    if site, ok := os.LookupEnv("DD_SITE"); ok {
        ctx = context.WithValue(
            ctx,
            datadog.ContextServerVariables,
            map[string]string{"site": site},
        )
    }

    publicId := "abc123" // string | The `public_id` of the organization you are operating within.
    body := *datadog.NewOrganization() // Organization | 

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.OrganizationsApi.UpdateOrg(ctx, publicId).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.UpdateOrg``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateOrg`: OrganizationResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from OrganizationsApi.UpdateOrg:\n%s\n", response_content)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" go "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.OrganizationsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
        String publicId = "abc123"; // String | The `public_id` of the organization you are operating within.
        Organization body = new Organization(); // Organization | 
        try {
            OrganizationResponse result = apiInstance.updateOrg(publicId)
                .body(body)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrganizationsApi#updateOrg");
            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 and then save the example to Example.java and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import organizations_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Defining the site is optional and defaults to datadoghq.com
if "DD_SITE" in os.environ:
    configuration.server_variables["site"] = os.environ["DD_SITE"]

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = organizations_api.OrganizationsApi(api_client)
    public_id = "abc123"  # str | The `public_id` of the organization you are operating within.
    body = Organization(
        billing=OrganizationBilling(
            type="type_example",
        ),
        created="2019-09-26T17:28:28Z",
        description="some description",
        name="New child org",
        public_id="abcdef12345",
        settings=OrganizationSettings(
            private_widget_share=False,
            saml=OrganizationSettingsSaml(
                enabled=False,
            ),
            saml_autocreate_access_role=AccessRole("st"),
            saml_autocreate_users_domains=OrganizationSettingsSamlAutocreateUsersDomains(
                domains=[
                    "example.com",
                ],
                enabled=False,
            ),
            saml_can_be_enabled=False,
            saml_idp_endpoint="https://my.saml.endpoint",
            saml_idp_initiated_login=OrganizationSettingsSamlIdpInitiatedLogin(
                enabled=False,
            ),
            saml_idp_metadata_uploaded=False,
            saml_login_url="https://my.saml.login.url",
            saml_strict_mode=OrganizationSettingsSamlStrictMode(
                enabled=False,
            ),
        ),
        subscription=OrganizationSubscription(
            type="type_example",
        ),
    )  # Organization | 

    # example passing only required values which don't have defaults set
    try:
        # Update your organization
        api_response = api_instance.update_org(public_id, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling OrganizationsApi->update_org: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" python3 "example.py"
require 'time'
require 'datadog_api_client'

DatadogAPIClient::V1.configure do |config|
  # Defining the site is optional and defaults to datadoghq.com
  config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE'

  # setup authorization
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
end

api_instance = DatadogAPIClient::V1::OrganizationsApi.new
public_id = 'abc123' # String | The `public_id` of the organization you are operating within.
body = DatadogAPIClient::V1::Organization.new # Organization | 

begin
  # Update your organization
  result = api_instance.update_org(public_id, body)
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling OrganizationsApi->update_org: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" rb "example.rb"

POST https://api.datadoghq.eu/api/v1/org/{public_id}/idp_metadatahttps://api.ddog-gov.com/api/v1/org/{public_id}/idp_metadatahttps://api.datadoghq.com/api/v1/org/{public_id}/idp_metadatahttps://api.us3.datadoghq.com/api/v1/org/{public_id}/idp_metadata

Overview

There are a couple of options for updating the Identity Provider (IdP) metadata from your SAML IdP.

  • Multipart Form-Data: Post the IdP metadata file using a form post.

  • XML Body: Post the IdP metadata file as the body of the request.

Arguments

Path Parameters

Name

Type

Description

public_id [required]

string

The public_id of the organization you are operating with

Request

Body Data (required)

Response

OK

The IdP response object.

Expand All

Field

Type

Description

message [required]

string

Identity provider response.

{
  "message": "IdP metadata successfully uploaded for example org"
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Unsupported Media Type

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Code Example


# Path parameters
export public_id="abc123"
# Curl command curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/org/${public_id}/idp_metadata" \ -H "Content-Type: multipart/form-data" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF {} EOF
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import organizations_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Defining the site is optional and defaults to datadoghq.com
if "DD_SITE" in os.environ:
    configuration.server_variables["site"] = os.environ["DD_SITE"]

# Configure API key authorization: apiKeyAuth
configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY')

# Configure API key authorization: appKeyAuth
configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY')

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = organizations_api.OrganizationsApi(api_client)
    public_id = "abc123"  # str | The `public_id` of the organization you are operating with
    idp_file = open('/path/to/file', 'rb')  # file_type | The path to the XML metadata file you wish to upload.

    # example passing only required values which don't have defaults set
    try:
        # Upload IdP metadata
        api_response = api_instance.upload_id_p_for_org(public_id, idp_file)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling OrganizationsApi->upload_id_p_for_org: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" python3 "example.py"
require 'time'
require 'datadog_api_client'

DatadogAPIClient::V1.configure do |config|
  # Defining the site is optional and defaults to datadoghq.com
  config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE'

  # setup authorization
  # Configure API key authorization: apiKeyAuth
  config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"]

  # Configure API key authorization: appKeyAuth
  config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"]
end

api_instance = DatadogAPIClient::V1::OrganizationsApi.new
public_id = 'abc123' # String | The `public_id` of the organization you are operating with
idp_file = File.new('/path/to/some/file') # File | The path to the XML metadata file you wish to upload.

begin
  # Upload IdP metadata
  result = api_instance.upload_id_p_for_org(public_id, idp_file)
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling OrganizationsApi->upload_id_p_for_org: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" rb "example.rb"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := context.WithValue(
        context.Background(),
        datadog.ContextAPIKeys,
        map[string]datadog.APIKey{
            "apiKeyAuth": {
                Key: os.Getenv("DD_CLIENT_API_KEY"),
            },
            "appKeyAuth": {
                Key: os.Getenv("DD_CLIENT_APP_KEY"),
            },
        },
    )

    if site, ok := os.LookupEnv("DD_SITE"); ok {
        ctx = context.WithValue(
            ctx,
            datadog.ContextServerVariables,
            map[string]string{"site": site},
        )
    }

    publicId := "abc123" // string | The `public_id` of the organization you are operating with
    idpFile := os.NewFile(1234, "some_file") // *os.File | The path to the XML metadata file you wish to upload.

    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.OrganizationsApi.UploadIdPForOrg(ctx, publicId).IdpFile(idpFile).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.UploadIdPForOrg``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UploadIdPForOrg`: IdpResponse
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from OrganizationsApi.UploadIdPForOrg:\n%s\n", response_content)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" go "main.go"
import java.io.File;
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.OrganizationsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY"));
        secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY"));
        defaultClient.configureApiKeys(secrets);

        OrganizationsApi apiInstance = new OrganizationsApi(defaultClient);
        String publicId = "abc123"; // String | The `public_id` of the organization you are operating with
        File idpFile = new File("/path/to/file"); // File | The path to the XML metadata file you wish to upload.
        try {
            IdpResponse result = apiInstance.uploadIdPForOrg(publicId)
                .idpFile(idpFile)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrganizationsApi#uploadIdPForOrg");
            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 and then save the example to Example.java and run following commands:

              
export DD_SITE="https://api.datadoghq.euhttps://api.ddog-gov.comhttps://api.datadoghq.comhttps://api.us3.datadoghq.com" java "Example.java"