Skip to main content

team_memberships

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

Overview

Nameteam_memberships
TypeResource
Iddatadog.organization.team_memberships

Fields

The following fields are returned by SELECT queries:

Represents a user's association to a team

NameDatatypeDescription
idstringThe ID of a user's relationship with a team (example: TeamMembership-aeadc05e-98a8-11ec-ac2c-da7ad0900001-38835)
attributesobjectTeam membership attributes
relationshipsobjectRelationship between membership and a user
typestringTeam membership type (team_memberships) (default: team_memberships, example: team_memberships)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_team_membershipsselectteam_idpage[size], page[number], sort, filter[keyword]Get a paginated list of members for a team
create_team_membershipinsertteam_id, dataAdd a user to a team.<br /><br />Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https:​//docs.datadoghq.com/account_management/teams/manage/#team-membership).
update_team_membershipupdateteam_id, user_id, dataUpdate a user's membership attributes on a team.<br /><br />Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https:​//docs.datadoghq.com/account_management/teams/manage/#team-membership).
delete_team_membershipdeleteteam_id, user_idRemove a user from a team.<br /><br />Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https:​//docs.datadoghq.com/account_management/teams/manage/#team-membership).

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
user_idstringNone
filter[keyword]stringSearch query, can be user email or name
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 returned team memberships

SELECT examples

Get a paginated list of members for a team

SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.team_memberships
WHERE team_id = '{{ team_id }}' -- required
AND page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
AND sort = '{{ sort }}'
AND filter[keyword] = '{{ filter[keyword] }}'
;

INSERT examples

Add a user to a team.<br /><br />Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https:​//docs.datadoghq.com/account_management/teams/manage/#team-membership).

INSERT INTO datadog.organization.team_memberships (
data,
team_id
)
SELECT
'{{ data }}' /* required */,
'{{ team_id }}'
RETURNING
data,
included
;

UPDATE examples

Update a user's membership attributes on a team.<br /><br />Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https:​//docs.datadoghq.com/account_management/teams/manage/#team-membership).

UPDATE datadog.organization.team_memberships
SET
data = '{{ data }}'
WHERE
team_id = '{{ team_id }}' --required
AND user_id = '{{ user_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data,
included;

DELETE examples

Remove a user from a team.<br /><br />Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see [Team Membership documentation](https:​//docs.datadoghq.com/account_management/teams/manage/#team-membership).

DELETE FROM datadog.organization.team_memberships
WHERE team_id = '{{ team_id }}' --required
AND user_id = '{{ user_id }}' --required
;