# Password

Password reset flow

## Send password reset email

`POST /password/reset`

Always responds with `200` regardless of whether the email matches a user.

Authentication: no security requirement declared for this operation.

Request body: application/x-www-form-urlencoded (required)

Type: object

- `email` (required)
  Type: string

Responses:

- 200: OK

- 400: Bad request

## Examples

### cURL

```bash
curl -X POST 'https://demo.traccar.org/api/password/reset' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-raw 'email=string'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/password/reset', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: 'email=string',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post(
    'https://demo.traccar.org/api/password/reset',
    data='email=string'.encode('utf-8'),
    headers={
        'Content-Type': 'application/x-www-form-urlencoded',
    },
)
print(response.text)
```


## Set a new password using a reset token

`POST /password/update`

Authentication: no security requirement declared for this operation.

Request body: application/x-www-form-urlencoded (required)

Type: object

- `token` (required)
  Type: string

- `password` (required)
  Type: string, password

Responses:

- 200: OK

- 404: User not found

## Examples

### cURL

```bash
curl -X POST 'https://demo.traccar.org/api/password/update' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-raw 'token=string&password=%2A%2A%2A%2A%2A%2A%2A%2A'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/password/update', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: 'token=string&password=%2A%2A%2A%2A%2A%2A%2A%2A',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post(
    'https://demo.traccar.org/api/password/update',
    data='token=string&password=%2A%2A%2A%2A%2A%2A%2A%2A'.encode('utf-8'),
    headers={
        'Content-Type': 'application/x-www-form-urlencoded',
    },
)
print(response.text)
```
