Kong/insomnia · error

Konnect API error

Error message

Konnect API error ${response.status} ${errorContext}

What it means

Generic Konnect API error from fetchAllOffsetPaginated: an offset-paginated endpoint (context described by errorContext, e.g. API products) returned a non-OK status. The status code and the error context string are interpolated for diagnosis.

Solutions

  1. Check PAT validity and permissions for the failing resource
  2. Inspect the status code (401/403 auth vs 5xx server)
  3. Retry the sync after the API recovers
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/insomnia/src/konnect/api.ts:197 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/dd3f377f428a193e. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia/src/konnect/api.ts:197

    page++;
  } while (page <= totalPages);
}

async function fetchAllOffsetPaginated<T>(
  baseUrl: string,
  pat: string,
  errorContext: string,
  signal?: AbortSignal,
): Promise<T[]> {
  const results: T[] = [];
  let offset: string | null = null;

  do {
    const url = offset ? `${baseUrl}?size=${PAGE_SIZE}&offset=${offset}` : `${baseUrl}?size=${PAGE_SIZE}`;
    const response = await fetchWithRetry(url, pat, signal);

    if (!response.ok) {
      throw new Error(`Konnect API error ${response.status} ${errorContext}`);
    }

    const body = await response.json();
    results.push(...(body.data as T[]));
    offset = body.offset ?? null;
  } while (offset !== null);

  return results;
}

export async function fetchAllServices(
  pat: string,
  cpId: string,
  region: string,
  signal?: AbortSignal,
): Promise<KonnectService[]> {
  const services = await fetchAllOffsetPaginated<KonnectService>(
    `${regionalApiBase(region)}/v2/control-planes/${cpId}/core-entities/services`,

View on GitHub (pinned to d9bb2b0142)