AliasControllerAPI

All URIs are relative to https://api.mailslurp.com

MethodHTTP requestDescription
createAliasPOST /aliasesCreate an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
deleteAliasDELETE /aliases/{aliasId}Delete an email alias
getAliasGET /aliases/{aliasId}Get an email alias
getAliasEmailsGET /aliases/{aliasId}/emailsGet emails for an alias
getAliasThreadsGET /aliases/{aliasId}/threadsGet threads created for an alias
getAliasesGET /aliasesGet all email aliases you have created
replyToAliasEmailPUT /aliases/{aliasId}/emails/{emailId}Reply to an email
sendAliasEmailPOST /aliases/{aliasId}/emailsSend an email from an alias inbox
updateAliasPUT /aliases/{aliasId}Update an email alias

createAlias

    open class func createAlias( createAliasOptions: CreateAliasOptions) -> Promise<AliasDto>

Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.

Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let createAliasOptions = CreateAliasOptions(emailAddress: "emailAddress_example", inboxId: 123, name: "name_example", useThreads: false) // CreateAliasOptions | createAliasOptions

// Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
AliasControllerAPI.createAlias(createAliasOptions: createAliasOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
createAliasOptionsCreateAliasOptionscreateAliasOptions

Return type

AliasDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

deleteAlias

    open class func deleteAlias( aliasId: UUID) -> Promise<Void>

Delete an email alias

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | aliasId

// Delete an email alias
AliasControllerAPI.deleteAlias(aliasId: aliasId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDaliasId

Return type

Void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getAlias

    open class func getAlias( aliasId: UUID) -> Promise<AliasDto>

Get an email alias

Get an email alias by ID

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | aliasId

// Get an email alias
AliasControllerAPI.getAlias(aliasId: aliasId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDaliasId

Return type

AliasDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getAliasEmails

    open class func getAliasEmails( aliasId: UUID,  before: Date? = nil,  page: Int? = nil,  since: Date? = nil,  size: Int? = nil,  sort: Sort_getAliasEmails? = nil) -> Promise<PageEmailProjection>

Get emails for an alias

Get paginated emails for an alias by ID

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | aliasId
let before = Date() // Date | Optional filter by sent before given date time (optional)
let page = 987 // Int | Optional page  alias email list pagination (optional) (default to 0)
let since = Date() // Date | Optional filter by sent after given date time (optional)
let size = 987 // Int | Optional page size alias email list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)

// Get emails for an alias
AliasControllerAPI.getAliasEmails(aliasId: aliasId, before: before, page: page, since: since, size: size, sort: sort).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDaliasId
beforeDateOptional filter by sent before given date time[optional]
pageIntOptional page alias email list pagination[optional] [default to 0]
sinceDateOptional filter by sent after given date time[optional]
sizeIntOptional page size alias email list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to .asc]

Return type

PageEmailProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getAliasThreads

    open class func getAliasThreads( aliasId: UUID,  before: Date? = nil,  page: Int? = nil,  since: Date? = nil,  size: Int? = nil,  sort: Sort_getAliasThreads? = nil) -> Promise<PageThreadProjection>

Get threads created for an alias

Returns threads created for an email alias in paginated form

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | aliasId
let before = Date() // Date | Optional filter by sent before given date time (optional)
let page = 987 // Int | Optional page  in thread list pagination (optional) (default to 0)
let since = Date() // Date | Optional filter by sent after given date time (optional)
let size = 987 // Int | Optional page size in thread list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)

// Get threads created for an alias
AliasControllerAPI.getAliasThreads(aliasId: aliasId, before: before, page: page, since: since, size: size, sort: sort).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDaliasId
beforeDateOptional filter by sent before given date time[optional]
pageIntOptional page in thread list pagination[optional] [default to 0]
sinceDateOptional filter by sent after given date time[optional]
sizeIntOptional page size in thread list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to .asc]

Return type

PageThreadProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getAliases

    open class func getAliases( before: Date? = nil,  page: Int? = nil,  since: Date? = nil,  size: Int? = nil,  sort: Sort_getAliases? = nil) -> Promise<PageAlias>

Get all email aliases you have created

Get all email aliases in paginated form

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let before = Date() // Date | Filter by created at before the given timestamp (optional)
let page = 987 // Int | Optional page  in alias list pagination (optional) (default to 0)
let since = Date() // Date | Filter by created at after the given timestamp (optional)
let size = 987 // Int | Optional page size in alias list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)

// Get all email aliases you have created
AliasControllerAPI.getAliases(before: before, page: page, since: since, size: size, sort: sort).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
beforeDateFilter by created at before the given timestamp[optional]
pageIntOptional page in alias list pagination[optional] [default to 0]
sinceDateFilter by created at after the given timestamp[optional]
sizeIntOptional page size in alias list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to .asc]

Return type

PageAlias

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

replyToAliasEmail

    open class func replyToAliasEmail( aliasId: UUID,  emailId: UUID,  replyToAliasEmailOptions: ReplyToAliasEmailOptions) -> Promise<SentEmailDto>

Reply to an email

Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails to, cc, and bcc.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | ID of the alias that email belongs to
let emailId = 987 // UUID | ID of the email that should be replied to
let replyToAliasEmailOptions = ReplyToAliasEmailOptions(attachments: ["attachments_example"], body: "body_example", charset: "charset_example", isHTML: false, sendStrategy: "sendStrategy_example", template: 123, templateVariables: "TODO", useInboxName: false) // ReplyToAliasEmailOptions | replyToAliasEmailOptions

// Reply to an email
AliasControllerAPI.replyToAliasEmail(aliasId: aliasId, emailId: emailId, replyToAliasEmailOptions: replyToAliasEmailOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDID of the alias that email belongs to
emailIdUUIDID of the email that should be replied to
replyToAliasEmailOptionsReplyToAliasEmailOptionsreplyToAliasEmailOptions

Return type

SentEmailDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

sendAliasEmail

    open class func sendAliasEmail( aliasId: UUID,  sendEmailOptions: SendEmailOptions? = nil) -> Promise<SentEmailDto>

Send an email from an alias inbox

Send an email from an alias. Replies to the email will be forwarded to the alias masked email address

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | aliasId
let sendEmailOptions = SendEmailOptions(addTrackingPixel: false, attachments: ["attachments_example"], bcc: ["bcc_example"], body: "body_example", cc: ["cc_example"], charset: "charset_example", from: "from_example", html: false, isHTML: false, replyTo: "replyTo_example", sendStrategy: "sendStrategy_example", subject: "subject_example", template: 123, templateVariables: "TODO", to: ["to_example"], toContacts: [123], toGroup: 123, useInboxName: false) // SendEmailOptions | Options for the email to be sent (optional)

// Send an email from an alias inbox
AliasControllerAPI.sendAliasEmail(aliasId: aliasId, sendEmailOptions: sendEmailOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDaliasId
sendEmailOptionsSendEmailOptionsOptions for the email to be sent[optional]

Return type

SentEmailDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

updateAlias

    open class func updateAlias( aliasId: UUID,  updateAliasOptions: UpdateAliasOptions) -> Promise<Void>

Update an email alias

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let aliasId = 987 // UUID | aliasId
let updateAliasOptions = UpdateAliasOptions(name: "name_example") // UpdateAliasOptions | updateAliasOptions

// Update an email alias
AliasControllerAPI.updateAlias(aliasId: aliasId, updateAliasOptions: updateAliasOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
aliasIdUUIDaliasId
updateAliasOptionsUpdateAliasOptionsupdateAliasOptions

Return type

Void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]