Skip to main content
The error-count endpoint returns the number of events per day where the error field is non-null and non-empty. Use this to monitor your agent’s failure rate over time and quickly spot days with elevated error activity. Combined with the path-timeseries endpoint, you can calculate the error rate per path to identify which specific endpoints are most prone to failures.
To calculate error rate per path, divide each day’s error_count from this endpoint by the corresponding day’s total event count from the path-timeseries endpoint.

Request

X-OTAS-USER-TOKEN
string
required
JWT identifying the authenticated user.
X-OTAS-AGENT-ID
string
required
UUID of the agent to retrieve error data for.
X-OTAS-PROJECT-ID
string
required
UUID of the project the agent belongs to.

Query parameters

start_date
string
required
Start of the date range, inclusive. Must be in YYYY-MM-DD format.
end_date
string
required
End of the date range, inclusive. Must be in YYYY-MM-DD format and must not be before start_date.

Response

status
number
required
1 on success.
agent_id
string
required
The agent UUID from the request headers.
project_id
string
required
The project UUID from the request headers.
data
object[]
required
Daily error count entries, ordered by date ascending.
Only dates with at least one error event are included. Days where every event succeeded (i.e. error is null or "" for all events) are omitted from the response. An event is counted as an error when error IS NOT NULL AND error != ''.

Errors

HTTPstatus_descriptionMeaning
400missing_datesstart_date or end_date query parameter was not provided.
400invalid_date_formatOne or both dates are not in YYYY-MM-DD format.
400invalid_date_rangestart_date is after end_date.
401missing_user_tokenX-OTAS-USER-TOKEN header was not provided.
400missing_agent_idX-OTAS-AGENT-ID header was not provided.
400missing_project_idX-OTAS-PROJECT-ID header was not provided.
403forbiddenThe authenticated user does not have access to the specified project.
404agent_not_foundNo active agent matches the provided agent ID.
503auth_service_timeoutThe UASAM auth service did not respond within the timeout window.
503auth_service_errorThe UASAM auth service is unreachable.
500server_errorAn unexpected internal error occurred.
curl --request GET \
  --url "http://localhost:8002/api/v1/agent/error-count/?start_date=2026-03-20&end_date=2026-03-26" \
  --header "X-OTAS-USER-TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  --header "X-OTAS-AGENT-ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  --header "X-OTAS-PROJECT-ID: 3f6e2b10-8c1a-4d55-b9d4-0a2e3c7f1234"
{
  "status": 1,
  "agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "project_id": "3f6e2b10-8c1a-4d55-b9d4-0a2e3c7f1234",
  "data": [
    {
      "date": "2026-03-22",
      "error_count": 2
    },
    {
      "date": "2026-03-24",
      "error_count": 7
    },
    {
      "date": "2026-03-26",
      "error_count": 3
    }
  ]
}

Build docs developers (and LLMs) love