---
title: Account and billing API | SendHQ Docs
description: Read account usage, analytics, and key metadata with an API key; billing changes and key creation or revocation require a dashboard session.
canonical: https://sendhq.cc/docs/api-reference/account
last-updated: 2026-09-07
updated: 2026-09-07
---
# Account and billing

Read account usage, analytics, and key metadata with an API key; billing changes and key creation or revocation require a dashboard session.

GET `/account`

API key

## Retrieve account, usage, billing state, and workspace counts with an API key

API-key equivalent of the dashboard profile: the account owner, current-period recipient and attachment usage against plan limits, access tier, sender reputation summary, subscription state, published plans, and workspace counts. Read-only; billing changes remain session-only.

```shell
curl https://sendhq.cc/api/v1/account \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
```

```json
{
  "user": {},
  "usage": {},
  "access": {},
  "reputation": {},
  "infrastructure": {},
  "billing": {},
  "plans": [],
  "workspace": {
    "mailer": "ses",
    "stats": {}
  }
}
```

GET `/account/diagnostics`

API key

## Diagnose sending and receiving problems in the workspace

Read-only troubleshooting snapshot from stored state: an \`issues\` list in plain language, plan and usage against limits, each domain's DKIM and inbound state, sending identities, 30-day deliverability and sender reputation, suppressions and unsubscribes, the last 30 days of messages that were not sent with their reasons, bounce, complaint and reject events, and webhook delivery health. Never returns message bodies, API keys or webhook secrets.

```shell
curl https://sendhq.cc/api/v1/account/diagnostics \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
```

```json
{
  "generatedAt": "2026-10-30T12:00:00.000Z",
  "windowDays": 30,
  "issues": [
    {
      "severity": "action",
      "code": "domain_unverified",
      "message": "example.com is not verified (pending); 2 of 3 DKIM records are not visible in DNS yet."
    }
  ],
  "plan": {},
  "domains": [],
  "sendingIdentities": {
    "domains": [],
    "addresses": []
  },
  "inbound": {},
  "deliverability": {},
  "suppressions": {},
  "failures": {
    "notSent": [],
    "recentNotSent": [],
    "recentProviderEvents": []
  },
  "webhooks": []
}
```

GET `/analytics`

API key

## Retrieve dashboard sending analytics for 7, 30, or 90 days

Sent, received, delivered, bounced, blocked, opened, clicked, and complaint totals for the window, a per-day sent/received timeline, the top sending domains, and the best-performing subjects.

**Query parameters** `days`

```shell
curl https://sendhq.cc/api/v1/analytics \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
```

```json
{
  "window": "30d",
  "days": 30,
  "metrics": {
    "sent": 0,
    "received": 0,
    "bounced": 0,
    "blocked": 0,
    "delivered": 0,
    "opened": 0,
    "clicks": 0,
    "complaints": 0
  },
  "timeline": [],
  "domains": [],
  "topContent": []
}
```

GET `/profile`

Browser session

## Retrieve account, usage, and stacked subscription state

Retrieve account, usage, and stacked subscription state

```shell
curl https://sendhq.cc/api/v1/profile \
  -X GET \
  -H "Cookie: sendhq_session_v2=…"
```

```json
{
  "user": {},
  "usage": {},
  "access": {},
  "reputation": {},
  "billing": {},
  "plans": []
}
```

POST `/billing/checkout`

Browser session

## Start a hosted checkout for a plan not already held (tier, message class, and billing interval)

Start a hosted checkout for a plan not already held (tier, message class, and billing interval)

```shell
curl https://sendhq.cc/api/v1/billing/checkout \
  -X POST \
  -H "Cookie: sendhq_session_v2=…" \
  -H "Content-Type: application/json" \
  -d '{"plan_key":"scaleup_marketing_annual"}'
```

```json
{
  "url": "https://checkout.example/…",
  "session_id": "…"
}
```

POST `/billing/cancel`

Browser session

## Cancel the current subscription in-app without touching the provider

Cancel the current subscription in-app without touching the provider

```shell
curl https://sendhq.cc/api/v1/billing/cancel \
  -X POST \
  -H "Cookie: sendhq_session_v2=…"
```

```json
{
  "ok": true
}
```

POST `/keys`

Browser session

## Create an API key

Create an API key

```shell
curl https://sendhq.cc/api/v1/keys \
  -X POST \
  -H "Cookie: sendhq_session_v2=…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Production"}'
```

```json
{
  "id": "key_…",
  "name": "Production",
  "key": "re_…",
  "prefix": "re_…"
}
```

GET `/keys`

API key

## List API-key metadata

List key names, non-secret prefixes, and last-used timestamps. Full key values are never returned. Creating and revoking keys requires a dashboard session.

```shell
curl https://sendhq.cc/api/v1/keys \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
```

```json
{
  "data": [],
  "count": 0
}
```

DELETE `/keys/:id`

Browser session

## Revoke an API key

Revoke an API key

```shell
curl https://sendhq.cc/api/v1/keys/id_value \
  -X DELETE \
  -H "Cookie: sendhq_session_v2=…"
```

```json
{
  "ok": true
}
```
