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

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_userselectuser_id, regionGet a user in the organization specified by the user’s user_id.
list_usersselectregionpage[size], page[number], sort, sort_dir, filter, filter[status]Get the list of all users in the organization. This list includes
all users even if they are deactivated or unverified.
create_userinsertregion, data__dataCreate a user for your organization.
update_userupdateuser_id, region, data__dataEdit a user. Can only be used with an application key belonging
to an administrator user.
disable_userexecuser_id, regionDisable a user. Can only be used with an application key belonging
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
regionstring(default: datadoghq.com)
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)Size for a given 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
AND region = '{{ region }}' -- required
;

INSERT examples

Create a user for your organization.

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

UPDATE examples

Edit a user. Can only be used with an application key belonging
to an administrator user.

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

Lifecycle Methods

Disable a user. Can only be used with an application key belonging
to an administrator user.

EXEC datadog.organization.users.disable_user 
@user_id='{{ user_id }}' --required,
@region='{{ region }}' --required
;