Invites

Invites

Invites nobody has accepted yet.

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

On this page
  1. invites.list
  2. invites.revoke
  3. invites.resend
  4. invites.extend

invites.list

List invites nobody has accepted yet.

POST/v1/invites.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 objects, each with:

  • idstring
  • emailstring
  • roleenum

    One ofowneradminmember

  • createdAtnumber
  • expiresAtnumber

In the CLIErrors

import { Mailset } from 'mailset';

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

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

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

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

require 'vendor/autoload.php';

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

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

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

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

let answer = mailset.invites().list().await?;
println!("{answer:?}");
curl https://mailset.app/v1/invites.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 invites list
Response
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "email": "moc.elpmaxe@olleh",
      "role": "owner",
      "createdAt": 1796048940000,
      "expiresAt": 1796048940000
    }
  ]
}

invites.revoke

Cancel an invite.

POST/v1/invites.revoke

Admin or owner

Parameters

  • idstringrequired

    The invite’s id, from invites list.

Beside input

  • orgstringoptional

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

Returns

data is an object with:

  • revokedboolean

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.invites.revoke({
	id: "i_c2e7a9f14b6d3058a1c4e7b9",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.invites.revoke(
    {"id": "i_c2e7a9f14b6d3058a1c4e7b9"}
)
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.InvitesRevokeParams{
		ID: "i_c2e7a9f14b6d3058a1c4e7b9",
	}
	answer, err := client.Invites.Revoke(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.invites.revoke(
  id: 'i_c2e7a9f14b6d3058a1c4e7b9'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->invites->revoke([
    'id' => 'i_c2e7a9f14b6d3058a1c4e7b9',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.InvitesRevokeParams;
import app.mailset.model.InvitesRevokeResult;

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

var params = InvitesRevokeParams.builder()
        .id("i_c2e7a9f14b6d3058a1c4e7b9")
        .build();
InvitesRevokeResult answer =
        mailset.invites().revoke(params);
System.out.println(answer);
use mailset::types::InvitesRevokeParams;

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

let answer = mailset
    .invites()
    .revoke(InvitesRevokeParams {
        id: "i_c2e7a9f14b6d3058a1c4e7b9".into(),
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/invites.revoke \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"i_c2e7a9f14b6d3058a1c4e7b9"},"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 invites revoke i_c2e7a9f14b6d3058a1c4e7b9
Response
{
  "ok": true,
  "data": {
    "revoked": true
  }
}

invites.resend

Email an invite again with a new link, and cancel the old one.

POST/v1/invites.resend

API tokenPasskey

Parameters

  • idstringrequired

    The invite’s id, from invites list.

    At most 64 characters.

  • notestringoptional

    One line of your own words for the invite email, up to 500 characters.

    At most 500 characters.

  • noEmailbooleanoptional

    Only make the new link: nothing is emailed.

    Default false.

Beside input

  • 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:

  • idstring

    The invite’s id: what invites resend, extend and revoke take.

  • emailstring

    The address invited.

  • urlstring

    The invite’s link, shown this once.

  • expiresAtnumber

    When the link stops working, in ms since the epoch.

  • emailedboolean

    The link went to the address by email too.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.invites.resend({
	note: "Here is a new link.",
	id: "i_c2e7a9f14b6d3058a1c4e7b9",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.invites.resend(
    {
        "note": "Here is a new link.",
        "id": "i_c2e7a9f14b6d3058a1c4e7b9",
    }
)
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.InvitesResendParams{
		Note: mailset.String("Here is a new link."),
		ID:   "i_c2e7a9f14b6d3058a1c4e7b9",
	}
	answer, err := client.Invites.Resend(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.invites.resend(
  note: 'Here is a new link.',
  id: 'i_c2e7a9f14b6d3058a1c4e7b9'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->invites->resend([
    'note' => 'Here is a new link.',
    'id' => 'i_c2e7a9f14b6d3058a1c4e7b9',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.InvitesResendParams;
import app.mailset.model.InvitesResendResult;

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

var params = InvitesResendParams.builder()
        .note("Here is a new link.")
        .id("i_c2e7a9f14b6d3058a1c4e7b9")
        .build();
InvitesResendResult answer =
        mailset.invites().resend(params);
System.out.println(answer);
use mailset::types::InvitesResendParams;

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

let answer = mailset
    .invites()
    .resend(InvitesResendParams {
        id: "i_c2e7a9f14b6d3058a1c4e7b9".into(),
        note: Some("Here is a new link.".into()),
        ..Default::default()
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/invites.resend \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"note":"Here is a new link.","id":"i_c2e7a9f14b6d3058a1c4e7b9"}}'

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 invites resend i_c2e7a9f14b6d3058a1c4e7b9 --note "Here is a new link."
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "email": "moc.elpmaxe@olleh",
    "url": "https://hooks.example.com/mailset",
    "expiresAt": 1796048940000,
    "emailed": true
  }
}

invites.extend

Keep an invite’s link working for longer, the same link.

POST/v1/invites.extend

API tokenPasskey

Parameters

  • idstringrequired

    The invite’s id, from invites list.

    At most 64 characters.

  • daysintegerrequired

    How many days the link works from now, 1 to 90.

    From 1 to 90.

Beside input

  • 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:

  • idstring

    The invite’s id.

  • emailstring

    The address invited.

  • expiresAtnumber

    When the link stops working now, in ms since the epoch.

In the CLIErrors

import { Mailset } from 'mailset';

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

const answer = await mailset.invites.extend({
	days: 30,
	id: "i_c2e7a9f14b6d3058a1c4e7b9",
});
console.log(answer);
from mailset import Mailset

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

answer = mailset.invites.extend(
    {"days": 30, "id": "i_c2e7a9f14b6d3058a1c4e7b9"}
)
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.InvitesExtendParams{
		Days: 30,
		ID:   "i_c2e7a9f14b6d3058a1c4e7b9",
	}
	answer, err := client.Invites.Extend(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.invites.extend(
  days: 30,
  id: 'i_c2e7a9f14b6d3058a1c4e7b9'
)
p answer
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->invites->extend([
    'days' => 30,
    'id' => 'i_c2e7a9f14b6d3058a1c4e7b9',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
import app.mailset.Mailset;
import app.mailset.model.InvitesExtendParams;
import app.mailset.model.InvitesExtendResult;

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

var params = InvitesExtendParams.builder()
        .days(30L)
        .id("i_c2e7a9f14b6d3058a1c4e7b9")
        .build();
InvitesExtendResult answer =
        mailset.invites().extend(params);
System.out.println(answer);
use mailset::types::InvitesExtendParams;

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

let answer = mailset
    .invites()
    .extend(InvitesExtendParams {
        id: "i_c2e7a9f14b6d3058a1c4e7b9".into(),
        days: 30,
    })
    .await?;
println!("{answer:?}");
curl https://mailset.app/v1/invites.extend \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"days":30,"id":"i_c2e7a9f14b6d3058a1c4e7b9"}}'

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 invites extend i_c2e7a9f14b6d3058a1c4e7b9 --days 30
Response
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "email": "moc.elpmaxe@olleh",
    "expiresAt": 1796048940000
  }
}