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 (default: team, example: team)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_teamselectteam_id, regionGet a single team using the team's id.
list_teamsselectregionpage[number], page[size], sort, include, filter[keyword], filter[me], fields[team]Get all teams.
Can be used to search for teams using the filter[keyword] and filter[me] query parameters.
create_teaminsertregion, data__dataCreate a new team.
User IDs passed through the users relationship field are added to the team.
update_teamupdateteam_id, region, data__dataUpdate a team using the team's id.
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_id, regionRemove a team using the team's id.
sync_teamsexecregion, dataThis endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names.
It evaluates all current Datadog teams and compares them against teams in the GitHub organization
connected to your Datadog account, based on Datadog Team handle and GitHub Team slug
(lowercased and kebab-cased).

This operation is read-only on the GitHub side, no teams will be modified or created.

A GitHub organization must be connected to your Datadog account,
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
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
to teams in GitHub. This will not create new Teams in Datadog.

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
regionstring(default: datadoghq.com)
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)Size for a given 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
AND region = '{{ region }}' -- required
;

INSERT examples

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

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

UPDATE examples

Update a team using the team's id.
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 = '{{ data }}'
WHERE
team_id = '{{ team_id }}' --required
AND region = '{{ region }}' --required
AND data__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
AND region = '{{ region }}' --required
;

Lifecycle Methods

This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names.
It evaluates all current Datadog teams and compares them against teams in the GitHub organization
connected to your Datadog account, based on Datadog Team handle and GitHub Team slug
(lowercased and kebab-cased).

This operation is read-only on the GitHub side, no teams will be modified or created.

A GitHub organization must be connected to your Datadog account,
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
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
to teams in GitHub. This will not create new Teams in Datadog.

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