Skip to main content

users

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

Overview

Nameusers
TypeResource
Iddatadog.organization.users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the user.
attributesobjectAttributes of user object returned by the API.
relationshipsobjectRelationships of the user object returned by the API.
typestringUsers resource type. (users) (default: users, example: users)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_userselectuser_idGet a user in the organization specified by the user’s user_id.
list_usersselectpage[size], page[number], sort, sort_dir, filter, filter[status]Get the list of all users in the organization. This list includes<br />all users even if they are deactivated or unverified.
create_userinsertdataCreate a user for your organization.
update_userupdateuser_id, dataEdit a user. Can only be used with an application key belonging<br />to an administrator user.
anonymize_usersexecdataAnonymize a list of users, removing their personal data. This operation is irreversible.<br />Requires the user_access_manage permission.
disable_userexecuser_idDisable a user. Can only be used with an application key belonging<br />to an administrator user.

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.
user_idstringThe ID of the user.
filterstringFilter all users by the given string. Defaults to no filtering.
filter[status]stringFilter on status attribute. Comma separated list, with possible values Active, Pending, and Disabled. Defaults to no filtering.
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.
sortstringUser attribute to order results by. Sort order is ascending by default. Sort order is descending if the field is prefixed by a negative sign, for example sort=-name. Options: name, modified_at, user_count.
sort_dirstringDirection of sort. Options: asc, desc.

SELECT examples

Get a user in the organization specified by the user’s user_id.

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

INSERT examples

Create a user for your organization.

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

UPDATE examples

Edit a user. Can only be used with an application key belonging<br />to an administrator user.

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

Lifecycle Methods

EXEC variables use wire (API) names.

Anonymize a list of users, removing their personal data. This operation is irreversible.<br />Requires the user_access_manage permission.

EXEC datadog.organization.users.anonymize_users
@@json=
'{
"data": "{{ data }}"
}'
;