team_memberships
Creates, updates, deletes, gets or lists a team_memberships resource.
Overview
| Name | team_memberships |
| Type | Resource |
| Id | datadog.organization.team_memberships |
Fields
The following fields are returned by SELECT queries:
- get_team_memberships
Represents a user's association to a team
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of a user's relationship with a team (example: TeamMembership-aeadc05e-98a8-11ec-ac2c-da7ad0900001-38835) |
attributes | object | Team membership attributes |
relationships | object | Relationship between membership and a user |
type | string | Team membership type (team_memberships) (default: team_memberships, example: team_memberships) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_team_memberships | select | team_id | page[size], page[number], sort, filter[keyword] | Get a paginated list of members for a team |
create_team_membership | insert | team_id, data | 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). | |
update_team_membership | update | team_id, user_id, data | 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). | |
delete_team_membership | delete | team_id, user_id | 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). |
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.
| Name | Datatype | Description |
|---|---|---|
site | string | The 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_id | string | None |
user_id | string | None |
filter[keyword] | string | Search 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. |
sort | string | Specifies the order of returned team memberships |
SELECT examples
- get_team_memberships
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
- create_team_membership
- Manifest
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
;
# Description fields are for documentation purposes
- name: team_memberships
props:
- name: team_id
value: "{{ team_id }}"
description: Required parameter for the team_memberships resource.
- name: data
description: |
A user's relationship with a team
value:
attributes:
provisioned_by: "{{ provisioned_by }}"
provisioned_by_id: "{{ provisioned_by_id }}"
role: "{{ role }}"
relationships:
team:
data:
id: "{{ id }}"
type: "{{ type }}"
user:
data:
id: "{{ id }}"
type: "{{ type }}"
type: "{{ type }}"
UPDATE examples
- update_team_membership
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
- delete_team_membership
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
;