# Get account settings

`GET /api/account`

Returns the signed-in user's Wildmail account, current plan and configured message retention.

Send API requests to your Wildmail application origin. The documentation host does not serve API requests.

## Authentication

- session: Send the credential in the cookie named `better-auth.session_token`. Browser session cookie used by the hosted app. It may use the __Secure- cookie prefix. Use the auth client to manage cookies.

## Responses

### 200

Account settings.

Content type: `application/json`.

Schema:

```json
{
  "type": "object",
  "properties": {
    "account": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "userId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "suspended",
            "disabled"
          ]
        },
        "plan": {
          "$ref": "#/components/schemas/AccountPlan"
        },
        "billing": {
          "$ref": "#/components/schemas/AccountBilling"
        },
        "retentionDays": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  },
  "required": [
    "account"
  ]
}
```

### 401

A signed-in session is required.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 404

Account not found.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

## Referenced schemas

References resolve against the [OpenAPI specification](/openapi.json).

### #/components/schemas/AccountPlan

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "maxMessageBytes": {
      "type": "integer"
    },
    "monthlyMessageLimit": {
      "type": "integer"
    },
    "storageLimitBytes": {
      "type": "integer"
    },
    "customDomainLimit": {
      "type": [
        "integer",
        "null"
      ]
    },
    "retentionLimitDays": {
      "type": "integer"
    }
  },
  "required": [
    "id",
    "maxMessageBytes",
    "monthlyMessageLimit",
    "storageLimitBytes",
    "customDomainLimit",
    "retentionLimitDays"
  ]
}
```

### #/components/schemas/AccountBilling

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "paidThrough": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancelAtPeriodEnd": {
      "type": "boolean"
    }
  },
  "required": [
    "status",
    "paidThrough",
    "cancelAtPeriodEnd"
  ]
}
```

### #/components/schemas/Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "limit": {
      "type": "integer"
    }
  },
  "required": [
    "error"
  ]
}
```
