# Codes

The newest one-time code an address received.

## mailset codes latest

The newest one-time code mailed to an address you can read.

```bash
mailset codes latest <to> [--from <from>] [--within <within>]
```

### Flags

- `<to>` (argument, required): The address the code was mailed to: a mailbox you can read, or an alias, +tag, catch-all or group that delivers into one.
- `--from` (\<from\>, optional): Only mail from this sender: an address, or a domain with its subdomains (`yahoo.com`).
- `--within` (\<within\>, optional): How far back to look: `30m`, `2h`, `1d`, or minutes as a number. 30 minutes unless given, a day at most. Default `30`.

With `--json` it prints what [the API returns](https://mailset.app/docs/api/codes#codes.latest-returns).

Example:

```bash
mailset codes latest ana@example.com --from yahoo.com --within 10m
```

In the API: [POST /v1/codes.latest](https://mailset.app/docs/api/codes#codes.latest)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content