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

# Errors, rate limits and pagination

> How the Servbase API reports errors, how many requests a key may send, and how to page through long lists.

## Error format

Errors use standard HTTP status codes and a JSON body:

```json theme={null}
{
  "detail": "Redeploy is not allowed for static HTML and PHP apps. Update files live via file manager.",
  "error_code": "SVA-409"
}
```

* `detail` is a readable message you can log or show.
* `error_code` is stable: use it in code instead of matching the text. Every code is listed in [Error codes](https://docs.servbase.net/reference/error-codes.md).

## Status codes

| Status | Meaning | What to do |
| - | - | - |
| `200`, `201` | Success | |
| `400` | The request is invalid, for example a bad name | Fix the request |
| `401` | The key is missing, wrong or deleted | Check the `Authorization` header and the key |
| `403` | The key lacks the scope, or the account cannot do this | Add the scope to a new key, or check the account |
| `404` | Not found, or outside the key's resource limits | Check the ID and the key's resources |
| `409` | The action conflicts with the current state, for example a deploy already in progress | Wait or change the state first |
| `422` | The body does not match the expected fields | Check field names and types |
| `423` | The app is held for a policy review | Contact support |
| `429` | Rate limit exceeded | Wait and retry (below) |
| `5xx` | A server or node problem | Retry with backoff; contact support if it continues |

## Rate limits

Each key may send **600 requests per minute**. Above that the API answers `429` with:

```json theme={null}
{ "detail": "Rate limit exceeded (600 requests per minute).", "error_code": "SVA-429" }
```

Retry after a short pause, with exponential backoff:

```python theme={null}
import time, requests

def call(method, url, **kwargs):
    for attempt in range(5):
        res = requests.request(method, url, timeout=30, **kwargs)
        if res.status_code != 429 and res.status_code < 500:
            return res
        time.sleep(2 ** attempt)  # 1, 2, 4, 8, 16 seconds
    res.raise_for_status()
    return res
```

## Pagination

> [tab] Page based
>
> Used by `GET /app/list` and `GET /credits/ledger`. Pass `page` (from 1) and `page_size`. The response includes `total` and `total_pages`.
>
> ```bash theme={null}
> curl "https://api.servbase.net/app/list?page=2&page_size=20" \
>   -H "Authorization: Bearer $SERVBASE_API_KEY"
> ```

> [tab] Cursor based
>
> Used by deployments and objects.
>
> * **Deployments:** pass the last deployment's `id` as `before`; `has_more` says whether more exist.
> * **Objects:** pass the previous response's `next_cursor` as `cursor`; an empty `next_cursor` means the end.
>
> ```bash theme={null}
> curl "https://api.servbase.net/app/apps/$APP_ID/deployments?limit=20&before=1842" \
>   -H "Authorization: Bearer $SERVBASE_API_KEY"
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.