Delegates
Let a teammate read and send from your mailbox.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
delegates.list
Show who can use a mailbox you hold.
POST/v1/delegates.list
Parameters
The mailbox’s address.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
Delegates or owners who are deactivated, kept so you can see them.
You hold this mailbox, so you can change who else does.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.delegates.list({
mailbox: "moc.elpmaxe@ana",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.delegates.list(
{"mailbox": "moc.elpmaxe@ana"}
)
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.DelegatesListParams{
Mailbox: "moc.elpmaxe@ana",
}
answer, err := client.Delegates.List(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.delegates.list(
mailbox: 'moc.elpmaxe@ana'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->delegates->list([
'mailbox' => 'moc.elpmaxe@ana',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Delegates;
import app.mailset.model.DelegatesListParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = DelegatesListParams.builder()
.mailbox("moc.elpmaxe@ana")
.build();
Delegates answer = mailset.delegates().list(params);
System.out.println(answer);
use mailset::types::DelegatesListParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.delegates()
.list(DelegatesListParams {
mailbox: "moc.elpmaxe@ana".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/delegates.list \
-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"},"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 delegates list moc.elpmaxe@ana
{
"ok": true,
"data": {
"mailbox": "text",
"owners": [
"text"
],
"delegates": [
"text"
],
"deactivated": [
"text"
],
"canChange": true
}
}
delegates.add
Let someone in the org read and send from your mailbox.
POST/v1/delegates.add
Parameters
Your mailbox’s address.
The member’s address.
Beside input
The org this is about. Needed when the caller is in more than one.
An approval’s id, once someone approved it with their passkey. Without one, the answer is
step_up_requiredand names what to approve.
Returns
data is an object with:
Delegates or owners who are deactivated, kept so you can see them.
You hold this mailbox, so you can change who else does.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.delegates.add({
member: "moc.elpmaxe@neb",
mailbox: "moc.elpmaxe@ana",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.delegates.add(
{
"member": "moc.elpmaxe@neb",
"mailbox": "moc.elpmaxe@ana",
}
)
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.DelegatesAddParams{
Member: "moc.elpmaxe@neb",
Mailbox: "moc.elpmaxe@ana",
}
answer, err := client.Delegates.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.delegates.add(
member: 'moc.elpmaxe@neb',
mailbox: 'moc.elpmaxe@ana'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->delegates->add([
'member' => 'moc.elpmaxe@neb',
'mailbox' => 'moc.elpmaxe@ana',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Delegates;
import app.mailset.model.DelegatesAddParams;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = DelegatesAddParams.builder()
.member("moc.elpmaxe@neb")
.mailbox("moc.elpmaxe@ana")
.build();
Delegates answer = mailset.delegates().add(params);
System.out.println(answer);
use mailset::types::DelegatesAddParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.delegates()
.add(DelegatesAddParams {
mailbox: "moc.elpmaxe@ana".into(),
member: "moc.elpmaxe@neb".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/delegates.add \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"member":"moc.elpmaxe@neb","mailbox":"moc.elpmaxe@ana"},"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 delegates add moc.elpmaxe@ana --member moc.elpmaxe@neb
{
"ok": true,
"data": {
"mailbox": "text",
"owners": [
"text"
],
"delegates": [
"text"
],
"deactivated": [
"text"
],
"canChange": true
}
}
delegates.remove
Stop someone using your mailbox.
POST/v1/delegates.remove
Parameters
Your mailbox’s address.
The member’s address.
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.delegates.remove({
member: "moc.elpmaxe@neb",
mailbox: "moc.elpmaxe@ana",
});
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.delegates.remove(
{
"member": "moc.elpmaxe@neb",
"mailbox": "moc.elpmaxe@ana",
}
)
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.DelegatesRemoveParams{
Member: "moc.elpmaxe@neb",
Mailbox: "moc.elpmaxe@ana",
}
answer, err := client.Delegates.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.delegates.remove(
member: 'moc.elpmaxe@neb',
mailbox: 'moc.elpmaxe@ana'
)
p answer
<?php
require 'vendor/autoload.php';
// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();
$answer = $mailset->delegates->remove([
'member' => 'moc.elpmaxe@neb',
'mailbox' => 'moc.elpmaxe@ana',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.DelegatesRemoveParams;
import app.mailset.model.DelegatesRemoveResult;
// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();
var params = DelegatesRemoveParams.builder()
.member("moc.elpmaxe@neb")
.mailbox("moc.elpmaxe@ana")
.build();
DelegatesRemoveResult answer =
mailset.delegates().remove(params);
System.out.println(answer);
use mailset::types::DelegatesRemoveParams;
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset
.delegates()
.remove(DelegatesRemoveParams {
mailbox: "moc.elpmaxe@ana".into(),
member: "moc.elpmaxe@neb".into(),
})
.await?;
println!("{answer:?}");
curl https://mailset.app/v1/delegates.remove \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"member":"moc.elpmaxe@neb","mailbox":"moc.elpmaxe@ana"},"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 delegates remove moc.elpmaxe@ana --member moc.elpmaxe@neb
{
"ok": true,
"data": {
"removed": true
}
}