• Home
  • How to use Dynatrace
  • Davis Assistant
  • Configuration
  • Manage users programmatically

Manage users programmatically

Learn how to automate Davis Assistant user management using the Davis Assistant API.

General requirements

  • A Dynatrace Managed environment
  • A valid, enabled Davis Assistant API token with user management permissions
  • A system with network access to Davis Assistant on port 443

Notes

  • User management in Davis Assistant is only supported for Dynatrace Managed environments.
  • Only Davis Assistant environment admins are able to manage users.

Authorization

  • All requests must include the Authorization header that includes a Davis Assistant API token.

  • Create a new Davis Assistant API token in the Davis Assistant API configuration—in Davis Assistant Web, select Configurations from the navigation menu, then Davis Assistant API. Make sure to enable Can manage users when creating the token.

    Note

    If the token is invalid, the API returns a 401 Unauthorized status code. If you're attempting to perform an action that requires administrative privileges for the selected environment and lack these privileges, the API returns a 403 Forbidden status code.

    User management API token

GET users

URLhttps://assistant.dynatrace.com/api/v2/tenant/users
MethodGET
HeaderAuthorization: api-token ${DAVIS ASSISTANT API TOKEN}
Response format
ElementTypeDescription
firstNamestringUser's first name
lastNamestringUser's last name
emailstringUser's email address
timezonestringUser's time zone in tzdata format
adminbooleanUser has administrative privileges.

Response body (Status code 200):

json
[ { "firstName": "Test", "lastName": "One", "email": "test.one@dynatrace.com", "timezone": "America/Detroit", "admin": true }, { "firstName": "Test", "lastName": "Two", "email": "test.two@dynatrace.com", "timezone": "America/Detroit", "admin": false } ]

POST user

URLhttps://assistant.dynatrace.com/api/v2/tenant/users/${EMAIL ADDRESS}
MethodPOST
HeaderContent-Type: application/json
HeaderAuthorization: api-token ${DAVIS ASSISTANT API TOKEN}
Parameters
ParameterDescriptionTypeRequired
firstNameUser's first namestringrequired
lastNameUser's last namestringrequired
emailUser's email addressstringrequired
timezoneUser's time zone in tzdata formatstringrequired
adminUser has administrative privileges.booleanrequired

Request body:

json
{ "firstName": "Test", "lastName": "Three", "timezone": "America/Detroit", "email": "test.three@dynatrace.com", "admin": true }
Response format

Response body (Status code 201):

None

PUT user

URLhttps://assistant.dynatrace.com/api/v2/tenant/users/${EMAIL ADDRESS}
MethodPUT
HeaderContent-Type: application/json
HeaderAuthorization: api-token ${DAVIS ASSISTANT API TOKEN}
Parameters
ParameterDescriptionTypeRequired
adminUser has administrative privileges.booleanrequired

Request body:

json
{ "admin": true }
Response format

Response body (Status code 200):

json
{ "message": "Successfully updated", "changes": [ "Added admin permission" ] }

DELETE user

URLhttps://assistant.dynatrace.com/api/v2/tenant/users/${EMAIL ADDRESS}
MethodPUT
HeaderContent-Type: application/json
HeaderAuthorization: api-token ${DAVIS ASSISTANT API TOKEN}
Response format

Response body (Status code 200):

json
{ "message": "Successfully removed the user" }
Related topics
  • Root cause analysis

    Find out how Dynatrace identifies the root cause of problems and see how you can use the root cause section of a problem overview page to perform your analysis.