Groups

Groups

One address that reaches several mailboxes.

An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.

On this page
  1. The Group object
  2. groups.list
  3. groups.add
  4. groups.update
  5. groups.remove
  6. groups.addMember
  7. groups.removeMember

The Group object

An address that hands its email on to each of its members.

Attributes

  • idstring
  • addressstring
  • namestring
  • sendersenum

    One ofanyoneorgmembers

  • membersarray of strings

    Mailboxes and other groups, by address.

Answered by

groups.listgroups.addgroups.updategroups.addMembergroups.removeMember

The Group object
{
  "id": "out_3f9a1c0e7b2d",
  "address": "moc.elpmaxe@olleh",
  "name": "Acme API",
  "senders": "anyone",
  "members": [
    "text"
  ]
}

groups.list

List an org’s groups.

POST/v1/groups.list

Admin or owner

Parameters

It takes no input: send an empty object.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is a list of Group objects.

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.groups.list();
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.groups.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.Groups.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.groups.list
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->groups->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Group;
import java.util.List;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

List<Group> answer = mailset.groups().list();
System.out.println(answer);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.groups().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/groups.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 groups list
Response
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "address": "moc.elpmaxe@olleh",
      "name": "Acme API",
      "senders": "anyone",
      "members": [
        "text"
      ]
    }
  ]
}

groups.add

Add a group: one address, a copy to every member mailbox.

POST/v1/groups.add

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The group’s address, on one of the org’s domains.

  • namestringoptional

    A name for the group.

    At most 120 characters.

  • sendersenumoptional

    Who may write to it: anyone, people in the org, or only its members.

    One ofanyoneorgmembers

    Default org.

  • membersarray of stringsoptional

    Mailboxes and other groups, by address.

    Default []. At most 1,000 items.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    An approval’s id, once someone approved it with their passkey. Without one, the answer is step_up_required and names what to approve.

Returns

data is the Group object.

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.groups.add({
	name: "Team",
	members: [
		"moc.elpmaxe@ana",
		"moc.elpmaxe@neb",
	],
	address: "moc.elpmaxe@maet",
});
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.groups.add(
    {
        "name": "Team",
        "members": ["moc.elpmaxe@ana", "moc.elpmaxe@neb"],
        "address": "moc.elpmaxe@maet",
    }
)
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.GroupsAddParams{
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.groups.add(
  name: 'Team',
  members: ['moc.elpmaxe@ana', 'moc.elpmaxe@neb'],
  address: 'moc.elpmaxe@maet'
)
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->groups->add([
    'name' => 'Team',
    'members' => ['moc.elpmaxe@ana', 'moc.elpmaxe@neb'],
    'address' => 'moc.elpmaxe@maet',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Group;
import app.mailset.model.GroupsAddParams;
import java.util.List;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = GroupsAddParams.builder()
        .name("Team")
        .members(List.of(
                "moc.elpmaxe@ana",
                "moc.elpmaxe@neb"))
        .address("moc.elpmaxe@maet")
        .build();
Group answer = mailset.groups().add(params);
System.out.println(answer);
use mailset::types::GroupsAddParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .groups()
    .add(GroupsAddParams {
        address: "moc.elpmaxe@maet".into(),
        name: Some("Team".into()),
        members: Some(vec![
            "moc.elpmaxe@ana".into(),
            "moc.elpmaxe@neb".into(),
        ]),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/groups.add \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"Team","members":["moc.elpmaxe@ana","moc.elpmaxe@neb"],"address":"moc.elpmaxe@maet"},"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 groups add moc.elpmaxe@maet --name Team --members moc.elpmaxe@ana,moc.elpmaxe@neb
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "address": "moc.elpmaxe@olleh",
    "name": "Acme API",
    "senders": "anyone",
    "members": [
      "text"
    ]
  }
}

groups.update

Rename a group, or change who can send to it.

POST/v1/groups.update

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The group’s address.

  • namestringoptional

    A new name for the group.

    At most 120 characters.

  • sendersenumoptional

    Who may write to it: anyone, people in the org, or only its members.

    One ofanyoneorgmembers

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    An approval’s id, once someone approved it with their passkey. Without one, the answer is step_up_required and names what to approve.

Returns

data is the Group object.

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.groups.update({
	senders: "anyone",
	address: "moc.elpmaxe@maet",
});
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.groups.update(
    {"senders": "anyone", "address": "moc.elpmaxe@maet"}
)
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.GroupsUpdateParams{
		Senders: mailset.GroupSenderAnyone,
		Address: "moc.elpmaxe@maet",
	}
	answer, err := client.Groups.Update(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.groups.update(
  senders: 'anyone',
  address: 'moc.elpmaxe@maet'
)
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->groups->update([
    'senders' => 'anyone',
    'address' => 'moc.elpmaxe@maet',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Group;
import app.mailset.model.GroupSender;
import app.mailset.model.GroupsUpdateParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = GroupsUpdateParams.builder()
        .senders(GroupSender.ANYONE)
        .address("moc.elpmaxe@maet")
        .build();
Group answer = mailset.groups().update(params);
System.out.println(answer);
use mailset::types::{GroupSender, GroupsUpdateParams};

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .groups()
    .update(GroupsUpdateParams {
        address: "moc.elpmaxe@maet".into(),
        senders: Some(GroupSender::Anyone),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/groups.update \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"senders":"anyone","address":"moc.elpmaxe@maet"},"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 groups update moc.elpmaxe@maet --senders anyone
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "address": "moc.elpmaxe@olleh",
    "name": "Acme API",
    "senders": "anyone",
    "members": [
      "text"
    ]
  }
}

groups.remove

Delete a group. Its members keep their mail.

POST/v1/groups.remove

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The group’s address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    An approval’s id, once someone approved it with their passkey. Without one, the answer is step_up_required and names what to approve.

Returns

data is an object with:

  • removedboolean

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.groups.remove({
	address: "moc.elpmaxe@maet",
});
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.groups.remove(
    {"address": "moc.elpmaxe@maet"}
)
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.GroupsRemoveParams{
		Address: "moc.elpmaxe@maet",
	}
	answer, err := client.Groups.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.groups.remove(
  address: 'moc.elpmaxe@maet'
)
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->groups->remove([
    'address' => 'moc.elpmaxe@maet',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.GroupsRemoveParams;
import app.mailset.model.GroupsRemoveResult;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = GroupsRemoveParams.builder()
        .address("moc.elpmaxe@maet")
        .build();
GroupsRemoveResult answer =
        mailset.groups().remove(params);
System.out.println(answer);
use mailset::types::GroupsRemoveParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .groups()
    .remove(GroupsRemoveParams {
        address: "moc.elpmaxe@maet".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/groups.remove \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"address":"moc.elpmaxe@maet"},"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 groups remove moc.elpmaxe@maet
Response
{
  "ok": true,
  "data": {
    "removed": true
  }
}

groups.addMember

Add a mailbox or group to a group.

POST/v1/groups.addMember

Admin or ownerPasskey

Parameters

  • addressstringrequired

    The group’s address.

  • memberstringrequired

    The mailbox or group to add or take out, by address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

  • approvalstringoptional

    An approval’s id, once someone approved it with their passkey. Without one, the answer is step_up_required and names what to approve.

Returns

data is the Group object.

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.groups.addMember({
	member: "moc.elpmaxe@alrac",
	address: "moc.elpmaxe@maet",
});
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.groups.add_member(
    {
        "member": "moc.elpmaxe@alrac",
        "address": "moc.elpmaxe@maet",
    }
)
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.GroupsAddMemberParams{
		Member:  "moc.elpmaxe@alrac",
		Address: "moc.elpmaxe@maet",
	}
	answer, err := client.Groups.AddMember(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.groups.add_member(
  member: 'moc.elpmaxe@alrac',
  address: 'moc.elpmaxe@maet'
)
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->groups->addMember([
    'member' => 'moc.elpmaxe@alrac',
    'address' => 'moc.elpmaxe@maet',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Group;
import app.mailset.model.GroupsAddMemberParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = GroupsAddMemberParams.builder()
        .member("moc.elpmaxe@alrac")
        .address("moc.elpmaxe@maet")
        .build();
Group answer = mailset.groups().addMember(params);
System.out.println(answer);
use mailset::types::GroupsAddMemberParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .groups()
    .add_member(GroupsAddMemberParams {
        address: "moc.elpmaxe@maet".into(),
        member: "moc.elpmaxe@alrac".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/groups.addMember \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"member":"moc.elpmaxe@alrac","address":"moc.elpmaxe@maet"},"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 groups addMember moc.elpmaxe@maet --member moc.elpmaxe@alrac
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "address": "moc.elpmaxe@olleh",
    "name": "Acme API",
    "senders": "anyone",
    "members": [
      "text"
    ]
  }
}

groups.removeMember

Take a mailbox or group out of a group.

POST/v1/groups.removeMember

Admin or owner

Parameters

  • addressstringrequired

    The group’s address.

  • memberstringrequired

    The mailbox or group to add or take out, by address.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is the Group object.

In the CLIErrors

import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.groups.removeMember({
	member: "moc.elpmaxe@neb",
	address: "moc.elpmaxe@maet",
});
console.log(answer);
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.groups.remove_member(
    {
        "member": "moc.elpmaxe@neb",
        "address": "moc.elpmaxe@maet",
    }
)
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.GroupsRemoveMemberParams{
		Member:  "moc.elpmaxe@neb",
		Address: "moc.elpmaxe@maet",
	}
	answer, err := client.Groups.RemoveMember(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.groups.remove_member(
  member: 'moc.elpmaxe@neb',
  address: 'moc.elpmaxe@maet'
)
p answer
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->groups->removeMember([
    'member' => 'moc.elpmaxe@neb',
    'address' => 'moc.elpmaxe@maet',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.Group;
import app.mailset.model.GroupsRemoveMemberParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = GroupsRemoveMemberParams.builder()
        .member("moc.elpmaxe@neb")
        .address("moc.elpmaxe@maet")
        .build();
Group answer = mailset.groups().removeMember(params);
System.out.println(answer);
use mailset::types::GroupsRemoveMemberParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .groups()
    .remove_member(GroupsRemoveMemberParams {
        address: "moc.elpmaxe@maet".into(),
        member: "moc.elpmaxe@neb".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/groups.removeMember \
  -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","address":"moc.elpmaxe@maet"},"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 groups removeMember moc.elpmaxe@maet --member moc.elpmaxe@neb
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "address": "moc.elpmaxe@olleh",
    "name": "Acme API",
    "senders": "anyone",
    "members": [
      "text"
    ]
  }
}