# How do pagination, expand, and errors work?

Every Help.Center API endpoint shares the same conventions for responses,
pagination, content expansion, and errors. Read this once — it applies to
articles, conversations, knowledge, and actions alike.


RESPONSE ENVELOPES

List endpoints wrap results in a common envelope:

{
  "object": "list",
  "data": [ ... ],
  "has_more": false,
  "count": 10,
  "url": "/api/v0/centers/CENTER_ID/articles"
}

Count endpoints return totals without the items themselves. Article counts
return a single total; conversation counts break the total down by status:

{
  "object": "count",
  "open": 14,
  "pending": 3,
  "closed": 421,
  "total": 438,
  "url": "/api/v0/centers/CENTER_ID/conversations/count"
}


CURSOR PAGINATION

List endpoints use cursor-based pagination:

ParameterDescription limitItems per page. Min 1, max 100, default 50.
starting_afterReturn items after this item's id (forward pagination).
ending_beforeReturn items before this item's id (backward pagination).

When a response has "has_more": true, pass the last item's id as starting_after
to fetch the next page:

curl -s -X GET \
  -H "Authorization: Bearer $HC_API_KEY" \
  "https://api.help.center/v0/centers/$HC_CENTER_ID/articles?limit=50&starting_after=LAST_ARTICLE_ID"

Please Note

> Knowledge and action list endpoints currently support limit and report
> has_more, but do not yet accept cursor parameters. Their guides note this
> where it applies.


THE EXPAND PARAMETER

GET endpoints return lightweight objects by default — no content body. Add
expand[]=content to include the full HTML and plain-text content:

curl -s -X GET \
  -H "Authorization: Bearer $HC_API_KEY" \
  "https://api.help.center/v0/centers/$HC_CENTER_ID/articles/ARTICLE_ID?expand[]=content"

This adds a content object to the response:

{
  "content": {
    "html": "<h2>Section</h2><p>Body...</p>",
    "text": "Section\nBody..."
  }
}

Always use expand[]=content when you need to read or modify content. Fetching
lists without it keeps responses small and fast.


ERRORS

All errors use one structured format:

{
  "error": {
    "type": "invalid_request_error",
    "message": "Human-readable description of the error",
    "code": "specific_error_code"
  }
}

Validation errors also include a param field naming the offending field. Common
codes:

HTTP statusCodeMeaning 400missing_required_fieldA required field (e.g. title)
was not provided. 400validation_errorThe request body failed validation. Unknown
fields are rejected. 401invalid_api_keyAPI key is invalid or missing.
403insufficient_scopeAPI key lacks the required scope. 403center_blockedThe
center is blocked. 404not_foundThe resource does not exist (or is not published,
for published-article endpoints). 404endpoint_not_foundThe requested API
endpoint does not exist. 429rate_limitedToo many requests — wait and retry.

Each surface also has its own specific error codes (for example
root_not_published on translations or missing_recipient on replies); they are
documented in the relevant guides.


RATE LIMITS

Requests are rate-limited per IP address — currently 20 requests per 30 seconds.
Responses include standard RateLimit-* headers so you can see your remaining
budget.

When you receive HTTP 429, back off and retry after a short delay. For bulk work
(imports, migrations), space requests about two seconds apart.


TIMESTAMPS AND IDS

All timestamps are ISO 8601 strings in UTC, e.g. "2024-01-01T00:00:00.000Z". IDs
are opaque strings — store and compare them, but don't parse them.


NEXT STEPS

 * How to create and publish help articles via API?
   [https://developers.help.center/article/1013-how-to-create-and-publish-help-articles-via-api]
 * How to read conversations via API?
   [https://developers.help.center/article/1018-how-to-read-conversations-via-api]