# mailboxes.checkSendAs

Check whether a mailbox may send from an address.

Checks one From address through the same routing, ownership, credential scope and sending-state authorization as submission, including aliases, subaddresses and catch-all patterns. Requires submission access to the named mailbox; folder grants do not confer sending rights. For non-system callers, unknown or foreign addresses return 403 sender_not_owned without revealing their owner. Does not create mail, reserve quota or send anything. A successful check is advisory: submission always checks again. Responses are not cacheable.

```ts
openemail.mailboxes.checkSendAs(
  mailboxId: string,
  body: MailboxesCheckSendAsBody,
  options?: CallOptions,
): ApiPromise<SenderCheck>
```

It calls `POST /mailboxes/{mailboxId}/send-as/check`: [Check whether a mailbox may send from an address](/docs/api/mailboxes/post_MailboxSenderCheck) in the API reference.

## Example

```ts
const senderCheck = await openemail.mailboxes.checkSendAs(mailboxId, { address: 'ada@example.com' })
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| `mailboxId` | `string` | Mailbox ULID identifier. The path's `{mailboxId}`. |
| `body` | [`MailboxesCheckSendAsBody`](#mailboxeschecksendasbody) | 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, [`SenderCheck`](/docs/sdks/typescript/types/sender-check). 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` | Malformed address (invalid_address) or request body |
| `401` | unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge |
| `403` | Address not owned by this mailbox (sender_not_owned), no local sender for a system caller (sender_not_local), sending disabled (sending_disabled), or insufficient credential scope (credential_scope) |
| `404` | Mailbox not found or not accessible to this principal |
| `413` | too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing |
| `429` | Sending paused (sending_paused); Retry-After and retryAfterSeconds indicate when to retry |
| `503` | temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description) |

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

### MailboxesCheckSendAsBody

```ts
/** The body of `mailboxes.checkSendAs`. */
type MailboxesCheckSendAsBody = {
  /** One bare From address, without a display name */
  address: string
}
```

It names these types of the API, each on a page of its own: [`SenderCheck`](/docs/sdks/typescript/types/sender-check).
