Who am I
Who a credential signs in as.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
whoami
Show who you are signed in as.
POST/v1/whoami
Parameters
It takes no input: send an empty object.
Returns
data is an object with:
The account signed in.
The orgs the account is in.
The device, token or app key this call is signed in as.
The address new mail goes out from. Null when they haven’t picked one.
When this session ends, in ms since the epoch, unless it’s ended sooner. Only
whoamisays it.The user handle the account’s passkeys carry. Only
whoamisays it, and only to a person’s own device.
import { Mailset } from 'mailset';
// Reads MAILSET_KEY from the environment.
const mailset = new Mailset();
const answer = await mailset.whoami();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_KEY from the environment.
mailset = Mailset()
answer = mailset.whoami()
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_KEY from the environment.
mailset = Mailset::Client.new
answer = mailset.whoami
p answer
<?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;
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);
// Reads MAILSET_KEY from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.whoami().await?;
println!("{answer:?}");
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 shows how.
mailset whoami
{
"ok": true,
"data": {
"user": {
"id": "out_3f9a1c0e7b2d",
"email": "moc.elpmaxe@olleh",
"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"
}
}