# Get failure analysis Get a breakdown of session failures with error codes and rates. Returns a detailed analysis of failed Meeting Buddy sessions, including the overall failure rate, failure counts grouped by error code, and the percentage contribution of each error type. Useful for identifying recurring issues and prioritizing fixes. Defaults to the last 30 days. #### Query Parameters **`start_date`** string optional Start of date range (UTC, ISO 8601 format). Defaults to 30 days before `end_date`. **`end_date`** string optional End of date range (UTC, ISO 8601 format). Defaults to current time. ## Returns Returns a failure analysis object: | Field | Type | Description | | --- | --- | --- | | `total_failed` | integer | Total number of failed sessions | | `failure_rate` | number | Ratio of failed sessions to total sessions | | `items` | array | Failure items grouped by error code | Each item contains: | Field | Type | Description | | --- | --- | --- | | `error_code` | string or null | Error code (e.g., `"VEXA_CONNECTION_FAILED"`) | | `error_message` | string or null | Error description | | `count` | integer | Number of failures with this error code | | `percentage` | number | Percentage of total failures | Request ```bash cURL curl -s -X GET "https://api.aitronos.com/v1/meeting-buddy/analytics/failure-analysis" \ -H "Authorization: Bearer $ACCESS_TOKEN" | python3 -m json.tool ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") failures = client.meeting_buddy.get_failure_analysis() print(f"Total failed: {failures.total_failed}") print(f"Failure rate: {failures.failure_rate:.1%}") for item in failures.items: print(f" {item.error_code}: {item.count} ({item.percentage:.1f}%)") ``` ```python Python import os import requests access_token = os.environ["ACCESS_TOKEN"] url = "https://api.aitronos.com/v1/meeting-buddy/analytics/failure-analysis" headers = {"Authorization": f"Bearer {access_token}"} response = requests.get(url, headers=headers) data = response.json() print(f"Failure rate: {data['failure_rate']:.1%}") for item in data["items"]: print(f" {item['error_code']}: {item['count']}") ``` ```javascript JavaScript const accessToken = process.env.ACCESS_TOKEN; const response = await fetch( 'https://api.aitronos.com/v1/meeting-buddy/analytics/failure-analysis', { headers: { 'Authorization': `Bearer ${accessToken}`, }, } ); const data = await response.json(); console.log('Failure rate:', (data.failure_rate * 100).toFixed(1) + '%'); data.items.forEach(item => { console.log(` ${item.error_code}: ${item.count} (${item.percentage.toFixed(1)}%)`); }); ``` Response ```json 200 OK { "total_failed": 11, "failure_rate": 0.071, "items": [ { "error_code": "VEXA_CONNECTION_FAILED", "error_message": "Cannot connect to bot service", "count": 5, "percentage": 45.5 }, { "error_code": "SESSION_START_FAILED", "error_message": "Failed to start bot session", "count": 3, "percentage": 27.3 }, { "error_code": "VEXA_CAPACITY_EXCEEDED", "error_message": "Bot service at capacity", "count": 2, "percentage": 18.2 }, { "error_code": null, "error_message": "Unknown error", "count": 1, "percentage": 9.1 } ] } ``` ```json 200 OK - No failures { "total_failed": 0, "failure_rate": 0.0, "items": [] } ``` ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication is required to access this resource.", "type": "client_error", "status": 401, "details": {}, "trace_id": "abc-123-def", "timestamp": "2025-12-11T10:00:00Z" } } ``` ## Related Resources - [Analytics Summary](/docs/api-reference/meeting-buddy/analytics-summary) - [Status Breakdown](/docs/api-reference/meeting-buddy/analytics-status-breakdown) - [Session Trends](/docs/api-reference/meeting-buddy/analytics-trends) - [List Sessions](/docs/api-reference/meeting-buddy/list-sessions)