# Set someone's invite limits

`PUT https://api.mailmasker.org/api/v1/invites/quota/:sender_email`

Give one sender their own invite limits in place of the site's defaults.

- Who can use it: Site admins
- Area: Invites
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/invite-quota-set

Replaces any limits the sender already had. There is no call to remove them and go back to following the defaults.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `sender_email` | path | yes | The sender's address. | `alex@example.com` |
| `max_pending` | body | yes | How many unused invites they may have out at once. | `20` |
| `max_per_day` | body | yes | How many they may send in any 24 hours. | `10` |

## Good to know

- Leaving out either number answers 400.

## Examples

cURL:

```bash
curl -s -X PUT 'https://api.mailmasker.org/api/v1/invites/quota/alex%40example.com' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"max_pending":20,"max_per_day":10}'
```

Perl:

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

my $ua  = Mojo::UserAgent->new;
my $res = $ua->put('https://api.mailmasker.org/api/v1/invites/quota/alex%40example.com',
    { Authorization => "Bearer $ENV{TOKEN}" },
    json => { max_pending => 20, max_per_day => 10 })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

```bash
homelab-cli invite quota set --user alex@example.com --max-pending 20 --max-per-day 10
```

## Response

200 OK:

```json
{
  "sender_email": "alex@example.com",
  "max_pending": 20,
  "max_per_day": 10,
  "updated_at": "2026-11-03 21:42:10.123456-06",
  "updated_by_email": "you@example.com"
}
```
