# Errors

Response conventions and the real error shapes the Hostraha reseller API returns.

The reseller API uses HTTP status codes to signal success or failure, and returns JSON in the body. Success responses vary in shape from call to call — some return a bare string, some a small object. Errors return an object with an `error` key (with one Cloudflare exception noted below).

## Success shapes

A `200` response can take several forms depending on the endpoint:

- A bare JSON string, such as `"success"`, `"unlocked"`, or `"2.3.0"`.
- `{"success":true}` — for example, after saving nameservers.
- `{"status":"success","message":"","success":"success"}` — for example, after saving contacts or the registrar lock.

Do not assume one fixed success shape. Check the per-endpoint response examples in the API reference.

## Error responses

| Status | Body | When it happens |
| --- | --- | --- |
| `403` | `{"error":"Provided domain has not been found in reseller account"}` | The domain is not active in or owned by your reseller account — commonly because an order is still pending. |
| `500` | `{"error":"Registrar Error: Domain ... not found in this registrar."}` | You called sync on a domain that has not been provisioned at the registrar yet. |
| `501` | `{"error":"Function not supported by the registrar module"}` | The feature is not implemented by the registrar module backing your account. |
| `400` | `{"error":"Request validation error - Please contact administration"}` | Required or valid parameters are missing — for example, calling suggestions without `suggestionSettings`. |
| `403` | `error code: 1010` | Cloudflare blocked the request because of a non-browser User-Agent. |

### Domain not in reseller account (403)

```json
{"error":"Provided domain has not been found in reseller account"}
```

Management endpoints (information, contacts, nameservers, lock, and so on) return this while an order is still pending. The domain provisions to your account only after the account and order are active. See [Credits and billing](/guides/credits-and-billing).

### Registrar error on sync (500)

```json
{"error":"Registrar Error: Domain hostraha-demo-42.com not found in this registrar."}
```

Syncing a domain that has not yet been provisioned at the registrar returns this. Wait until the order is active before syncing.

### Function not supported (501)

```json
{"error":"Function not supported by the registrar module"}
```

The registrar module behind your account does not implement this feature. In the current sandbox this applies to DNS (get/save), email forwarding (get/save), EPP code (get), and ID protection.

<Note>
  A `501` depends on the registrar module backing your reseller account, not on your request. These functions may be supported in a production account whose registrar implements them. Treat `501` as "not available on this account" rather than a bug in your call.
</Note>

### Request validation error (400)

```json
{"error":"Request validation error - Please contact administration"}
```

A required or valid parameter is missing or malformed. For example, `POST /domains/lookup/suggestions` returns this if you omit `suggestionSettings`. Recheck the parameters against the endpoint's reference page.

### Cloudflare block (403)

```
error code: 1010
```

This is not JSON from the API — it is a Cloudflare block triggered by a non-browser User-Agent (for example `Python-urllib`). Send a normal User-Agent. See [Authentication](/guides/authentication#cloudflare-and-the-user-agent).
