Skip to main content

current_user

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

Overview

Namecurrent_user
TypeResource
Iddatadog.organization.current_user

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_current_userselectGet the user associated with the current authentication context.<br />The response includes the user's profile attributes (name, email, handle,<br />status, MFA state), along with related resources: the user's organization,<br />assigned roles with their granted permissions, and team-scoped roles.<br />No additional permissions are required beyond valid authentication.
update_current_userupdatedataEdit the profile of the currently authenticated user. Updatable fields<br />include name, title, email, and disabled status. The id field<br />in the request body must match the authenticated user's UUID; a mismatch<br />returns a 422 error. Email address changes are recorded in the audit trail.<br />Requires the user_self_profile_write permission.

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.

SELECT examples

Get the user associated with the current authentication context.<br />The response includes the user's profile attributes (name, email, handle,<br />status, MFA state), along with related resources: the user's organization,<br />assigned roles with their granted permissions, and team-scoped roles.<br />No additional permissions are required beyond valid authentication.

SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.current_user
;

UPDATE examples

Edit the profile of the currently authenticated user. Updatable fields<br />include name, title, email, and disabled status. The id field<br />in the request body must match the authenticated user's UUID; a mismatch<br />returns a 422 error. Email address changes are recorded in the audit trail.<br />Requires the user_self_profile_write permission.

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