Skip to main content

orgs

Creates, updates, deletes, gets or lists an orgs resource.

Overview

Nameorgs
TypeResource
Iddatadog.organization.orgs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the child organization, limited to 32 characters. (example: New child org)
public_idstringThe public_id of the organization you are operating within. (example: abcdef12345)
billingobjectA JSON array of billing type.
createdstringDate of the organization creation. (example: 2019-09-26T17:28:28Z)
descriptionstringDescription of the organization. (example: some description)
settingsobjectA JSON array of settings.
subscriptionobjectSubscription definition.
trialbooleanOnly available for MSP customers. Allows child organizations to be created on a trial plan.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_orgselectpublic_idGet organization information.
list_orgsselectfilter[name]Returns the current organization and its managed organizations in JSON:API format.
create_child_orginsertnameCreate a child organization.<br /><br />This endpoint requires the<br />[multi-organization account](https:​//docs.datadoghq.com/account_management/multi_organization/)<br />feature and must be enabled by<br />[contacting support](https:​//docs.datadoghq.com/help/).<br /><br />Once a new child organization is created, you can interact with it<br />by using the org.public_id, api_key.key, and<br />application_key.hash provided in the response.
update_orgreplacepublic_idUpdate your organization.
disable_customer_orgexecdataDisable the Datadog organization associated with the authenticated user or API key.<br />The request body uses JSON:API format. If org_uuid is supplied, it must match<br />the authenticated org or the request is rejected. Successful calls disable the org<br />and return the resulting state from the downstream service. Requires the<br />org_management permission.
downgrade_orgexecpublic_idOnly available for MSP customers. Removes a child organization from the hierarchy of the master organization and places the child organization on a 30-day trial.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
public_idstringThe public_id of the organization you are operating within.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
filter[name]stringFilter managed organizations by name. (example: My Child Org)

SELECT examples

Get organization information.

SELECT
name,
public_id,
billing,
created,
description,
settings,
subscription,
trial
FROM datadog.organization.orgs
WHERE public_id = '{{ public_id }}' -- required
;

INSERT examples

Create a child organization.<br /><br />This endpoint requires the<br />[multi-organization account](https:​//docs.datadoghq.com/account_management/multi_organization/)<br />feature and must be enabled by<br />[contacting support](https:​//docs.datadoghq.com/help/).<br /><br />Once a new child organization is created, you can interact with it<br />by using the org.public_id, api_key.key, and<br />application_key.hash provided in the response.

INSERT INTO datadog.organization.orgs (
billing,
name,
subscription
)
SELECT
'{{ billing }}',
'{{ name }}' /* required */,
'{{ subscription }}'
RETURNING
api_key,
application_key,
org,
user
;

REPLACE examples

Update your organization.

REPLACE datadog.organization.orgs
SET
billing = '{{ billing }}',
description = '{{ description }}',
name = '{{ name }}',
public_id = '{{ public_id }}',
settings = '{{ settings }}',
subscription = '{{ subscription }}',
trial = {{ trial }}
WHERE
public_id = '{{ public_id }}' --required
RETURNING
org;

Lifecycle Methods

EXEC variables use wire (API) names.

Disable the Datadog organization associated with the authenticated user or API key.<br />The request body uses JSON:API format. If org_uuid is supplied, it must match<br />the authenticated org or the request is rejected. Successful calls disable the org<br />and return the resulting state from the downstream service. Requires the<br />org_management permission.

EXEC datadog.organization.orgs.disable_customer_org
@@json=
'{
"data": "{{ data }}"
}'
;