For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/api/latest/organizations/list-global-orgs.md. A documentation index is available at /llms.txt.

List global orgs

GET https://api.ap1.datadoghq.com/api/v2/global_orgshttps://api.ap2.datadoghq.com/api/v2/global_orgshttps://api.datadoghq.eu/api/v2/global_orgshttps://api.ddog-gov.com/api/v2/global_orgshttps://api.us2.ddog-gov.com/api/v2/global_orgshttps://api.uk1.datadoghq.com/api/v2/global_orgshttps://api.datadoghq.com/api/v2/global_orgshttps://api.us3.datadoghq.com/api/v2/global_orgshttps://api.us5.datadoghq.com/api/v2/global_orgs

Overview

Returns organizations across regions for the authenticated user. The user_handle query parameter must match the authenticated user’s handle. This endpoint requires the user_access_read permission.

OAuth apps require the user_access_read authorization scope to access this endpoint.

Arguments

Query Strings

Name

Type

Description

user_handle [required]

string

The handle of the authenticated user.

page[limit]

integer

Maximum number of results returned.

page[cursor]

string

String to query the next page of results. This key is provided with each valid response from the API in meta.page.next_cursor.

Response

OK

Response containing organizations across regions for the authenticated user.

Expand All

Field

Type

Description

data [required]

[object]

Organizations across regions for the authenticated user.

attributes [required]

object

Attributes of an organization associated with the authenticated user.

org [required]

object

Organization information for a global organization association.

name [required]

string

The name of the organization.

public_id

string

The public identifier of the organization.

subdomain

string

The subdomain used to access the organization, if configured.

uuid [required]

uuid

The UUID of the organization.

redirect_url

string

The login URL used to switch into the organization, if available.

source_region [required]

string

The source region of the organization.

user [required]

object

User information for a global organization association.

handle [required]

string

The handle of the user.

uuid [required]

uuid

The UUID of the user.

type [required]

enum

The resource type for global user organizations. Allowed enum values: global_user_orgs

links

object

Pagination links.

next

string

Link to the next page.

prev

string

Link to the previous page.

self

string

Link to the current page.

meta

object

Response metadata object.

page

object

Paging attributes.

cursor

string

The cursor used to get the current results, if any.

limit

int32

Number of results returned.

next_cursor

string

The cursor used to get the next results, if any.

prev_cursor

string

The cursor used to get the previous results, if any.

type

enum

Type of global orgs pagination. Allowed enum values: cursor

{
  "data": [
    {
      "attributes": {
        "org": {
          "name": "Example Org",
          "public_id": "abcdef12345",
          "subdomain": "example",
          "uuid": "13d10a96-6ff2-49be-be7b-4f56ebb13335"
        },
        "redirect_url": "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335\u0026login_hint=user%40example.com",
        "source_region": "us1.prod.dog",
        "user": {
          "handle": "[email protected]",
          "uuid": "cfab5cf9-5472-48ea-a79c-a64045f4f745"
        }
      },
      "type": "global_user_orgs"
    }
  ],
  "links": {
    "next": "https://app.datadoghq.com/api/v2/[email protected]\u0026page[limit]=100\u0026page[cursor]=next-page",
    "prev": "string",
    "self": "https://app.datadoghq.com/api/v2/[email protected]\u0026page[limit]=100"
  },
  "meta": {
    "page": {
      "cursor": "",
      "limit": 100,
      "next_cursor": "next-page",
      "prev_cursor": "string",
      "type": "cursor"
    }
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

                  # Required query arguments
export user_handle="[email protected]"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/global_orgs?user_handle=${user_handle}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List global orgs returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.organizations_api import OrganizationsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OrganizationsApi(api_client)
    response = api_instance.list_global_orgs(
        user_handle="[email protected]",
    )

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List global orgs returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
p api_instance.list_global_orgs("[email protected]")

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List global orgs 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/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrganizationsApi(apiClient)
	resp, r, err := api.ListGlobalOrgs(ctx, "[email protected]", *datadogV2.NewListGlobalOrgsOptionalParameters())

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

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

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List global orgs returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrganizationsApi;
import com.datadog.api.client.v2.model.GlobalOrgsResponse;

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

    try {
      GlobalOrgsResponse result = apiInstance.listGlobalOrgs("[email protected]");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrganizationsApi#listGlobalOrgs");
      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:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List global orgs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_organizations::ListGlobalOrgsOptionalParams;
use datadog_api_client::datadogV2::api_organizations::OrganizationsAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = OrganizationsAPI::with_config(configuration);
    let resp = api
        .list_global_orgs(
            "[email protected]".to_string(),
            ListGlobalOrgsOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * List global orgs returns "OK" response
 */

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

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

const params: v2.OrganizationsApiListGlobalOrgsRequest = {
  userHandle: "[email protected]",
};

apiInstance
  .listGlobalOrgs(params)
  .then((data: v2.GlobalOrgsResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"