Who am I
Identify the authenticated caller — the fastest way to smoke-test credentials.
Echoes the identity your credentials resolve to. Call it from CI or a deploy hook to confirm an API key is valid, pointed at the right account, and carrying the scope you expect — before any traffic depends on it.
GET /v3/whoami
Response fields
| Parameter | Type | Required | Description |
|---|---|---|---|
account.id | uuid | Optional | The account your credentials belong to. |
account.name · account.plan · account.status | strings | Optional | Display name, current plan and account status (active, suspended, …). |
api_key.id | string | Optional | The id of the key that authenticated the request. |
api_key.scope | string | Optional | full_access, send_only or read_only — see Authentication → Scopes. |
api_key.environment | string | Optional | live or test. |
Response header
| Parameter | Type | Required | Description |
|---|---|---|---|
X-Wemail-Custom-Headers-Visible | "all" · "none" · list | Optional | Which custom X-* headers GET /v3/messages/{id} and webhooks still return while Hide log content is on: all, none, or a comma-separated list of names the organization keeps visible (e.g. X-Order-Id,X-Customer-Ref, set in Organisation → Security). Always all while the policy is off. |
X-Wemail-Log-Content-Hidden | "true" · "false" | Optional | Whether the organization's Hide log content privacy policy is on (Organisation → Security, or locked on by our staff). While true, GET /v3/messages/{id} returns no body; custom headers follow X-Wemail-Custom-Headers-Visible. The delivered email always carries every header. Read both before asserting header read-backs in tests. (A header rather than a body field, so existing SDK versions keep parsing the response; SDKs expose it through their raw / with-HTTP-info call.) |
Responses
| Status | Description |
|---|---|
200 | OK. { account: { id, name, plan, status }, api_key: { id, scope, environment } }, plus the X-Wemail-Log-Content-Hidden and X-Wemail-Custom-Headers-Visible headers. For quota and credit numbers, use GET /v3/usage — see Usage & quota. |
401 | Missing, invalid or revoked API key. |
403 | The account is suspended or deleted. |
Code examples
cURL
curl https://api.wemail.io/v3/whoami \
-H "Authorization: Bearer afn_live_…"Node.js
const res = await fetch("https://api.wemail.io/v3/whoami", {
headers: {
Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
},
});
const data = await res.json();Python
import os, requests
r = requests.get(
"https://api.wemail.io/v3/whoami",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
data = r.json()