# Who am I

Who a credential signs in as.

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

## whoami

Show who you are signed in as.

`POST /v1/whoami`

Any app key. Or a person: any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is an object with:

- `user` (object): The account signed in.
  - `id` (string): The account’s id.
  - `email` (string): The address they sign in with.
  - `name` (nullable string): Their name. Null when they haven’t given one.
- `orgs` (array of objects): The orgs the account is in.
  - `id` (string): The org’s id: what `--org` takes.
  - `name` (string): The org’s name, as its people see it.
  - `role` (enum): Your role in it: `owner`, `admin` or `member`. One of `owner`, `admin`, `member`.
- `device` (object): The device, token or app key this call is signed in as.
  - `id` (string): The device’s id.
  - `name` (string): Its name: “Safari on iPhone”, or the name an app or token was given.
  - `kind` (enum): What it is: a `browser`, the `cli`, an API `token`, an `app` with a key, or the iPhone app (`phone`). One of `browser`, `cli`, `token`, `app`, `phone`.
- `defaultFrom` (nullable string): The address new mail goes out from. Null when they haven’t picked one.
- `sessionEndsAt` (number, optional): When this session ends, in ms since the epoch, unless it’s ended sooner. Only `whoami` says it.
- `passkeyHandle` (string, optional): The user handle the account’s passkeys carry. Only `whoami` says it, and only to a person’s own device.

### Request

TypeScript:

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

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

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

Python:

```python
from mailset import Mailset

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

answer = mailset.whoami()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_KEY from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Whoami(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

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

answer = mailset.whoami
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

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

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

Java:

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

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

Me answer = mailset.whoami();
System.out.println(answer);
```

Rust:

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

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

curl:

```bash
curl https://mailset.app/v1/whoami \
  -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 whoami
```

### Response

```json
{
  "ok": true,
  "data": {
    "user": {
      "id": "out_3f9a1c0e7b2d",
      "email": "hello@example.com",
      "name": "Acme API"
    },
    "orgs": [
      {
        "id": "out_3f9a1c0e7b2d",
        "name": "Acme API",
        "role": "owner"
      }
    ],
    "device": {
      "id": "out_3f9a1c0e7b2d",
      "name": "Acme API",
      "kind": "browser"
    },
    "defaultFrom": "text",
    "sessionEndsAt": 1796048940000,
    "passkeyHandle": "text"
  }
}
```

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

---

© 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