MailSlurp JS

Globals / InboxControllerApi

Class: InboxControllerApi

InboxControllerApi - object-oriented interface

export

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Inherited from BaseAPI.constructor

Defined in src/generated/api.ts:57

Parameters:

NameTypeDefault value
configuration?Configuration-
basePathstringBASE_PATH
fetchFetchAPIportableFetch

Returns: InboxControllerApi

Properties

basePath

Protected basePath: string

Inherited from BaseAPI.basePath

Defined in src/generated/api.ts:61


configuration

Protected configuration: Configuration

Inherited from BaseAPI.configuration

Defined in src/generated/api.ts:57


fetch

Protected fetch: FetchAPI

Inherited from BaseAPI.fetch

Defined in src/generated/api.ts:62

Methods

createInbox

createInbox(allowTeamAccess?: boolean, description?: string, emailAddress?: string, expiresAt?: Date, expiresIn?: number, favourite?: boolean, inboxType?: “HTTP_INBOX” | “SMTP_INBOX”, name?: string, tags?: Array, useDomainPool?: boolean, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:18346

Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.

summary Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either SMTP or HTTP inboxes.

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
allowTeamAccess?boolean
description?string
emailAddress?string
expiresAt?Date
expiresIn?number
favourite?boolean
inboxType?“HTTP_INBOX”
name?string
tags?Array
useDomainPool?boolean
options?any

Returns: Promise<Inbox>


createInboxWithDefaults

createInboxWithDefaults(options?: any): Promise<Inbox>

Defined in src/generated/api.ts:18381

summary Create an inbox with default options. Uses MailSlurp domain pool address and is private.

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
options?any

Returns: Promise<Inbox>


createInboxWithOptions

createInboxWithOptions(createInboxDto: CreateInboxDto, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:18395

Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.

summary Create an inbox with options. Extended options for inbox creation.

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
createInboxDtoCreateInboxDtocreateInboxDto
options?any-

Returns: Promise<Inbox>


deleteAllInboxes

deleteAllInboxes(options?: any): Promise

Defined in src/generated/api.ts:18412

Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.

summary Delete all inboxes

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
options?any

Returns: Promise


deleteInbox

deleteInbox(inboxId: string, options?: any): Promise

Defined in src/generated/api.ts:18426

Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.

summary Delete inbox

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringinboxId
options?any-

Returns: Promise


getAllInboxes

getAllInboxes(favourite?: boolean, page?: number, search?: string, size?: number, sort?: “ASC” | “DESC”, tag?: string, teamAccess?: boolean, options?: any): Promise<PageInboxProjection>

Defined in src/generated/api.ts:18447

List inboxes in paginated form. The results are available on the content property of the returned object. This method allows for page (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative getInboxes method returns a full list of inboxes but is limited to 100 results. Results do not include team access inboxes by default. Use organization method to list team inboxes or set teamAccess to true.

summary List All Inboxes Paginated

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
favourite?boolean
page?number
search?string
size?number
sort?“ASC”
tag?string
teamAccess?boolean
options?any

Returns: Promise<PageInboxProjection>


getEmails

getEmails(inboxId: string, limit?: number, minCount?: number, retryTimeout?: number, since?: Date, size?: number, sort?: “ASC” | “DESC”, options?: any): Promise<EmailPreview[]>

Defined in src/generated/api.ts:18483

List emails that an inbox has received. Only emails that are sent to the inbox’s email address will appear in the inbox. It may take several seconds for any email you send to an inbox’s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the minCount parameter. The server will retry the inbox database until the minCount is satisfied or the retryTimeout is reached

summary Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringId of inbox that emails belongs to
limit?number-
minCount?number-
retryTimeout?number-
since?Date-
size?number-
sort?“ASC”“DESC”
options?any-

Returns: Promise<EmailPreview[]>


getInbox

getInbox(inboxId: string, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:18513

Returns an inbox’s properties, including its email address and ID.

summary Get Inbox. Returns properties of an inbox.

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringinboxId
options?any-

Returns: Promise<Inbox>


getInboxEmailsPaginated

getInboxEmailsPaginated(inboxId: string, page?: number, size?: number, sort?: “ASC” | “DESC”, options?: any): Promise<PageEmailPreview>

Defined in src/generated/api.ts:18531

Get a paginated list of emails in an inbox. Does not hold connections open.

summary Get inbox emails paginated

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringId of inbox that emails belongs to
page?number-
size?number-
sort?“ASC”“DESC”
options?any-

Returns: Promise<PageEmailPreview>


getInboxSentEmails

getInboxSentEmails(inboxId: string, page?: number, size?: number, sort?: “ASC” | “DESC”, options?: any): Promise<PageSentEmailProjection>

Defined in src/generated/api.ts:18558

Returns an inbox’s sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.

summary Get Inbox Sent Emails

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringinboxId
page?number-
size?number-
sort?“ASC”“DESC”
options?any-

Returns: Promise<PageSentEmailProjection>


getInboxTags

getInboxTags(options?: any): Promise<string[]>

Defined in src/generated/api.ts:18581

Get all inbox tags

summary Get inbox tags

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
options?any

Returns: Promise<string[]>


getInboxes

getInboxes(size?: number, sort?: “ASC” | “DESC”, options?: any): Promise<Inbox[]>

Defined in src/generated/api.ts:18597

List the inboxes you have created. Note use of the more advanced getAllEmails is recommended. You can provide a limit and sort parameter.

summary List Inboxes and email eddresses

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
size?number
sort?“ASC”
options?any

Returns: Promise<Inbox[]>


getOrganizationInboxes

getOrganizationInboxes(page?: number, size?: number, sort?: “ASC” | “DESC”, options?: any): Promise<PageOrganizationInboxProjection>

Defined in src/generated/api.ts:18615

List organization inboxes in paginated form. These are inboxes created with allowTeamAccess flag enabled. Organization inboxes are readOnly for non-admin users. The results are available on the content property of the returned object. This method allows for page (zero based), page size (how many results to return), and a sort direction (based on createdAt time).

summary List Organization Inboxes Paginated

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameType
page?number
size?number
sort?“ASC”
options?any

Returns: Promise<PageOrganizationInboxProjection>


sendEmail

sendEmail(inboxId: string, sendEmailOptions?: SendEmailOptions, options?: any): Promise

Defined in src/generated/api.ts:18638

Send an email from an inbox’s email address. The request body should contain the SendEmailOptions that include recipients, attachments, body etc. See SendEmailOptions for all available properties. Note the inboxId refers to the inbox’s id not the inbox’s email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method sendEmailAndConfirm.

summary Send Email

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringID of the inbox you want to send the email from
sendEmailOptions?SendEmailOptions-
options?any-

Returns: Promise


sendEmailAndConfirm

sendEmailAndConfirm(inboxId: string, sendEmailOptions?: SendEmailOptions, options?: any): Promise<SentEmailDto>

Defined in src/generated/api.ts:18659

Sister method for standard sendEmail method with the benefit of returning a SentEmail entity confirming the successful sending of the email with a link to the sent object created for it.

summary Send email and return sent confirmation

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringID of the inbox you want to send the email from
sendEmailOptions?SendEmailOptions-
options?any-

Returns: Promise<SentEmailDto>


sendTestEmail

sendTestEmail(inboxId: string, options?: any): Promise

Defined in src/generated/api.ts:18679

Send an inbox a test email to test email receiving is working

summary Send a test email to inbox

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringinboxId
options?any-

Returns: Promise


setInboxFavourited

setInboxFavourited(inboxId: string, setInboxFavouritedOptions: SetInboxFavouritedOptions, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:18695

Set and return new favourite state for an inbox

summary Set inbox favourited state

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringinboxId
setInboxFavouritedOptionsSetInboxFavouritedOptionssetInboxFavouritedOptions
options?any-

Returns: Promise<Inbox>


updateInbox

updateInbox(inboxId: string, updateInboxOptions: UpdateInboxOptions, options?: any): Promise<Inbox>

Defined in src/generated/api.ts:18716

Update editable fields on an inbox

summary Update Inbox. Change name and description. Email address is not editable.

throws {RequiredError}

memberof InboxControllerApi

Parameters:

NameTypeDescription
inboxIdstringinboxId
updateInboxOptionsUpdateInboxOptionsupdateInboxOptions
options?any-

Returns: Promise<Inbox>