# Devices

Where you are signed in, and signing a device out.

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).

## devices.list

List your signed-in devices.

`POST /v1/devices.list`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

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

- `id` (string)
- `name` (string)
- `kind` (enum): One of `browser`, `cli`, `token`, `app`, `phone`.
- `createdAt` (number)
- `lastSeenAt` (number)
- `current` (boolean)
- `ip` (nullable string): Where the device last connected from. Null until it has, or when nothing says.
- `location` (nullable string)

### Request

TypeScript:

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

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

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

Python:

```python
from mailset import Mailset

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

answer = mailset.devices.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.Devices.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.devices.list
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->devices->list();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Device;
import java.util.List;

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

List<Device> answer = mailset.devices().list();
System.out.println(answer);
```

Rust:

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

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

curl:

```bash
curl https://mailset.app/v1/devices.list \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

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 devices list
```

### Response

```json
{
  "ok": true,
  "data": [
    {
      "id": "out_3f9a1c0e7b2d",
      "name": "Acme API",
      "kind": "browser",
      "createdAt": 1796048940000,
      "lastSeenAt": 1796048940000,
      "current": true,
      "ip": "text",
      "location": "text"
    }
  ]
}
```

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

## devices.revoke

Sign a device out for good.

`POST /v1/devices.revoke`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The device’s id, from `devices list`.

### 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.devices.revoke({
	id: "d_4b8e2a6c9f1d3057b3e8a2c6",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.devices.revoke(
    {"id": "d_4b8e2a6c9f1d3057b3e8a2c6"}
)
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.DevicesRevokeParams{
		ID: "d_4b8e2a6c9f1d3057b3e8a2c6",
	}
	answer, err := client.Devices.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.devices.revoke(
  id: 'd_4b8e2a6c9f1d3057b3e8a2c6'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->devices->revoke([
    'id' => 'd_4b8e2a6c9f1d3057b3e8a2c6',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.DevicesRevokeParams;
import app.mailset.model.DevicesRevokeResult;

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

var params = DevicesRevokeParams.builder()
        .id("d_4b8e2a6c9f1d3057b3e8a2c6")
        .build();
DevicesRevokeResult answer =
        mailset.devices().revoke(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::DevicesRevokeParams;

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

let answer = mailset
    .devices()
    .revoke(DevicesRevokeParams {
        id: "d_4b8e2a6c9f1d3057b3e8a2c6".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/devices.revoke \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"d_4b8e2a6c9f1d3057b3e8a2c6"}}'
```

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 devices revoke --id d_4b8e2a6c9f1d3057b3e8a2c6
```

### Response

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

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

## devices.revokeOthers

Sign out every device but this one. App keys and API tokens stay.

`POST /v1/devices.revokeOthers`

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

### Parameters

It takes no input: send an empty object.

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:

- `revoked` (number)

### Request

TypeScript:

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

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

const answer = await mailset.devices.revokeOthers();
console.log(answer);
```

Python:

```python
from mailset import Mailset

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

answer = mailset.devices.revoke_others()
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.Devices.RevokeOthers(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.devices.revoke_others
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

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

$answer = $mailset->devices->revokeOthers();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.DevicesRevokeOthersResult;

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

DevicesRevokeOthersResult answer =
        mailset.devices().revokeOthers();
System.out.println(answer);
```

Rust:

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

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

curl:

```bash
curl https://mailset.app/v1/devices.revokeOthers \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

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 devices revokeOthers
```

### Response

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

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

---

© 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