Errors, pagination & idempotency

Status codes, the error format, cursor pagination and safe retries for write requests.

Reference1 min readUpdated 22 Sept 2026.md
On this page

Status codes#

CodeMeaning
200, 201Success
202Accepted — the action runs asynchronously
400Invalid request body or parameters
401Missing or invalid token
403The token lacks permission
404Resource not found
409Conflict, e.g. a name already in use
429Rate limit exceeded — see Retry-After
5xxServer error — safe to retry with backoff

Error format#

JSON
{
  "error": {
    "code": "invalid_region",
    "message": "Region 'ist2' does not exist.",
    "request_id": "req_7Hn2kQ"
  }
}

Include the request_id when contacting support.

Pagination#

List endpoints return up to 50 items per page (maximum 200). Use the next_cursor from meta to fetch the next page:

Shell
curl "https://api.avenlith.com/v1/servers?per_page=50&cursor=eyJpZCI6InNydl84ZjJrMSJ9" \
  -H "Authorization: Bearer $AVENLITH_TOKEN"

Idempotency#

Send an Idempotency-Key header with POST requests. Retrying with the same key within 24 hours returns the original response instead of creating a duplicate server.

Shell
curl -X POST https://api.avenlith.com/v1/servers \
  -H "Authorization: Bearer $AVENLITH_TOKEN" \
  -H "Idempotency-Key: 5c1f7e8a-8a0b-4e8e-9d1b-1f0f7a2b9c11" \
  -d '{"name": "web-01", "plan": "vps-pro", "region": "ist1"}'

Was this page helpful?

Still need help?

Our engineers answer tickets 24/7 — average first response in 7 minutes.

Contact support