Skip to main content
GET
/
backend
/
reports
/
:orgId
/
insights
/
alerts
curl --location --request GET 'https://api-v2.opencopilot.so/backend/reports/insights/alerts?startDate=2023-01-01T00:00:00Z&endDate=2023-12-31T23:59:59Z' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE'
{
  "alerts": [
    {
      "type": "<string>",
      "session_id": "<string>",
      "wait_time": 123
    }
  ]
}

Authentication

Authorization
string
required
Bearer token for authentication

Query Parameters

startDate
string
The start date for the date range to fetch alerts (ISO 8601 format)
endDate
string
The end date for the date range to fetch alerts (ISO 8601 format)

Path Parameters

orgId
string
required
The ID of the organization

Response

alerts
array
type
string
The type of alert (e.g., “LongWaitTime”)
session_id
string
The ID of the chat session that triggered the alert
wait_time
number
The wait time in milliseconds (for LongWaitTime alerts)

Response Examples

{
  "alerts": [
    {
      "type": "LongWaitTime",
      "session_id": "5f3e9c1b-7c1d-4e3f-8f9a-1a2b3c4d5e6f",
      "wait_time": 1200000
    },
    {
      "type": "LongWaitTime",
      "session_id": "6a7b8c9d-0e1f-2g3h-4i5j-6k7l8m9n0o1p",
      "wait_time": 900000
    }
  ]
}

Error Responses

{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}
curl --location --request GET 'https://api-v2.opencopilot.so/backend/reports/insights/alerts?startDate=2023-01-01T00:00:00Z&endDate=2023-12-31T23:59:59Z' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE'