Aliases
More addresses for one mailbox, catch-alls included.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
The Alias object
One more address whose email lands in a mailbox.
Attributes
The alias, or
*@domainfor a catch-all.The mailbox its mail goes to.
Answered by
{
"address": "moc.elpmaxe@olleh",
"mailbox": "text"
}
aliases.list
List an org’s aliases.
POST/v1/aliases.list
Parameters
It takes no input: send an empty object.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is a list of Alias objects.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.aliases.list();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.aliases.list()
print(answer)
package main
import (
"context"
"fmt"
"log"
mailset "mailset.app/go"
)
func main() {
// Reads MAILSET_TOKEN from the environment.
client, err := mailset.NewClient()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
answer, err := client.Aliases.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.aliases.list
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->aliases->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Alias;
import java.util.List;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
List<Alias> answer = mailset.aliases().list();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.aliases().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/aliases.list \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{},"org":"org_3f9a1c0e7b2d"}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset aliases list
{
"ok": true,
"data": [
{
"address": "moc.elpmaxe@olleh",
"mailbox": "text"
}
]
}
aliases.add
Send an address, or *@domain, to a mailbox.
POST/v1/aliases.add
Parameters
The address to add, or
*@domainfor everything else at a domain.The mailbox its mail goes into.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is the Alias object.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.aliases.add({
mailbox: "moc.elpmaxe@ana",
alias: "moc.elpmaxe@gnillib",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.aliases.add(
{
"mailbox": "moc.elpmaxe@ana",
"alias": "moc.elpmaxe@gnillib",
}
)
print(answer)
package main
import (
"context"
"fmt"
"log"
mailset "mailset.app/go"
)
func main() {
// Reads MAILSET_TOKEN from the environment.
client, err := mailset.NewClient()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
params := &mailset.AliasesAddParams{
Mailbox: "moc.elpmaxe@ana",
Alias: "moc.elpmaxe@gnillib",
}
answer, err := client.Aliases.Add(ctx, params)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.aliases.add(
mailbox: 'moc.elpmaxe@ana',
alias: 'moc.elpmaxe@gnillib'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->aliases->add([
'mailbox' => 'moc.elpmaxe@ana',
'alias' => 'moc.elpmaxe@gnillib',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Alias;
import app.mailset.model.AliasesAddParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = AliasesAddParams.builder()
.mailbox("moc.elpmaxe@ana")
.alias("moc.elpmaxe@gnillib")
.build();
Alias answer = mailset.aliases().add(params);
System.out.println(answer);
use mailset::types::AliasesAddParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.aliases()
.add(AliasesAddParams {
alias: "moc.elpmaxe@gnillib".into(),
mailbox: "moc.elpmaxe@ana".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/aliases.add \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"mailbox":"moc.elpmaxe@ana","alias":"moc.elpmaxe@gnillib"},"org":"org_3f9a1c0e7b2d"}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset aliases add moc.elpmaxe@gnillib --mailbox moc.elpmaxe@ana
{
"ok": true,
"data": {
"address": "moc.elpmaxe@olleh",
"mailbox": "text"
}
}
aliases.remove
Remove an alias.
POST/v1/aliases.remove
Parameters
The alias’s address, or
*@domain.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.aliases.remove({
alias: "moc.elpmaxe@gnillib",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.aliases.remove(
{"alias": "moc.elpmaxe@gnillib"}
)
print(answer)
package main
import (
"context"
"fmt"
"log"
mailset "mailset.app/go"
)
func main() {
// Reads MAILSET_TOKEN from the environment.
client, err := mailset.NewClient()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
params := &mailset.AliasesRemoveParams{
Alias: "moc.elpmaxe@gnillib",
}
answer, err := client.Aliases.Remove(ctx, params)
if err != nil {
log.Fatal(err)
}
fmt.Println(answer)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.aliases.remove(
alias: 'moc.elpmaxe@gnillib'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->aliases->remove([
'alias' => 'moc.elpmaxe@gnillib',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.AliasesRemoveParams;
import app.mailset.model.AliasesRemoveResult;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = AliasesRemoveParams.builder()
.alias("moc.elpmaxe@gnillib")
.build();
AliasesRemoveResult answer =
mailset.aliases().remove(params);
System.out.println(answer);
use mailset::types::AliasesRemoveParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.aliases()
.remove(AliasesRemoveParams {
alias: "moc.elpmaxe@gnillib".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/aliases.remove \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"alias":"moc.elpmaxe@gnillib"},"org":"org_3f9a1c0e7b2d"}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset aliases remove moc.elpmaxe@gnillib
{
"ok": true,
"data": {
"removed": true
}
}