# Manage Datadog User Roles

Add, remove, or check a user's membership in Datadog roles, or list available roles

Manages a user's Datadog role membership from a runbook. Use it to grant a role when someone needs elevated Datadog access, remove it when they no longer do, or answer "what roles does this user have?" questions without anyone opening the Datadog admin console.

## Operations

The tool supports four operations:

- **Add** — add a user to a Datadog role
- **Remove** — remove a user from a Datadog role
- **Check** — check whether a user belongs to a specific role (read-only)
- **List roles** — list the roles available in your Datadog organization (read-only)

Roles can be referenced by **name or ID**. Add and remove are **idempotent** — adding someone who's already a member, or removing someone who isn't, succeeds cleanly rather than erroring, so runbooks don't fail on retries or repeated requests.

## Configuration

| Setting                                | Required | Description                                                                                                                                                                                                |
| -------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Datadog API Key (Optional)**         | No       | Leave empty to use the org-wide Datadog connection from **Settings → Integrations → Datadog**. Set to override with a specific key (generated at **Organization Settings → API Keys**).                    |
| **Datadog Application Key (Optional)** | No       | Leave empty to use the org-wide connection. If set, the key's owner must have the **User Access Manage** permission in Datadog (generated at **Organization Settings → Application Keys**).                |
| **Datadog Site (Optional)**            | No       | Your Datadog site host (e.g. `datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`). Leave empty to use the org-wide Datadog site.                                                                          |
| **Restrict to Requestor Only**         | No       | **Enabled by default.** The tool can only operate on the ticket requestor. Disable to allow runbooks to manage role membership for other users, for example, IT staff filing requests on someone's behalf. |

> **Note:** The requestor-only default is a safety boundary: out of the box, a runbook
> using this tool can change *the requestor's own* roles and nothing else. Only
> disable it for runbooks where IT deliberately manages other people's access,
> and pair that with appropriately restricted runbook matching.

> **Warning:** If you configure a per-tool Application Key, its owner needs the **User Access
> Manage** permission in Datadog — without it, add and remove operations fail
> with a permission error even though the credentials are otherwise valid.

## Example Runbook Uses

- Grant a requested Datadog role after approval, and remove it again on a schedule via time-based access
- Answer "do I have the right Datadog access?" by checking the user's membership in the expected role
- List available roles so the agent can disambiguate which role a vague request actually means

## Troubleshooting

### Permission error on add or remove

The Application Key's owner is missing the **User Access Manage** permission in Datadog. Grant it to the key owner, or switch the tool to the org-wide connection from **Settings → Integrations → Datadog**.

### Tool refuses to act on a user other than the requestor

That's the **Restrict to Requestor Only** default doing its job. Disable it in
the tool's configuration if this runbook is meant to manage other users'
roles.

### Role not found

Confirm the role name matches Datadog exactly, or use the role ID instead — the **list roles** operation shows both.

Source: https://www.tryrisotto.com/docs/integrations/tools/datadog/manage_user_roles
