maislurp-client-powershell.maislurp-client-powershell/Api.AliasControllerApi

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

MethodHTTP requestDescription
New-AliasPOST /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.
Invoke-DeleteAliasDELETE /aliases/{aliasId}Delete an email alias
Get-AliasGET /aliases/{aliasId}Get an email alias
Get-AliasEmailsGET /aliases/{aliasId}/emailsGet emails for an alias
Get-AliasThreadsGET /aliases/{aliasId}/threadsGet threads created for an alias
Get-AliasesGET /aliasesGet all email aliases you have created
Invoke-ReplyToAliasEmailPUT /aliases/{aliasId}/emails/{emailId}Reply to an email
Send-AliasEmailPOST /aliases/{aliasId}/emailsSend an email from an alias inbox
Update-AliasPUT /aliases/{aliasId}Update an email alias

New-Alias

AliasDto New-Alias         [-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.

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

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$CreateAliasOptions = (Initialize-CreateAliasOptions -EmailAddress "EmailAddress_example" -InboxId "InboxId_example" -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.
try {
     $Result = New-Alias -CreateAliasOptions $CreateAliasOptions
} catch {
    Write-Host ("Exception occured when calling New-Alias: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
CreateAliasOptionsCreateAliasOptionscreateAliasOptions

Return type

AliasDto (PSCustomObject)

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 ]

Invoke-DeleteAlias

void Invoke-DeleteAlias         [-AliasId]

Delete an email alias

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | aliasId

# Delete an email alias
try {
     $Result = Invoke-DeleteAlias -AliasId $AliasId
} catch {
    Write-Host ("Exception occured when calling Invoke-DeleteAlias: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringaliasId

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 ]

Get-Alias

AliasDto Get-Alias         [-AliasId]

Get an email alias

Get an email alias by ID

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | aliasId

# Get an email alias
try {
     $Result = Get-Alias -AliasId $AliasId
} catch {
    Write-Host ("Exception occured when calling Get-Alias: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringaliasId

Return type

AliasDto (PSCustomObject)

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 ]

Get-AliasEmails

PageEmailProjection Get-AliasEmails         [-AliasId]         [-Before] <System.Nullable[System.DateTime]>         [-Page] <System.Nullable[Int32]>         [-Since] <System.Nullable[System.DateTime]>         [-Size] <System.Nullable[Int32]>         [-Sort]

Get emails for an alias

Get paginated emails for an alias by ID

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | aliasId
$Before = Get-Date # System.DateTime | Optional filter by sent before given date time (optional)
$Page = 987 # Int32 | Optional page  alias email list pagination (optional) (default to 0)
$Since = Get-Date # System.DateTime | Optional filter by sent after given date time (optional)
$Size = 987 # Int32 | Optional page size alias email list pagination (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")

# Get emails for an alias
try {
     $Result = Get-AliasEmails -AliasId $AliasId -Before $Before -Page $Page -Since $Since -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-AliasEmails: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringaliasId
BeforeSystem.DateTimeOptional filter by sent before given date time[optional]
PageInt32Optional page alias email list pagination[optional] [default to 0]
SinceSystem.DateTimeOptional filter by sent after given date time[optional]
SizeInt32Optional page size alias email list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageEmailProjection (PSCustomObject)

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 ]

Get-AliasThreads

PageThreadProjection Get-AliasThreads         [-AliasId]         [-Before] <System.Nullable[System.DateTime]>         [-Page] <System.Nullable[Int32]>         [-Since] <System.Nullable[System.DateTime]>         [-Size] <System.Nullable[Int32]>         [-Sort]

Get threads created for an alias

Returns threads created for an email alias in paginated form

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | aliasId
$Before = Get-Date # System.DateTime | Optional filter by sent before given date time (optional)
$Page = 987 # Int32 | Optional page  in thread list pagination (optional) (default to 0)
$Since = Get-Date # System.DateTime | Optional filter by sent after given date time (optional)
$Size = 987 # Int32 | Optional page size in thread list pagination (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")

# Get threads created for an alias
try {
     $Result = Get-AliasThreads -AliasId $AliasId -Before $Before -Page $Page -Since $Since -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-AliasThreads: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringaliasId
BeforeSystem.DateTimeOptional filter by sent before given date time[optional]
PageInt32Optional page in thread list pagination[optional] [default to 0]
SinceSystem.DateTimeOptional filter by sent after given date time[optional]
SizeInt32Optional page size in thread list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageThreadProjection (PSCustomObject)

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 ]

Get-Aliases

PageAlias Get-Aliases         [-Before] <System.Nullable[System.DateTime]>         [-Page] <System.Nullable[Int32]>         [-Since] <System.Nullable[System.DateTime]>         [-Size] <System.Nullable[Int32]>         [-Sort]

Get all email aliases you have created

Get all email aliases in paginated form

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$Before = Get-Date # System.DateTime | Filter by created at before the given timestamp (optional)
$Page = 987 # Int32 | Optional page  in alias list pagination (optional) (default to 0)
$Since = Get-Date # System.DateTime | Filter by created at after the given timestamp (optional)
$Size = 987 # Int32 | Optional page size in alias list pagination (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")

# Get all email aliases you have created
try {
     $Result = Get-Aliases -Before $Before -Page $Page -Since $Since -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-Aliases: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
BeforeSystem.DateTimeFilter by created at before the given timestamp[optional]
PageInt32Optional page in alias list pagination[optional] [default to 0]
SinceSystem.DateTimeFilter by created at after the given timestamp[optional]
SizeInt32Optional page size in alias list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageAlias (PSCustomObject)

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 ]

Invoke-ReplyToAliasEmail

SentEmailDto Invoke-ReplyToAliasEmail         [-AliasId]         [-EmailId]         [-ReplyToAliasEmailOptions]

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

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | ID of the alias that email belongs to
$EmailId = "EmailId_example" # String | ID of the email that should be replied to
$ReplyToAliasEmailOptions = (Initialize-ReplyToAliasEmailOptions -Attachments @("Attachments_example") -Body "Body_example" -Charset "Charset_example" -IsHTML $false -SendStrategy "SINGLE_MESSAGE" -Template "Template_example" -TemplateVariables "TODO" -UseInboxName $false) # ReplyToAliasEmailOptions | replyToAliasEmailOptions

# Reply to an email
try {
     $Result = Invoke-ReplyToAliasEmail -AliasId $AliasId -EmailId $EmailId -ReplyToAliasEmailOptions $ReplyToAliasEmailOptions
} catch {
    Write-Host ("Exception occured when calling Invoke-ReplyToAliasEmail: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringID of the alias that email belongs to
EmailIdStringID of the email that should be replied to
ReplyToAliasEmailOptionsReplyToAliasEmailOptionsreplyToAliasEmailOptions

Return type

SentEmailDto (PSCustomObject)

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 ]

Send-AliasEmail

SentEmailDto Send-AliasEmail         [-AliasId]         [-SendEmailOptions]

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

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | aliasId
$SendEmailOptions = (Initialize-SendEmailOptions -AddTrackingPixel $false -Attachments @("Attachments_example") -Bcc @("Bcc_example") -Body "Body_example" -Cc @("Cc_example") -Charset "Charset_example" -VarFrom "VarFrom_example" -Html $false -IsHTML $false -ReplyTo "ReplyTo_example" -SendStrategy "SINGLE_MESSAGE" -Subject "Subject_example" -Template "Template_example" -TemplateVariables "TODO" -To @("To_example") -ToContacts @("ToContacts_example") -ToGroup "ToGroup_example" -UseInboxName $false) # SendEmailOptions | Options for the email to be sent (optional)

# Send an email from an alias inbox
try {
     $Result = Send-AliasEmail -AliasId $AliasId -SendEmailOptions $SendEmailOptions
} catch {
    Write-Host ("Exception occured when calling Send-AliasEmail: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringaliasId
SendEmailOptionsSendEmailOptionsOptions for the email to be sent[optional]

Return type

SentEmailDto (PSCustomObject)

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 ]

Update-Alias

void Update-Alias         [-AliasId]         [-UpdateAliasOptions]

Update an email alias

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AliasId = "AliasId_example" # String | aliasId
$UpdateAliasOptions = (Initialize-UpdateAliasOptions -Name "Name_example") # UpdateAliasOptions | updateAliasOptions

# Update an email alias
try {
     $Result = Update-Alias -AliasId $AliasId -UpdateAliasOptions $UpdateAliasOptions
} catch {
    Write-Host ("Exception occured when calling Update-Alias: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AliasIdStringaliasId
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 ]