# accountAddressLists.evaluate

Test address list policy against an address.

Evaluates inbound or outbound address list policies for a specific address to test whether it would be allowed, blocked, or bypassed.

```ts
openemail.accountAddressLists.evaluate(
  accountId: string,
  body: AccountAddressListsEvaluateBody,
  options?: CallOptions,
): ApiPromise<AddressListVerdict>
```

It calls `POST /accounts/{accountId}/lists/evaluate`: [Test address list policy against an address](/docs/api/routing/post_AccountAddressListEvaluate) in the API reference.

## Example

```ts
const addressListVerdict = await openemail.accountAddressLists.evaluate(accountId, { direction: 'inbound' })
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| `accountId` | `string` | Account identifier. The path's `{accountId}`. |
| `body` | [`AccountAddressListsEvaluateBody`](#accountaddresslistsevaluatebody) | The request's body. |

## Options

It takes no options of its own. Every call also takes `signal`, `timeout`, `retry` and `headers`, which say how that one call is sent ([call options](/docs/sdks/typescript/calling-methods#call-options)).

## Answer

Awaited, it is the API's JSON, [`AddressListVerdict`](/docs/sdks/typescript/types/address-list-verdict). It is an [`ApiPromise`](/docs/sdks/typescript/responses): `.withResponse()` gives the same with the `Response` it came in, for its headers.

## Errors

| Status | What it means |
| --- | --- |
| `400` | validation_failed, or invalid_pattern |
| `401` | unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge |
| `404` | not_found — the account, mailbox, scope or list is not accessible |
| `413` | too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing |
| `503` | temporary_failure — a contact lookup a flagged catch-all required could not answer; retry |

A failed call rejects with a [`RequestError`](/docs/sdks/typescript/errors): its `status`, and its `code`, the API's `error`. Decide on the code: one status covers several.

## Types

### AccountAddressListsEvaluateBody

```ts
/** The body of `accountAddressLists.evaluate`. */
type AccountAddressListsEvaluateBody = {
  /** Target email address to evaluate, taken as vouched. Required unless `envelopeFrom` simulates a message. */
  address?: string
  /** Traffic direction ('inbound' or 'outbound') */
  direction: ('inbound' | 'outbound')
  /** Message simulation: the DMARC verdict for the From (`pass` vouches for a single-domain From) */
  dmarc?: string
  /** Narrow the chain with a domain scope you own. With a mailbox and no domain, the mailbox's own domain, as every delivery door judges it. */
  domain?: string
  /** Message simulation: the envelope sender (empty for a null sender, which skips the catch-all floor as delivery does). Judged with `from`, `spf`, `dmarc` and `submitted` the way an arriving message would be. */
  envelopeFrom?: string
  /** Message simulation: the RFC 5322 From addresses (judged up to the evaluator's own candidate bound, as delivery is) */
  from?: string[]
  /** …and/or a mailbox scope you own */
  mailboxId?: string
  /** Message simulation: the SPF verdict for the envelope sender (`pass` vouches for it) */
  spf?: string
  /** Message simulation: an authenticated local submission, which vouches for the envelope and the From */
  submitted?: boolean
}
```

It names these types of the API, each on a page of its own: [`AddressListVerdict`](/docs/sdks/typescript/types/address-list-verdict).
