# Account API

> The credential, the account and the receiving domains. Every account endpoint with its scope, parameters, body and an example answer.

Source: https://docs.dissolve.email/reference/account

Base URL `https://api.dissolve.email`. Send an API key or OAuth access token as `Authorization: Bearer <token>` ([Authentication](/authentication)); an OAuth token needs the scope on each endpoint. Errors follow [one shape](/errors).

| Endpoint | Summary |
|---|---|
| `GET /v1/connection` | [Describe this credential](#describe-this-credential) |
| `GET /v1/me` | [Get the account and its limits](#get-the-account-and-its-limits) |
| `GET /v1/domains` | [List the domains for new addresses](#list-the-domains-for-new-addresses) |

### Describe this credential

`GET /v1/connection`

What the bearer credential is: an API key (`kind` user or cli, scopes `*`) or an OAuth connection (`kind` mcp or app, the scopes the person approved), its per-minute rate and the resource an OAuth token was issued for. Needs no scope.

```bash cURL
curl "https://api.dissolve.email/v1/connection" \
  -H "Authorization: Bearer $DISSOLVE_API_KEY"
```

```ts TypeScript
import { Dissolve } from '@dissolve-email/sdk';

const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.connection();
```

```python Python
import os, requests

API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.get("https://api.dissolve.email/v1/connection", headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())
```

**Response** `200`

```json
{
  "kind": "user",
  "clientId": null,
  "scopes": [
    "*"
  ],
  "requestsPerMinute": 100,
  "resource": null
}
```

### Get the account and its limits

`GET /v1/me` (scope `profile`)

The account id, plan, subscription status and the limits that matter to an API caller. The email address is included only when the connection has the `email` scope.

```bash cURL
curl "https://api.dissolve.email/v1/me" \
  -H "Authorization: Bearer $DISSOLVE_API_KEY"
```

```ts TypeScript
import { Dissolve } from '@dissolve-email/sdk';

const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.me();
```

```python Python
import os, requests

API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.get("https://api.dissolve.email/v1/me", headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())
```

**Response** `200`

```json
{
  "id": "usr7Np2QkX9mVc4Rt1ZbL",
  "email": "you@example.com",
  "plan": "pro",
  "subscriptionStatus": "active",
  "limits": {
    "maxInboxes": 10,
    "inboxDurationMinutes": 30,
    "maxAliasesPerInbox": 5,
    "customInboxNames": true,
    "agentIdentities": true,
    "maxAgentIdentities": 10,
    "agentWaitTimeoutSeconds": 30,
    "vault": true,
    "requestsPerMinute": 100
  },
  "connection": {
    "kind": "user",
    "clientId": null,
    "scopes": [
      "*"
    ]
  }
}
```

### List the domains for new addresses

`GET /v1/domains`

The receiving domains a new inbox or identity can use, and the default. Pro and Business may choose one with `domain` when creating; Free always gets the default.

```bash cURL
curl "https://api.dissolve.email/v1/domains" \
  -H "Authorization: Bearer $DISSOLVE_API_KEY"
```

```ts TypeScript
import { Dissolve } from '@dissolve-email/sdk';

const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.listDomains();
```

```python Python
import os, requests

API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.get("https://api.dissolve.email/v1/domains", headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())
```

**Response** `200`

```json
{
  "domains": [
    {
      "id": "d-0",
      "domain": "dissolve.email",
      "isDefault": true
    }
  ],
  "defaultDomain": "dissolve.email"
}
```
