Collection routes return the resources visible to your authenticated account, often with pagination metadata. An integration that reads only the first page can miss domains, zones, orders or keys and make incorrect decisions about what exists.
IN THIS ARTICLE
01 Follow each route's collection contract
For the domain inventory, use GET /v2/domains with supported page, page_size and search parameters. Page numbering starts at one. Other collections can have different limits or bounded results, so inspect their live contract and returned metadata.
- Request the first page with a moderate page size.
- Read the actual collection structure and metadata returned, including the next-page or total information where supplied.
- Continue until the route indicates no later page remains.
- Deduplicate stored resources by their returned public identifier.
- Record when the inventory was collected and refresh before a sensitive operation.
02 Example: keep the inventory page and its metadata together
Use the server-side PHP request helper in the API getting-started article with domains:read access. This PHP example retrieves the first inventory page and retains its pagination metadata. It is a first-page building block, not a complete portfolio synchronization loop.
$query = http_build_query(['page' => 1, 'page_size' => 50]);
$result = nabtechRequest('GET', '/v2/domains?' . $query);
if ($result['http_status'] !== 200 ||
!is_array($result['response']['data'] ?? null)) {
throw new RuntimeException('Domain inventory page failed.');
}
$domains = $result['response']['data'];
$pagination = $result['response']['meta'] ?? [];
Read the result: Use the returned page, page_size, total and pages where supplied to request remaining pages. Keep each domain's public identifier with its exact full domain name. A search string can match additional domain, status or registrar fields, so do not select the first row without comparing the intended name.
Bound concurrency, stop on errors and deduplicate the complete scan by public identifier. A changing portfolio is not an immutable snapshot. Never delete local records or declare domains missing from a partial first-page response.
Does an API search result identify an exact domain match?
The domain collection searches its configured domain, status and registrar fields. A search for a domain string can return more than one relevant row. Compare the complete returned domain name before selecting its identifier.
Do not infer that a missing first-page result means the domain is available for registration. Availability has its own route. A 404 on an owned-resource request can also reflect the wrong account or identifier.
03 Handle changes during an inventory
A large portfolio can change while pages are being read. Keep the scan idempotent in your own database and avoid destructive cleanup based on a single incomplete inventory. For bulk changes, use the supported portfolio preview and its server-computed selection instead of assuming a moving paginated list is an immutable plan.
Respect rate limits and use controlled concurrency. Repeatedly requesting an excessive page size does not guarantee the server will return it; the handler applies its own limits.
04 Preserve identifier meaning
Store domain, zone, record, order and operation identifiers in separate fields. A DNS zone ID is not a registrar domain ID. Use the correct resource's identifier when following a detail or mutation route.
For support, provide the route, search value, account identity, page metadata and a redacted sample row. This is more informative than reporting that the API returned only some of your domains.