> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailofly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounts

# Accounts

Manage SMTP and Google sending identities. List and get responses never include passwords or OAuth tokens.

## GET `/v1/accounts`

**List accounts**

Returns all sending identities for the authenticated user, newest first. Passwords and OAuth tokens are never included.

### Response fields

* **data** (`Account[]`) — Public account fields only (no secrets).

### Examples

#### 200 — OK

```json theme={null}
{
  "data": [
    {
      "id": "uuid",
      "name": "Transactional",
      "provider_type": "smtp",
      "daily_mail_limit": 500
    }
  ]
}
```

### cURL

```bash theme={null}
curl -sS -X GET "https://api.mailofly.com/v1/accounts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## POST `/v1/accounts`

**Create account**

Create an SMTP or Google sending account. For SMTP, send smtp\_host, smtp\_port, smtp\_username, smtp\_password. For Google, send google\_access\_token and google\_refresh\_token (and usually google\_email).

### Request body — Body — SMTP

Omit smtp\_password on PATCH to keep the current password.

```json theme={null}
{
  "name": "Transactional",
  "provider_type": "smtp",
  "daily_mail_limit": 500,
  "smtp_host": "smtp.example.com",
  "smtp_port": 587,
  "smtp_username": "user",
  "smtp_password": "secret"
}
```

### Response fields

* **data** (`Account`) — Created row.

### Examples

#### 201 — Created

```json theme={null}
{
  "data": { "id": "uuid", "name": "Transactional", "provider_type": "smtp" }
}
```

#### 400 — Validation

```json theme={null}
{ "error": "…", "message": "…" }
```

### cURL

```bash theme={null}
curl -sS -X POST "https://api.mailofly.com/v1/accounts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Transactional","provider_type":"smtp","daily_mail_limit":500,"smtp_host":"smtp.example.com","smtp_port":587,"smtp_username":"user","smtp_password":"secret"}'
```

## GET `/v1/accounts/{id}`

**Get account**

Fetch one account by id. Returns 404 if the account does not exist or does not belong to you.

### Response fields

* **data** (`Account`) — Public fields only.

### Examples

#### 200 — OK

```json theme={null}
{ "data": { "id": "uuid", "name": "…" } }
```

#### 404 — Not found

```json theme={null}
{ "error": "Not found" }
```

### cURL

```bash theme={null}
curl -sS -X GET "https://api.mailofly.com/v1/accounts/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## PATCH `/v1/accounts/{id}`

**Update account**

Partial update. Omit smtp\_password to keep the current stored password.

### Request body — Body

```json theme={null}
{
  "name": "Renamed",
  "daily_mail_limit": 1000
}
```

### Examples

#### 200 — OK

```json theme={null}
{ "data": { … } }
```

#### 404 — Not found

```json theme={null}
{ "error": "Not found" }
```

### cURL

```bash theme={null}
curl -sS -X PATCH "https://api.mailofly.com/v1/accounts/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Renamed","daily_mail_limit":1000}'
```

## DELETE `/v1/accounts/{id}`

**Delete account**

Deletes the sending identity. Does not revoke Google tokens server-side beyond removing the row.

### Examples

#### 200 — OK

```json theme={null}
{ "ok": true }
```

#### 404 — Not found

```json theme={null}
{ "error": "Not found" }
```

### cURL

```bash theme={null}
curl -sS -X DELETE "https://api.mailofly.com/v1/accounts/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## Related

* [Product guide: Accounts](../product/accounts.md)
* [← API overview](README.md)


## Related topics

- [Introduction](/api/index.md)
- [Create API key](/getting-started/api-keys.md)
- [CLI](/cli/index.md)
- [SDKs](/sdks/index.md)
- [Email types](/getting-started/email-types.md)
