# Site Health: The REST API encountered an error / Your site could not complete a loopback request (cURL error 28)

**Code:** `The REST API encountered an error` · **Category:** WordPress · **Seen on:** WordPress

WordPress couldn’t call itself over HTTP — needed for the block editor, cron, plugin/theme editors and Site Health.

## Meaning

Loopbacks go from the server to its own public URL. Firewalls, DNS that resolves to an unreachable IP inside the server, basic auth, Cloudflare challenges, or self-signed certificates break them (cURL error 28 timeout, cURL error 6/7/60).

## Common causes

- Server can’t reach its own domain (firewall/NAT hairpin/DNS)
- Basic authentication on the site
- Security plugin/WAF blocking server-to-self requests
- Invalid/self-signed SSL certificate
- Slow plugin causing timeout

## Quick fix

1. From the server, curl -I https://yourdomain/wp-json/
2. Add the domain to /etc/hosts pointing to 127.0.0.1 if NAT hairpin fails
3. Allow the server IP in WAF/security plugins

## Detailed fix by platform

### Linux

1. 

```bash
curl -sI https://example.com/wp-json/ | head -3
echo "127.0.0.1 example.com www.example.com" | sudo tee -a /etc/hosts
```


## How to diagnose

1. **Reach** — curl from the server
2. **Error** — cURL error number
3. **Auth** — Basic auth enabled?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/wordpress/rest-api-encountered-an-error-loopback)
