current_user
Creates, updates, deletes, gets or lists a current_user resource.
Overview
| Name | current_user |
| Type | Resource |
| Id | datadog.organization.current_user |
Fields
The following fields are returned by SELECT queries:
- get_current_user
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the user. |
attributes | object | Attributes of user object returned by the API. |
relationships | object | Relationships of the user object returned by the API. |
type | string | Users resource type. (users) (default: users, example: users) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_current_user | select | 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. | ||
update_current_user | update | data | 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. |
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. |
SELECT examples
- get_current_user
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
- update_current_user
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;