Manage users programmatically
Learn how to automate user management tasks using the Davis Assistant API.
General requirements
- A DESK Managed environment
- A valid, enabled Davis Assistant API token with admin permissions
- A system with network access to Davis Assistant on port
443
User management in Davis Assistant is only supported for DESK Managed environments.
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 settings (in Davis Assistant, go to Account settings > Integrations > Davis API).
You must be an administrator of the active (selected) environment to access the Davis Assistant API configuration section.
If the token is invalid, the API will return a 401 Unauthorized
status code. If you're attempting to perform
an action that requires administrative privileges for the active (selected) environment, and lack these privileges, the API will return a 403 Forbidden
status code.
GET users
URL | https://assistant.desk.com/api/v2/tenant/users |
Method | GET |
Header | Authorization: api-token ${DAVIS API TOKEN} |
POST user
URL | https://assistant.desk.com/api/v2/tenant/users/${EMAIL ADDRESS} |
Method | POST |
Header | Content-Type: application/json |
Header | Authorization: api-token ${DAVIS API TOKEN} |
PUT user
URL | https://assistant.desk.com/api/v2/tenant/users/${EMAIL ADDRESS} |
Method | PUT |
Header | Content-Type: application/json |
Header | Authorization: api-token ${DAVIS API TOKEN} |
DELETE user
URL | https://assistant.desk.com/api/v2/tenant/users/${EMAIL ADDRESS} |
Method | PUT |
Header | Content-Type: application/json |
Header | Authorization: api-token ${DAVIS API TOKEN} |