API referenceAccount

Show account identity, scopes, plan, and usage

Returns the identity and live state of the account behind the calling API key: the userId and projectId, the active organization (its id and your role) and every organization you belong to (organizations), the key's id, granted scopes, allowedIps, and inboxIds restriction, and the account's plan, limits, usage, period, storage, and credits wallet.

Endpoint
GET https://api.dairo.app/v1/whoami

Returns the identity and live state of the account behind the calling API key: the userId and projectId, the active organization (its id and your role) and every organization you belong to (organizations), the key's id, granted scopes, allowedIps, and inboxIds restriction, and the account's plan, limits, usage, period, storage, and credits wallet. Any valid key can call it — no specific scope is required — which makes it the canonical way to confirm a key works and to read what it may do; scopes is the expanded set, since scope bundles are resolved to their member scopes when the key is created. usage holds current-period counters (messagesThisMonth, inboundMessagesThisMonth, outboundRecipientsThisMonth, outboundMessagesThisMonth, extractionsThisMonth, inboxes, domains, storageBytes), each measured against the matching key in limits (messagesPerMonth, extractionsPerMonth, inboxes, domains, storageBytes); period.monthStart is the UTC start of the current monthly window, and the counters reset to zero when a new period begins. storage reports usedBytes, limitBytes, and remainingBytes with a breakdown into messageBodyBytes, attachmentBytes, fileBytes, expiringFileBytes, and activeStorageObjects; wallet reports balanceUsd, reservedUsd, and availableUsd. The call is read-only with no side effects — use it to check remaining headroom before a large send or upload; see plans and limits for how each counter is counted.

Scope: __any__. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl "https://api.dairo.app/v1/whoami" \
  -H "Authorization: Bearer $DAIRO_API_KEY"

Response

200 Success. Body: application/json, WhoamiResponse.

FieldTypeRequiredDescription
userIdstringyes
projectIdstring or nullno
apiKeyWhoamiApiKeyyes
planstringyes
limitsobjectyes
usageobjectyes
periodobjectyes
notesobjectyes
storageWhoamiStorageyes
organizationActiveOrganizationno
organizationsarray of OrganizationnoEvery organization the account is a member of (the org switcher list).
lettersobjectnoPhysical-mail status for this account, so you know before sending whether a letter will really be printed.
200
{
  "userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "projectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "apiKey": {
    "id": "string",
    "scopes": [
      "string"
    ]
  },
  "plan": "string",
  "limits": {},
  "usage": {},
  "period": {},
  "notes": {},
  "storage": {
    "usedBytes": 0,
    "limitBytes": 0,
    "remainingBytes": 0,
    "breakdown": {
      "mailBodyBytes": 0,
      "attachmentBytes": 0,
      "fileBytes": 0,
      "expiringFileBytes": 0,
      "activeFileObjects": 0
    }
  },
  "organization": {
    "id": "string",
    "role": "string"
  },
  "organizations": [
    {
      "id": "string",
      "name": "Ada Lovelace",
      "slug": "welcome",
      "vanitySlug": null,
      "role": "owner"
    }
  ],
  "letters": {
    "enabled": true,
    "printMode": "test",
    "printModeNote": "string"
  }
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page