Skip to main content

teams

Creates, updates, deletes, gets or lists a teams resource.

Overview

Nameteams
TypeResource
Iddatadog.organization.teams

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe team's identifier (example: aeadc05e-98a8-11ec-ac2c-da7ad0900001)
attributesobjectTeam attributes
relationshipsobjectResources related to a team
typestringTeam type (team) (default: team, example: team)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_teamselectteam_idGet a single team using the team's id.
list_teamsselectpage[number], page[size], sort, include, filter[keyword], filter[me], fields[team]Get all teams.<br />Can be used to search for teams using the filter&#91;keyword&#93; and filter&#91;me&#93; query parameters.
create_teaminsertdataCreate a new team.<br />User IDs passed through the users relationship field are added to the team.
update_teamupdateteam_id, dataUpdate a team using the team's id.<br />If the team_links relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.
delete_teamdeleteteam_idRemove a team using the team's id.
sync_teamsexecdataThis endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names.<br />It evaluates all current Datadog teams and compares them against teams in the GitHub organization<br />connected to your Datadog account, based on Datadog Team handle and GitHub Team slug<br />(lowercased and kebab-cased).<br /><br />This operation is read-only on the GitHub side, no teams will be modified or created.<br /><br />Optionally, provide selection_state to limit synchronization<br />to specific teams or organizations and their subtrees, instead<br />of syncing all teams.<br /><br />[A GitHub organization must be connected to your Datadog account](https:​//docs.datadoghq.com/integrations/github/),<br />and the GitHub App integrated with Datadog must have the Members Read permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug<br />using a normalized exact match; case is ignored and spaces are removed. No modifications are made<br />to teams in GitHub. This only creates new teams in Datadog when type is set to provision.

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
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.
team_idstringNone
fields[team]arrayList of fields that need to be fetched.
filter[keyword]stringSearch query. Can be team name, team handle, or email of team member
filter[me]booleanWhen true, only returns teams the current user belongs to
includearrayIncluded related resources optionally requested. Allowed enum values: team_links, user_team_permissions
page[number]integer (int64)Specific page number to return.
page[size]integer (int64)Number of items to return per page. The maximum allowed value is 100.
sortstringSpecifies the order of the returned teams

SELECT examples

Get a single team using the team's id.

SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.teams
WHERE team_id = '{{ team_id }}' -- required
;

INSERT examples

Create a new team.<br />User IDs passed through the users relationship field are added to the team.

INSERT INTO datadog.organization.teams (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

UPDATE examples

Update a team using the team's id.<br />If the team_links relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.

UPDATE datadog.organization.teams
SET
data = '{{ data }}'
WHERE
team_id = '{{ team_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Remove a team using the team's id.

DELETE FROM datadog.organization.teams
WHERE team_id = '{{ team_id }}' --required
;

Lifecycle Methods

EXEC variables use wire (API) names.

This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names.<br />It evaluates all current Datadog teams and compares them against teams in the GitHub organization<br />connected to your Datadog account, based on Datadog Team handle and GitHub Team slug<br />(lowercased and kebab-cased).<br /><br />This operation is read-only on the GitHub side, no teams will be modified or created.<br /><br />Optionally, provide selection_state to limit synchronization<br />to specific teams or organizations and their subtrees, instead<br />of syncing all teams.<br /><br />[A GitHub organization must be connected to your Datadog account](https:​//docs.datadoghq.com/integrations/github/),<br />and the GitHub App integrated with Datadog must have the Members Read permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug<br />using a normalized exact match; case is ignored and spaces are removed. No modifications are made<br />to teams in GitHub. This only creates new teams in Datadog when type is set to provision.

EXEC datadog.organization.teams.sync_teams
@@json=
'{
"data": "{{ data }}"
}'
;