All URIs are relative to https://api.datadoghq.com
| Method | HTTP request | Description |
|---|---|---|
| createUser | POST /api/v1/user | Create a user |
| disableUser | DELETE /api/v1/user/{user_handle} | Disable a user |
| getUser | GET /api/v1/user/{user_handle} | Get user details |
| listUsers | GET /api/v1/user | List all users |
| updateUser | PUT /api/v1/user/{user_handle} | Update a user |
UserResponse createUser(body)
Create a user for your organization.
Note: Users can only be created with the admin access role if application keys belong to administrators.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.UsersApi(configuration);
let params: v1.UsersApiCreateUserRequest = {
// User | User object that needs to be created.
body: {
accessRole: "st",
disabled: false,
email: "test@datadoghq.com",
handle: "test@datadoghq.com",
name: "test user",
},
};
apiInstance
.createUser(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| body | User | User object that needs to be created. |
UserResponse
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | User created | - |
| 400 | Bad Request | - |
| 403 | Authentication error | - |
| 409 | Conflict | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserDisableResponse disableUser()
Delete a user from an organization.
Note: This endpoint can only be used with application keys belonging to administrators.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.UsersApi(configuration);
let params: v1.UsersApiDisableUserRequest = {
// string | The handle of the user.
userHandle: "test@datadoghq.com",
};
apiInstance
.disableUser(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userHandle | string | The handle of the user. | defaults to undefined |
UserDisableResponse
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | User disabled | - |
| 400 | Bad Request | - |
| 403 | Authentication error | - |
| 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserResponse getUser()
Get a user's details.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.UsersApi(configuration);
let params: v1.UsersApiGetUserRequest = {
// string | The ID of the user.
userHandle: "test@datadoghq.com",
};
apiInstance
.getUser(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userHandle | string | The ID of the user. | defaults to undefined |
UserResponse
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK for get user | - |
| 403 | Authentication error | - |
| 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserListResponse listUsers()
List all users for your organization.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.UsersApi(configuration);
apiInstance
.listUsers()
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));This endpoint does not need any parameter.
UserListResponse
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 403 | Authentication error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserResponse updateUser(body)
Update a user information.
Note: It can only be used with application keys belonging to administrators.
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";
const configuration = v1.createConfiguration();
const apiInstance = new v1.UsersApi(configuration);
let params: v1.UsersApiUpdateUserRequest = {
// string | The ID of the user.
userHandle: "test@datadoghq.com",
// User | Description of the update.
body: {
accessRole: "st",
disabled: false,
email: "test@datadoghq.com",
handle: "test@datadoghq.com",
name: "test user",
},
};
apiInstance
.updateUser(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| body | User | Description of the update. | |
| userHandle | string | The ID of the user. | defaults to undefined |
UserResponse
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | User updated | - |
| 400 | Bad Request | - |
| 403 | Authentication error | - |
| 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]