# Set your recovery address

`POST https://api.mailmasker.org/api/v1/account/recovery-email`

Choose where a password-reset link is sent, or remove it.

- Who can use it: Any signed-in account
- Area: Your account
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/set-recovery-email

If you forget your password, the sign-in page sends a reset link to this address, so pick one outside this mail system. Without one, a reset by email isn't possible, though you can still change your password while signed in. Nothing is sent to check the address, so make sure it is right.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `recovery_email` | body | no | The address to use. An empty string or null removes it, and so does leaving it out. | `personal@example.com` |

## Good to know

- Something that doesn't look like an address answers 400.

## Examples

cURL:

```bash
curl -s -X POST 'https://api.mailmasker.org/api/v1/account/recovery-email' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"recovery_email":"personal@example.com"}'
```

Perl:

```perl
use Mojo::Base -strict;
use Mojo::UserAgent;

my $ua  = Mojo::UserAgent->new;
my $res = $ua->post('https://api.mailmasker.org/api/v1/account/recovery-email',
    { Authorization => "Bearer $ENV{TOKEN}" },
    json => { recovery_email => 'personal@example.com' })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

There is no homelab-cli command for this yet.

## Response

200 OK:

```json
{ "ok": true, "recovery_email": "personal@example.com" }
```
