Skip to main content
This endpoint returns daily latency percentile data for an agent — p50 is the median response time, p95 captures the experience of the large majority of requests, and p99 reveals worst-case behaviour. All values are in milliseconds. Use this data to render latency distribution charts and detect performance regressions over time before they affect most users.

Request

X-OTAS-USER-TOKEN
string
required
JWT identifying the authenticated user.
X-OTAS-AGENT-ID
string
required
UUID of the agent to retrieve latency 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 latency percentile entries, ordered by date ascending.
Percentiles are computed using PostgreSQL’s PERCENTILE_CONT function, which performs exact linear interpolation between adjacent values. Only dates that have at least one event are included — there is no zero-fill for days without traffic.
If p99 is significantly higher than p95 on a given day, there are likely a small number of outlier requests driving the tail. Use the session events endpoint to identify those specific calls by filtering for sessions on that date and sorting by latency_ms.

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/latency-percentiles/?start_date=2026-03-24&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-24",
      "p50": 98.2,
      "p95": 312.5,
      "p99": 890.0
    },
    {
      "date": "2026-03-25",
      "p50": 142.3,
      "p95": 489.1,
      "p99": 1203.7
    },
    {
      "date": "2026-03-26",
      "p50": 105.8,
      "p95": 298.4,
      "p99": 744.2
    }
  ]
}

Build docs developers (and LLMs) love