# Cloudflare Integration Reference

## API Token Permissions

| Feature | Permission Required | Endpoint |
|---|---|---|
| DNS read/write | Zone → DNS → Edit | `GET/POST /zones/{id}/dns_records` |
| List zones | Zone → DNS → Read | `GET /zones` |
| View domains + expiry | Account → Registrar → Read | `GET /accounts/{id}/registrar/domains` |
| Domain renewal | Account → Registrar → Admin | `POST /accounts/{id}/registrar/domains/{name}/renew` |
| Domain registration | Account → Registrar → Admin | `POST /accounts/{id}/registrar/domains/{name}/register` |
| Domain availability check | Account → Registrar → Admin | `GET /accounts/{id}/registrar/domains/{name}/check` |

## Domain Pricing (Cloudflare at cost, verified Jul 6, 2026)

- .com registration: $10.46/yr
- .com renewal: $10.46/yr
- .com transfer: $10.46
- No premium markup on standard TLDs

## Availability Check Response Fields

```json
{
  "name": "example.com",
  "supported_tld": true,
  "premium": false,
  "available": true,
  "can_register": true,
  "fees": {
    "registration_fee": 10.46,
    "renewal_fee": 10.46,
    "transfer_fee": 10.46,
    "redemption_fee": 44.0,
    "currency": "USD"
  }
}
```

Use `GET /accounts/{id}/registrar/domains/{name}/check` to check availability (NOT POST, NOT query params). The endpoint returns fees, premium status, and availability in a single call.

## Domain List Response Fields

Each domain has:
- `name` - domain name
- `expires_at` - ISO 8601 timestamp (use `datetime.fromisoformat`)
- `auto_renew` - boolean
- `cloudflare_registration` - boolean (true = registered through Cloudflare)
- `permissions` - list of allowed actions for this token
- `registry_statuses` - includes `clienttransferprohibited`
