# ResetPassword

Reset a user's password programmatically

`POST /api/v2/passwords/{userId}/reset`

**API:** AvaTax API
**Tag:** Registrar
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/crossborder/api/methods/Registrar/ResetPassword/

## Description

# For Registrar Use Only
This API is for use by Avalara Registrar administrative users only.
            
Allows a system admin to reset the password for a specific user via the API.
This API is only available for Avalara Registrar Admins, and can be used to reset the password of any
user based on internal Avalara business processes.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, AvaTaxOnlyUserAdmin, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
* This API is available to Avalara system-level (registrar-level) users only.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `userId` | integer | path | Yes | The unique ID of the user whose password will be changed |
| `isUndoMigrateRequest` | boolean | query | No | If user's password was migrated to AI, undo this. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `SetPasswordModel`

Set Password Model

| Property | Type | Required | Description |
|---|---|---|---|
| `newPassword` | string | **Yes** | New Password Example: `NewPassword789~~!`. |
| `suppressResetPasswordEmail` | boolean | No | SuppressResetPasswordEmail |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success |  |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/passwords/{userId}/reset" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "newPassword": "NewPassword789~~!",
  "suppressResetPasswordEmail": false
}'
```