---
title: "client.tools()"
description: "Every method in this namespace: its signature, its parameters, what it returns and an example."
url: "https://nextmail.sh/docs/java/reference/tools"
area: "Java"
category: "Reference"
---

# client.tools()

Every method in this namespace: its signature, its parameters, what it returns and an example.

## Methods

The free tools on the Nextmail website: checks of the public mail records of any domain, which are its SPF record with every include followed, a DKIM key at a selector, its MX hosts, its DMARC policy, its BIMI logo and a deliverability report across all of them, a reader for the sign-in code in a message, and the price of every plan for a usage. They need no scope.

### `tools().checkDmarc`

Check a domain's DMARC policy

```java
Map<String, Object> checkDmarc(String domain, RequestOptions options)
```

Reads the domain's DMARC record from public DNS, or the record of the organisational domain it inherits from, and says how strict it is and what is wrong with it, the DMARC checker on the Nextmail website. `stage` is `missing`, `invalid`, `monitor` for `p=none`, `quarantine` or `reject`, and `issues` lists the problems written to be shown to a person.

**Parameters**

- `domain` (`String`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `domain`, `record`, `inheritedFrom`, every tag in `tags`, `stage` and `issues`.

**Example**

```java
Map<String, Object> report = client.tools().checkDmarc("acme.com");

System.out.println(report.get("stage") + " " + report.get("tags") + " " + report.get("issues"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.

Also available in: API [`GET /tools/dmarc`](https://nextmail.sh/docs/api/reference/tools#get-tools-dmarc); TypeScript [`tools.checkDmarc()`](https://nextmail.sh/docs/sdk/reference/tools#checkDmarc); Python [`tools.check_dmarc()`](https://nextmail.sh/docs/python/reference/tools#checkDmarc); Ruby [`tools.check_dmarc`](https://nextmail.sh/docs/ruby/reference/tools#checkDmarc); PHP [`tools->checkDmarc`](https://nextmail.sh/docs/php/reference/tools#checkDmarc); Go [`Tools.CheckDmarc`](https://nextmail.sh/docs/go/reference/tools#checkDmarc); C# [`Tools.CheckDmarcAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkDmarc); CLI [`nextmail tools check-dmarc`](https://nextmail.sh/docs/cli/reference/tools#tools-check-dmarc).

### `tools().checkBimi`

Check a domain's BIMI logo

```java
Map<String, Object> checkBimi(String domain, RequestOptions options)
```

Reads the domain's BIMI record, fetches the logo it names and checks the DMARC policy beside it, since inboxes draw a logo only at `p=quarantine` or `p=reject`, the BIMI checker on the Nextmail website. `status` is `present`, `partial` when the record is there but something stops inboxes showing the logo, `absent` or `invalid`, and `issues` says why.

**Parameters**

- `domain` (`String`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `record`, `logoUrl`, `authorityUrl`, `logoSvg`, `logoReachable`, `dmarcPolicy`, `dmarcEnforced`, `status` and `issues`.

**Example**

```java
Map<String, Object> report = client.tools().checkBimi("acme.com");

System.out.println(report.get("status") + " " + report.get("issues"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.

Also available in: API [`GET /tools/bimi`](https://nextmail.sh/docs/api/reference/tools#get-tools-bimi); TypeScript [`tools.checkBimi()`](https://nextmail.sh/docs/sdk/reference/tools#checkBimi); Python [`tools.check_bimi()`](https://nextmail.sh/docs/python/reference/tools#checkBimi); Ruby [`tools.check_bimi`](https://nextmail.sh/docs/ruby/reference/tools#checkBimi); PHP [`tools->checkBimi`](https://nextmail.sh/docs/php/reference/tools#checkBimi); Go [`Tools.CheckBimi`](https://nextmail.sh/docs/go/reference/tools#checkBimi); C# [`Tools.CheckBimiAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkBimi); CLI [`nextmail tools check-bimi`](https://nextmail.sh/docs/cli/reference/tools#tools-check-bimi).

### `tools().checkDeliverability`

Check a domain's deliverability

```java
Map<String, Object> checkDeliverability(String domain, RequestOptions options)
```

Checks the records a receiving mailbox reads before it trusts mail from the domain, the deliverability checker on the Nextmail website: MX, SPF, DKIM at the selectors its mail provider uses, DMARC and BIMI. Each check says `pass`, `warn`, `fail` or `absent` with a verdict and notes, and `score` weighs them into 0 to 100, graded `A` to `F`.

**Parameters**

- `domain` (`String`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `score`, `grade`, `provider` and `checks`, a list of maps each with `id`, `label`, `status`, `verdict`, `record` and `notes`.

**Example**

```java
Map<String, Object> report = client.tools().checkDeliverability("acme.com");

System.out.println(report.get("grade") + " " + report.get("score") + " " + report.get("checks"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.

Also available in: API [`GET /tools/deliverability`](https://nextmail.sh/docs/api/reference/tools#get-tools-deliverability); TypeScript [`tools.checkDeliverability()`](https://nextmail.sh/docs/sdk/reference/tools#checkDeliverability); Python [`tools.check_deliverability()`](https://nextmail.sh/docs/python/reference/tools#checkDeliverability); Ruby [`tools.check_deliverability`](https://nextmail.sh/docs/ruby/reference/tools#checkDeliverability); PHP [`tools->checkDeliverability`](https://nextmail.sh/docs/php/reference/tools#checkDeliverability); Go [`Tools.CheckDeliverability`](https://nextmail.sh/docs/go/reference/tools#checkDeliverability); C# [`Tools.CheckDeliverabilityAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkDeliverability); CLI [`nextmail tools check-deliverability`](https://nextmail.sh/docs/cli/reference/tools#tools-check-deliverability).

### `tools().checkSpf`

Check a domain's SPF record

```java
Map<String, Object> checkSpf(String domain, RequestOptions options)
```

Reads the domain's SPF record from public DNS, the SPF checker on the Nextmail website, and follows every `include` and `redirect` it points to. It checks every term, counts the DNS lookups against the limit of 10 in `lookups` and the empty lookups against the limit of 2 in `voidLookups`, finds loops and includes with no record, names the sending services it recognises in `senders` and says in `allQualifier` what happens to mail from servers the record does not list. `tree` is the whole include tree, and `findings` lists everything found, errors first, each with a stable `code` (`SpfFindingCodes`), a `severity` and a `message` written to be shown to a person.

**Parameters**

- `domain` (`String`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `status`, `record`, `lookups`, `voidLookups`, `allQualifier`, the include `tree`, `senders` and `findings`.

**Example**

```java
Map<String, Object> report = client.tools().checkSpf("acme.com");

System.out.println(report.get("status") + ": " + report.get("lookups") + " of " + report.get("lookupLimit") + " lookups");
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.
- `status` is `missing` when the domain publishes no SPF record, and `fail` when a finding breaks the record or DNS did not answer for it.

Also available in: API [`GET /tools/spf`](https://nextmail.sh/docs/api/reference/tools#get-tools-spf); TypeScript [`tools.checkSpf()`](https://nextmail.sh/docs/sdk/reference/tools#checkSpf); Python [`tools.check_spf()`](https://nextmail.sh/docs/python/reference/tools#checkSpf); Ruby [`tools.check_spf`](https://nextmail.sh/docs/ruby/reference/tools#checkSpf); PHP [`tools->checkSpf`](https://nextmail.sh/docs/php/reference/tools#checkSpf); Go [`Tools.CheckSpf`](https://nextmail.sh/docs/go/reference/tools#checkSpf); C# [`Tools.CheckSpfAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkSpf); CLI [`nextmail tools check-spf`](https://nextmail.sh/docs/cli/reference/tools#tools-check-spf).

### `tools().checkDkim`

Check a domain's DKIM key

```java
Map<String, Object> checkDkim(String domain, RequestOptions options)
```

Reads the DKIM key at `selector._domainkey.domain`, the DKIM checker on the Nextmail website, and checks it: every tag, the key type and the key length read from the key itself in `keyBits`, whether it is revoked or still in testing, and the hashes and services it allows. Without a selector it tries the selectors in common use, listed in `probed`, and returns every key it finds in `keys`, since a domain never lists its selectors. Each key has `findings` of its own with a stable `code` (`DkimFindingCodes`), and the report's `findings` are about the lookup as a whole.

**Parameters**

- `domain` (`String`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `options.selector` (`String`): The selector: the part before `._domainkey`, such as `selector1`. A full name such as `selector1._domainkey.acme.com` is read as its selector. Leave it out to try the selectors in common use.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `selector`, `probed`, `status`, every key found in `keys` and the lookup `findings`.

**Example**

```java
Map<String, Object> report = client.tools().checkDkim("acme.com", RequestOptions.of("selector", "selector1"));

System.out.println(report.get("status") + " " + report.get("keys"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.
- A selector that does not read as one is 422 `invalid_parameter` on `selector`.
- `status` is `missing` when no key is published at the selector, or at any common selector when none was given.

Also available in: API [`GET /tools/dkim`](https://nextmail.sh/docs/api/reference/tools#get-tools-dkim); TypeScript [`tools.checkDkim()`](https://nextmail.sh/docs/sdk/reference/tools#checkDkim); Python [`tools.check_dkim()`](https://nextmail.sh/docs/python/reference/tools#checkDkim); Ruby [`tools.check_dkim`](https://nextmail.sh/docs/ruby/reference/tools#checkDkim); PHP [`tools->checkDkim`](https://nextmail.sh/docs/php/reference/tools#checkDkim); Go [`Tools.CheckDkim`](https://nextmail.sh/docs/go/reference/tools#checkDkim); C# [`Tools.CheckDkimAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkDkim); CLI [`nextmail tools check-dkim`](https://nextmail.sh/docs/cli/reference/tools#tools-check-dkim).

### `tools().checkMx`

Look up a domain's MX records

```java
Map<String, Object> checkMx(String domain, RequestOptions options)
```

Reads the domain's MX records in the order senders try them, the MX lookup on the Nextmail website, with each host's IPv4 and IPv6 addresses and their reverse DNS, and names the mail provider in `provider` when it recognises one. It reports an MX record that refuses all mail (RFC 7505) in `nullMx`, a domain with no MX that falls back to its A record in `implicit`, hosts that are aliases or bare addresses, hosts that do not resolve and private addresses, each in `findings` with a stable `code` (`MxFindingCodes`).

**Parameters**

- `domain` (`String`, required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `status`, the `hosts` in delivery order, `nullMx`, `implicit`, `provider` and `findings`.

**Example**

```java
Map<String, Object> report = client.tools().checkMx("acme.com");

System.out.println(report.get("provider") + " " + report.get("hosts"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- A domain that does not read as one is 422 `invalid_parameter` on `domain`, and DNS that did not answer is 503 `unreachable`, which is worth retrying.
- `status` is `missing` when the domain has no MX record and no address to fall back to.

Also available in: API [`GET /tools/mx`](https://nextmail.sh/docs/api/reference/tools#get-tools-mx); TypeScript [`tools.checkMx()`](https://nextmail.sh/docs/sdk/reference/tools#checkMx); Python [`tools.check_mx()`](https://nextmail.sh/docs/python/reference/tools#checkMx); Ruby [`tools.check_mx`](https://nextmail.sh/docs/ruby/reference/tools#checkMx); PHP [`tools->checkMx`](https://nextmail.sh/docs/php/reference/tools#checkMx); Go [`Tools.CheckMx`](https://nextmail.sh/docs/go/reference/tools#checkMx); C# [`Tools.CheckMxAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkMx); CLI [`nextmail tools check-mx`](https://nextmail.sh/docs/cli/reference/tools#tools-check-mx).

### `tools().readVerificationCode`

Read the sign-in code in a message

```java
Map<String, Object> readVerificationCode(Map<String, Object> body, RequestOptions options)
```

Finds the sign-in or verification code in a message you pass in, with the reader that puts a code at the top of a message in Nextmail. Send the whole MIME source as `raw`, or the `subject` with `html` or `text`.

It answers only when it is sure: the message has to hold exactly one code worded as one, such as a verification code, a one-time code or a security code, in any of the common languages. Two different codes, or a number that could be an order, a booking, a meeting, a phone number or a promotion, leave `code` null.

It reads only what you send, so it cannot tell whether the sender is who it claims to be. The `verificationCode` that `threads().get` returns on each message of your mailbox also requires the sender to pass authentication.

**Parameters**

- `body.raw` (`String`): The whole message as MIME source, as it was received. Wins over the other fields when it is set.
- `body.subject` (`String`): Subject line, at most 998 characters.
- `body.html` (`String`): HTML body. Links are left out before the code is looked for.
- `body.text` (`String`): Plain text body, used when there is no `html`.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `object` set to `verification_code` and `code`: the code as you would type it, digits only or capital letters and digits without spaces or dashes, or null when the reader is not sure.

**Example**

```java
Map<String, Object> result = client.tools().readVerificationCode(Body.of(
    "subject", "Your verification code",
    "html", "<p>Your code is <b>396-696</b>. It expires in 10 minutes.</p>"
));

System.out.println(result.get("code"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- Nothing is stored and no model is called, so it is safe to run on every message.
- A body with none of `raw`, `subject`, `html` or `text` is 422 `invalid_parameter`.

Also available in: API [`POST /tools/verification-code`](https://nextmail.sh/docs/api/reference/tools#post-tools-verification-code); TypeScript [`tools.readVerificationCode()`](https://nextmail.sh/docs/sdk/reference/tools#readVerificationCode); Python [`tools.read_verification_code()`](https://nextmail.sh/docs/python/reference/tools#readVerificationCode); Ruby [`tools.read_verification_code`](https://nextmail.sh/docs/ruby/reference/tools#readVerificationCode); PHP [`tools->readVerificationCode`](https://nextmail.sh/docs/php/reference/tools#readVerificationCode); Go [`Tools.ReadVerificationCode`](https://nextmail.sh/docs/go/reference/tools#readVerificationCode); C# [`Tools.ReadVerificationCodeAsync`](https://nextmail.sh/docs/csharp/reference/tools#readVerificationCode); CLI [`nextmail tools read-verification-code`](https://nextmail.sh/docs/cli/reference/tools#tools-read-verification-code).

### `tools().estimateCost`

Estimate what Nextmail costs for a usage

```java
Map<String, Object> estimateCost(RequestOptions options)
```

For the usage you describe, prices every plan a workspace can choose for itself, as the cost calculator on the Nextmail website does: the plan itself, the extra sends, received emails, AI actions, domains, storage and API requests it would bill, the monthly total, and whether the plan fits at all. It prices the extras of each plan at the rates of that plan, which `usageRates` from `billing().listPlans` lists, and a plan priced in a contract is left out. A plan does not fit when the usage needs more people than its team access allows, or more sends, received emails, domains or storage than it includes on a plan that bills no extra for them. `cheapest` names the cheapest plan that fits.

Amounts are in US cents per month. With `interval` set to `year`, the plan price is the monthly equivalent of paying yearly.

**Parameters**

- `options.sends` (`int`): Emails sent in a month. Defaults to 0.
- `options.received` (`int`): Emails received in a month. Defaults to 0.
- `options.domains` (`int`): Domains you send from. Defaults to 1.
- `options.people` (`int`): People who use the workspace. Defaults to 1.
- `options.aiActions` (`int`): AI actions in a day, such as drafts, rewrites and summaries. Defaults to 0.
- `options.storage` (`int`): Storage the workspace keeps, in GB. Defaults to 0.
- `options.apiRequests` (`int`): API and MCP requests in a month, priced per 1,000,000 at the rate of each plan. Defaults to 0.
- `options.interval` (`String`): How you pay: `month` or `year`, as in `sh.nextmail.constants.BillingIntervals`. Defaults to `month`.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `object` set to `cost_estimate`, the `interval`, the `need` that was priced with its defaults filled in, every plan in `plans`, each a map with `plan`, `name`, `fits`, `blockers`, `baseCents`, `extraSends`, `sendsCents`, `extraReceived`, `receivedCents`, `extraAiActions`, `aiCents`, `extraDomains`, `domainsCents`, `extraStorage`, `storageCents`, `extraApiRequests`, `apiRequestsCents`, `extrasCents` and `totalCents`, and `cheapest`, the id of the cheapest plan that fits, or null when none does.

**Example**

```java
Map<String, Object> estimate = client.tools().estimateCost(RequestOptions.create()
    .set("sends", 25000)
    .set("received", 40000)
    .set("domains", 2)
    .set("storage", 10)
    .set("aiActions", 30));

System.out.println(estimate.get("plans") + " " + estimate.get("cheapest"));
```

**Notes**

- Needs no scope: any key or access token for the workspace may run it.
- It prices the plans as they are sold today and reads nothing in the workspace.
- `blockers` names what a plan cannot carry: `domains`, `people`, `sends`, `storage` or `received`, the values in `sh.nextmail.constants.PlanBlockers`.

Also available in: API [`GET /tools/cost`](https://nextmail.sh/docs/api/reference/tools#get-tools-cost); TypeScript [`tools.estimateCost()`](https://nextmail.sh/docs/sdk/reference/tools#estimateCost); Python [`tools.estimate_cost()`](https://nextmail.sh/docs/python/reference/tools#estimateCost); Ruby [`tools.estimate_cost`](https://nextmail.sh/docs/ruby/reference/tools#estimateCost); PHP [`tools->estimateCost`](https://nextmail.sh/docs/php/reference/tools#estimateCost); Go [`Tools.EstimateCost`](https://nextmail.sh/docs/go/reference/tools#estimateCost); C# [`Tools.EstimateCostAsync`](https://nextmail.sh/docs/csharp/reference/tools#estimateCost); CLI [`nextmail tools estimate-cost`](https://nextmail.sh/docs/cli/reference/tools#tools-estimate-cost).

### `tools().checkAddress`

Check an email address

```java
Map<String, Object> checkAddress(String email, RequestOptions options)
```

Says whether an address is worth sending to, the email checker on the Nextmail website: `result` is `valid`, `risky`, `invalid` or `unknown`, and `reasons` says why. It checks the syntax, whether the domain takes mail at all, whether it is a throwaway domain or a shared address such as `info@`, and offers a correction in `suggestion` for a likely typo such as `gmial.com`. Run it on a sign-up form before the first message, or over a list before a broadcast.

With the `emails:read` scope, `workspace` also says what this workspace knows: whether it suppressed the address and when it last delivered to it or saw it bounce. It never shows another workspace's history, and without the scope it is `null`.

`deep` also asks whether the mailbox itself exists, in `checks.mailbox`. Every plan includes some deep checks each calendar month, and `usage.addressChecks` in the billing details says how many are left. Past those, each address is billed through pay as you go. A deep check needs the `emails:send` scope. Without it the check is free and `checks.mailbox` is `null`.

**Parameters**

- `email` (`String`, required): The address to check, such as `ada@acme.com`.
- `options.deep` (`boolean`): Also ask whether the mailbox exists. Uses the deep checks the plan includes this month, then pay as you go. Defaults to false.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with `email`, `normalized`, `result`, `reasons`, `suggestion`, `checks`, `workspace` and `checkedAt`.

**Example**

```java
Map<String, Object> check = client.tools().checkAddress("ada@gmial.com");

System.out.println(check.get("result") + " " + check.get("reasons") + " " + check.get("suggestion"));
```

**Notes**

- Needs no scope without `deep`: any key or access token for the workspace may run it.
- An address whose syntax is wrong is not an error: it returns with `result` `invalid` and the reason `invalid_syntax`. The values are in `sh.nextmail.constants.AddressCheckResults` and `sh.nextmail.constants.AddressCheckReasons`.
- With `deep`, a workspace whose included deep checks are used up while pay as you go is off, paused or not part of the plan is 409 `deep_check_unavailable`, a check that would pass the pay as you go monthly limit is 409 `deep_check_limit_reached`, and a mailbox check that did not answer is 503 `deep_check_unavailable`. Nothing is billed or counted for any of them.
- A GET is retried automatically on network failure and on 408, 429, 500, 502, 503 and 504 responses, up to the client's `maxRetries`.

Also available in: API [`GET /tools/address`](https://nextmail.sh/docs/api/reference/tools#get-tools-address); TypeScript [`tools.checkAddress()`](https://nextmail.sh/docs/sdk/reference/tools#checkAddress); Python [`tools.check_address()`](https://nextmail.sh/docs/python/reference/tools#checkAddress); Ruby [`tools.check_address`](https://nextmail.sh/docs/ruby/reference/tools#checkAddress); PHP [`tools->checkAddress`](https://nextmail.sh/docs/php/reference/tools#checkAddress); Go [`Tools.CheckAddress`](https://nextmail.sh/docs/go/reference/tools#checkAddress); C# [`Tools.CheckAddressAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkAddress); CLI [`nextmail tools check-address`](https://nextmail.sh/docs/cli/reference/tools#tools-check-address).

### `tools().checkAddresses`

Check several email addresses

```java
Map<String, Object> checkAddresses(Map<String, Object> body, RequestOptions options)
```

Checks up to 100 addresses in one call, each as `checkAddress` does, and returns them in the order they were sent. Use it to clean a list before importing it or sending a broadcast to it.

`deep` applies to every address and counts each one that reaches the mailbox check: first against the deep checks the plan includes this month, then through pay as you go. It needs the `emails:send` scope.

**Parameters**

- `body.emails` (`List<String>`, required): The addresses to check, a list of 1 to 100 strings.
- `body.deep` (`boolean`): Also ask whether each mailbox exists. Uses the deep checks the plan includes this month, then pay as you go. Defaults to false.
- `options.apiKey` (`String`): Overrides the client's API key for this call only.

**Returns**

A map with one map per address in `data`, in the order they were sent.

**Example**

```java
Map<String, Object> result = client.tools().checkAddresses(Body.of("emails", List.of("ada@acme.com", "info@example.org")));

System.out.println(result.get("object"));
```

**Notes**

- Needs no scope without `deep`: any key or access token for the workspace may run it.
- More than 100 addresses, or none, is 422 `invalid_parameter` on `emails`.
- It changes nothing, so it is safe to run again, but the SDK does not retry a POST.

Also available in: API [`POST /tools/addresses`](https://nextmail.sh/docs/api/reference/tools#post-tools-addresses); TypeScript [`tools.checkAddresses()`](https://nextmail.sh/docs/sdk/reference/tools#checkAddresses); Python [`tools.check_addresses()`](https://nextmail.sh/docs/python/reference/tools#checkAddresses); Ruby [`tools.check_addresses`](https://nextmail.sh/docs/ruby/reference/tools#checkAddresses); PHP [`tools->checkAddresses`](https://nextmail.sh/docs/php/reference/tools#checkAddresses); Go [`Tools.CheckAddresses`](https://nextmail.sh/docs/go/reference/tools#checkAddresses); C# [`Tools.CheckAddressesAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkAddresses); CLI [`nextmail tools check-addresses`](https://nextmail.sh/docs/cli/reference/tools#tools-check-addresses).
