# Invites

Invites nobody has accepted yet.

An SDK signs every request with your key: [Authentication](https://mailset.app/docs/authentication.md). To sign one yourself, see [Calling the API without an SDK](https://mailset.app/docs/authentication/http.md).

## invites.list

List invites nobody has accepted yet.

`POST /v1/invites.list`

An admin or owner of the org.

### Parameters

It takes no input: send an empty object.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is a list of objects, each with:

- `id` (string)
- `email` (string)
- `role` (enum): One of `owner`, `admin`, `member`.
- `createdAt` (number)
- `expiresAt` (number)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

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

const answer = await mailset.invites.list();
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.invites.list()
print(answer)
```

Go:

```go
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)
}
```

Ruby:

```ruby
require 'mailset'

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

answer = mailset.invites.list
p answer
```

PHP:

```php
<?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;
```

Java:

```java
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);
```

Rust:

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

let answer = mailset.invites().list().await?;
println!("{answer:?}");
```

curl:

```bash
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](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset invites list
```

### Response

```json
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "email": "hello@example.com",
      "role": "owner",
      "createdAt": 1796048940000,
      "expiresAt": 1796048940000
    }
  ]
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/invites#invites-list)

## invites.revoke

Cancel an invite.

`POST /v1/invites.revoke`

An admin or owner of the org.

### Parameters

- `id` (string, required): The invite’s id, from `invites list`.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is an object with:

- `revoked` (boolean)

### Request

TypeScript:

```typescript
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);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.invites.revoke(
    {"id": "i_c2e7a9f14b6d3058a1c4e7b9"}
)
print(answer)
```

Go:

```go
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)
}
```

Ruby:

```ruby
require 'mailset'

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

answer = mailset.invites.revoke(
  id: 'i_c2e7a9f14b6d3058a1c4e7b9'
)
p answer
```

PHP:

```php
<?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;
```

Java:

```java
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);
```

Rust:

```rust
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:

```bash
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](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset invites revoke i_c2e7a9f14b6d3058a1c4e7b9
```

### Response

```json
{
  "ok": true,
  "data": {
    "revoked": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/invites#invites-revoke)

## invites.resend

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

`POST /v1/invites.resend`

Any signed-in person, with an API token. It can stop for a passkey approval.

### Parameters

- `id` (string, required): The invite’s id, from `invites list`. At most 64 characters.
- `note` (string, optional): One line of your own words for the invite email, up to 500 characters. At most 500 characters.
- `noEmail` (boolean, optional): Only make the new link: nothing is emailed. Default `false`.

Beside `input`:

- `approval` (string, optional): 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:

- `id` (string): The invite’s id: what `invites resend`, `extend` and `revoke` take.
- `email` (string): The address invited.
- `url` (string): The invite’s link, shown this once.
- `expiresAt` (number): When the link stops working, in ms since the epoch.
- `emailed` (boolean): The link went to the address by email too.

### Request

TypeScript:

```typescript
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);
```

Python:

```python
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)
```

Go:

```go
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)
}
```

Ruby:

```ruby
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:

```php
<?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;
```

Java:

```java
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);
```

Rust:

```rust
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:

```bash
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](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset invites resend i_c2e7a9f14b6d3058a1c4e7b9 --note "Here is a new link."
```

### Response

```json
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "email": "hello@example.com",
    "url": "https://hooks.example.com/mailset",
    "expiresAt": 1796048940000,
    "emailed": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/invites#invites-resend)

## invites.extend

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

`POST /v1/invites.extend`

Any signed-in person, with an API token. It can stop for a passkey approval.

### Parameters

- `id` (string, required): The invite’s id, from `invites list`. At most 64 characters.
- `days` (integer, required): How many days the link works from now, 1 to 90. From 1 to 90.

Beside `input`:

- `approval` (string, optional): 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:

- `id` (string): The invite’s id.
- `email` (string): The address invited.
- `expiresAt` (number): When the link stops working now, in ms since the epoch.

### Request

TypeScript:

```typescript
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);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.invites.extend(
    {"days": 30, "id": "i_c2e7a9f14b6d3058a1c4e7b9"}
)
print(answer)
```

Go:

```go
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)
}
```

Ruby:

```ruby
require 'mailset'

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

answer = mailset.invites.extend(
  days: 30,
  id: 'i_c2e7a9f14b6d3058a1c4e7b9'
)
p answer
```

PHP:

```php
<?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;
```

Java:

```java
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);
```

Rust:

```rust
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:

```bash
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](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset invites extend i_c2e7a9f14b6d3058a1c4e7b9 --days 30
```

### Response

```json
{
  "ok": true,
  "data": {
    "id": "out_3f9a1c0e7b2d",
    "email": "hello@example.com",
    "expiresAt": 1796048940000
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/invites#invites-extend)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content