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

# Network Errors

> Get an aggregated breakdown of 5xx (and optionally 4xx) edge errors for the application.

Returns aggregated edge error counts for the application over a time window, grouped by status code, time bucket, request path and HTTP method. By default only 5xx responses are included; pass `include_4xx=true` to also count 4xx responses.

<Info>
  Cache miss rate limit: 15 requests per 60 seconds per owner. Returns an empty breakdown when there are no matching errors or when the window precedes the application's creation date.
</Info>

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Because 4xx errors include client-caused hits like scanner probes and expired links, they are excluded by default; enable `include_4xx=true` only when you specifically need that noise, for example while auditing bot traffic. 5xx codes reflect problems at the edge or the application itself, so they are always included.

This endpoint is available on every paid plan, the same as [Network Analytics](/en/api-reference/endpoint/apps/network/analytics). If you need per-request detail instead of aggregated counts, see [Network Logs](/en/api-reference/endpoint/apps/network/logs) (Pro and Enterprise only). For latency instead of error rate, see [Network Performance](/en/api-reference/endpoint/apps/network/performance).

### Parameters

<ParamField path="app_id" type="string" placeholder="Application ID" required>
  The ID of the application. You can find this in the URL of your application's dashboard.
</ParamField>

<ParamField query="start" type="string" placeholder="ISO 8601 timestamp" required>
  ISO 8601 start timestamp for the analysis window.
</ParamField>

<ParamField query="end" type="string" placeholder="ISO 8601 timestamp" required>
  ISO 8601 end timestamp. Must be after `start`.
</ParamField>

<ParamField query="include_4xx" type="string" placeholder="false">
  Whether to include 4xx responses alongside 5xx errors. Accepts `true` or `false`. Defaults to `false`.
</ParamField>

### Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful.. `success` if successful, `error` if not.
</ResponseField>

<ResponseField name="response" type="object">
  Aggregated error breakdown for the window.

  <Expandable title="Toggle response object">
    <ResponseField name="summary" type="object">
      High-level totals for the window.

      <Expandable title="Toggle summary object">
        <ResponseField name="total" type="integer">Total number of error responses in the window.</ResponseField>

        <ResponseField name="by_class" type="object">
          Totals split by HTTP status class.

          <Expandable title="Toggle by_class object">
            <ResponseField name="4xx" type="integer">Total 4xx responses (only populated when `include_4xx=true`).</ResponseField>
            <ResponseField name="5xx" type="integer">Total 5xx responses.</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="by_status" type="array">
      Number of requests grouped by each individual HTTP status code observed.

      <Expandable title="Toggle by_status item">
        <ResponseField name="status" type="integer">HTTP status code (e.g. `502`, `504`).</ResponseField>
        <ResponseField name="requests" type="integer">Total requests that returned this status code.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="timeseries" type="array">
      Time-bucketed counts across the analysis window.

      <Expandable title="Toggle timeseries item">
        <ResponseField name="date" type="string">Bucket start timestamp in ISO 8601 format.</ResponseField>
        <ResponseField name="buckets" type="object">Object keyed by HTTP status code with the count observed in this bucket.</ResponseField>
        <ResponseField name="total" type="integer">Total errors observed in this bucket.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="top_paths" type="array">
      Paths that produced the most errors during the window.

      <Expandable title="Toggle top_paths item">
        <ResponseField name="path" type="string">Request path.</ResponseField>
        <ResponseField name="method" type="string">HTTP method.</ResponseField>
        <ResponseField name="total" type="integer">Total errors for this path/method.</ResponseField>
        <ResponseField name="by_status" type="object">Counts per HTTP status code observed for this path/method.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="by_method" type="array">
      Aggregated error totals grouped by HTTP method.

      <Expandable title="Toggle by_method item">
        <ResponseField name="method" type="string">HTTP method.</ResponseField>
        <ResponseField name="total" type="integer">Total errors for this method.</ResponseField>
        <ResponseField name="by_status" type="object">Counts per HTTP status code observed for this method.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status": "success",
    "response": {
      "summary": {
        "total": 42,
        "by_class": {
          "4xx": 0,
          "5xx": 42
        }
      },
      "by_status": [
        { "status": 502, "requests": 30 },
        { "status": 504, "requests": 12 }
      ],
      "timeseries": [
        {
          "date": "2025-12-01T12:00:00.000Z",
          "buckets": { "502": 5, "504": 2 },
          "total": 7
        }
      ],
      "top_paths": [
        {
          "path": "/api/users",
          "method": "GET",
          "total": 18,
          "by_status": { "502": 15, "504": 3 }
        }
      ],
      "by_method": [
        {
          "method": "GET",
          "total": 30,
          "by_status": { "502": 22, "504": 8 }
        }
      ]
    }
  }
  ```
</ResponseExample>

### Common errors

| Code                     | HTTP | Meaning                                                         |
| ------------------------ | ---- | --------------------------------------------------------------- |
| `INVALID_TIME_RANGE`     | 400  | `start`/`end` are missing, malformed, or invert the time range. |
| `UNABLE_TO_FETCH_ERRORS` | 500  | Failed to fetch error data from the edge provider.              |
