Analytics Historical API
Overview
The Avaya Infinity™ Historical API gives you programmatic access to historical contact center data stored as structured datasets. Query agent performance, queue metrics, interaction records, workflow execution traces, and login/logout events. All results are paginated and filterable by time interval.
This API is designed for integrations that need to extract historical data for external reporting tools, analytics platforms, data warehouses, or compliance archives. Data is returned in a column-oriented format: each response includes a columnHeaders array that defines the schema, and a records array where each row is an ordered list of values corresponding to those headers.
Common use cases include:
- Operational reporting: Pull agent and queue performance metrics into a BI tool or dashboard for historical trend analysis.
- Workforce management: Extract login/logout and auxiliary status data to feed into scheduling and adherence systems.
- Compliance and audit: Retrieve interaction segment records and workflow traces for quality assurance or regulatory review.
- Data warehouse ingestion: Periodically pull all datasets into a data lake using cursor-based pagination to process large volumes efficiently.
The API uses standard REST conventions and OAuth 2.0 Bearer token authentication.
API Reference: Historical API Reference →
Before You Begin
Find Your Customer Subdomain
All Historical API requests are scoped to your Avaya Infinity™ tenant. Your subdomain appears in your Infinity portal URL:
https://core.avaya1234.ec.avayacloud.com/app/core-config-ui/
Your subdomain is: avaya1234
All API requests use this base URL pattern:
https://core.{customerId}.ec.avayacloud.com/api/analytics/v2/datasets/{datasetName}
Request API Credentials
Contact Avaya Support to request a client_id and client_secret for the Historical API. Once provisioned, use these credentials to obtain a Bearer token via the OAuth 2.0 client credentials flow.
Obtain an Access Token
curl -X POST \
https://core.avaya1234.ec.avayacloud.com/auth/realms/avaya/protocol/openid-connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id={clientId}&client_secret={clientSecret}"Response:
{
"access_token": "eyJhbGciOiJSUzI1...",
"expires_in": 900,
"token_type": "bearer"
}Include the token in the Authorization header of every request:
Authorization: Bearer {access_token}
Note: Tokens expire after 900 seconds (15 minutes). Implement token refresh in any long-running data pipeline.
For full authentication details, see How to Authenticate with Avaya Infinity™ APIs.
Available Datasets
All data is accessed through a single endpoint by specifying the datasetName path parameter. The datasets available are:
| Dataset name | Description | Entitlement |
|---|---|---|
agent | Agent performance metrics per interval | Standard |
queue | Queue performance metrics per interval | Standard |
agentAux | Agent auxiliary/status data per interval | Standard |
agentByQueue | Agent performance metrics broken down by queue | Standard |
agentLoginSessions | Agent login session data | Standard |
agentLoginLogoutByQueue | Agent login/logout events at the queue level | Standard |
cxAgentLoginLogout | CX Agent login/logout session events with status duration breakdown | Standard |
clientSessions | Client session data | Standard |
mpccdr | MPC CDR data | Standard |
transcript | Interaction transcripts | Standard |
workflow | Workflow execution data | Standard |
interactionSegments | Segment-level interaction data including agent and queue details | Analytics Insights |
workflowTrace | Step-by-step workflow execution trace with timing and variables | Analytics Insights |
Analytics Insights datasets:
interactionSegmentsandworkflowTracerequire the Analytics Insights entitlement. Requests for these datasets without the entitlement return403 Forbiddenwith the message: "This dataset requires the Analytics Insights entitlement." Contact your Avaya administrator to enable this feature.
Key Concepts
Column-Oriented Response Format
The Historical API does not return JSON objects with named fields. Instead, each response consists of two parallel arrays:
columnHeaders: an ordered list of{name, type}objects defining the schema for this dataset and queryrecords: an array of rows, where each row is an array of values in the same order ascolumnHeaders
To work with the data, zip the headers and values together:
const { columnHeaders, records } = response;
const rows = records.map(record =>
Object.fromEntries(columnHeaders.map((col, i) => [col.name, record[i]]))
);
// rows[0] = { ROW_ID: "ff0f980b...", STARTTIME: "00:45", CHANNEL: "email", ... }column_names = [col['name'] for col in response['columnHeaders']]
rows = [dict(zip(column_names, record)) for record in response['records']]
# rows[0] = {'ROW_ID': 'ff0f980b...', 'STARTTIME': '00:45', 'CHANNEL': 'email', ...}All values in records are returned as strings, regardless of the type declared in columnHeaders. Cast numeric and datetime fields in your application after reading them.
The interval Parameter
interval ParameterThe interval parameter is required on every request. It controls the time range of data returned and its format depends on datasetType.
Interval datasets (datasetType=interval, the default)
Use YYYYMMDDHHmm format. The mm component represents 15-minute intervals: 00, 15, 30, or 45. Non-standard minute values are silently accepted but may return empty results. Data is typically available for intervals at least 30 minutes in the past.
interval=starting:202502010415,ending:202502010445
Daily datasets (datasetType=daily)
Use YYYYMMDD format. Non-zero HHmm suffixes are silently accepted but may return empty results.
interval=starting:20250201,ending:20250225
Both starting and ending are optional individually; you can supply just one to query from a point forward or up to a point. Supplying neither returns a 400 Bad Request.
Cursor-Based Pagination
Results are paginated using opaque cursor tokens. The response includes a pagination object and a links object:
{
"pagination": {
"pageSize": 20,
"prevPageToken": "",
"nextPageToken": "MjAyNS0xMC0yN1QxOTow..."
},
"links": {
"prev": "",
"next": "/v2/datasets/agent?interval=...&nextPageToken=MjAyNS0xMC0yN1QxOTow..."
}
}Important pagination notes:
- Pagination is forward-only.
prevPageTokenandlinks.prevare reserved for future use and currently always return an empty string. Do not rely on them for backward navigation. - When
nextPageTokenis an empty string, you are on the last page with no more records to fetch. - The
links.nextURL may contain unicode-escaped ampersands (\u0026). Parse these correctly when constructing subsequent requests, or use thenextPageTokenvalue directly in your own URL construction.
The filter Parameter
filter ParameterThe optional filter parameter narrows results to rows matching a specific column value. Format: COLUMN_NAME:value or COLUMN_NAME:value* (wildcard suffix).
Known filterable columns (consistent across most datasets):
| Column | Example |
|---|---|
CHANNEL | CHANNEL:phone |
AGENT_ID | AGENT_ID:002d011106bf83ae15133ec0a7 |
QUEUE_ID | QUEUE_ID:003d0110243d0fd4d9c7f27dea |
ACCOUNT_ID | ACCOUNT_ID:001d010917f6594b9a104630f7 |
Important: Not all column names are valid filter keys. Using a column that is not supported as a filter key returns
400 Invalid filter column. For example,AGENT_NAME:John*is not valid. Contact Avaya Support to confirm the full list of filterable columns for a specific dataset.
The 202 Accepted Response
A 202 Accepted response means your request was valid but the data pipeline has not yet finished processing the requested interval. The response body will include columnHeaders (so you know the schema) but records will be empty. Retry after a short delay, typically a few minutes.
This commonly occurs when querying very recent intervals that are still being processed.
Request Parameters
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
datasetName | path | Yes | string | The dataset to query. See Available Datasets. |
interval | query | Yes | string | Time range filter. Format depends on datasetType. See The interval Parameter. |
datasetType | query | No | string | interval (default) or daily. Determines the format expected for interval. |
filter | query | No | string | Row filter in COLUMN:value format. See The filter Parameter. |
pageSize | query | No | integer | Results per page. Default: 20. Maximum: 200. |
nextPageToken | query | No | string | Cursor token from a previous response to retrieve the next page. |
prevPageToken | query | No | string | Reserved for future use. Has no effect. Always returns empty string in responses. |
Making Your First Request
Basic Request: Queue Data for a Single Interval
curl -X GET \
"https://core.avaya1234.ec.avayacloud.com/api/analytics/v2/datasets/queue?interval=starting:202502010415,ending:202502010445" \
-H "Authorization: Bearer {access_token}"Request with Filter and Page Size
curl -X GET \
"https://core.avaya1234.ec.avayacloud.com/api/analytics/v2/datasets/agent?interval=starting:20250201,ending:20250201&datasetType=daily&filter=CHANNEL:phone&pageSize=50" \
-H "Authorization: Bearer {access_token}"Node.js
async function getDataset(accessToken, customerId, datasetName, interval, options = {}) {
const params = new URLSearchParams({ interval, ...options });
const response = await fetch(
`https://core.${customerId}.ec.avayacloud.com/api/analytics/v2/datasets/${datasetName}?${params}`,
{ headers: { Authorization: `Bearer ${accessToken}` } }
);
if (response.status === 202) {
console.log('Data not yet available for this interval. Retry shortly.');
return null;
}
if (!response.ok) {
const error = await response.json();
throw new Error(`${error.title}: ${error.detail}`);
}
return response.json();
}
// Usage
const data = await getDataset(accessToken, 'avaya1234', 'queue',
'starting:202502010415,ending:202502010445');Python
import requests
def get_dataset(access_token, customer_id, dataset_name, interval, **params):
url = f'https://core.{customer_id}.ec.avayacloud.com/api/analytics/v2/datasets/{dataset_name}'
response = requests.get(
url,
headers={'Authorization': f'Bearer {access_token}'},
params={'interval': interval, **params}
)
if response.status_code == 202:
print('Data not yet available. Retry shortly.')
return None
response.raise_for_status()
return response.json()
# Usage
data = get_dataset(access_token, 'avaya1234', 'agent',
'starting:20250201,ending:20250201', datasetType='daily', filter='CHANNEL:phone')Response Structure
All successful responses share the same top-level structure:
{
"columnHeaders": [
{ "name": "ROW_ID", "type": "string" },
{ "name": "STARTTIME", "type": "string" },
{ "name": "CHANNEL", "type": "string" }
],
"records": [
["ff0f980b...", "00:45", "email"],
["f80f3d4d...", "00:45", "phone"]
],
"pagination": {
"pageSize": 20,
"prevPageToken": "",
"nextPageToken": "MjAyNS0xMC0yN1QxOTow..."
},
"links": {
"prev": "",
"next": "/v2/datasets/queue?interval=...&nextPageToken=MjAyNS0xMC0yN1QxOTow..."
}
}Common Fields Across Datasets
These fields appear in most or all datasets:
| Column | Type | Description |
|---|---|---|
ROW_ID | string | Unique identifier for this row, generated by the data pipeline. |
ROW_DATE_UTC | datetime | UTC date for this row, used for partitioning. Format: YYYY-MM-DD. |
STARTTIME | string | Start time of the interval in HH:mm format (local time). |
INTERVAL | number | Interval duration in minutes (typically 15 for interval datasets). |
STARTTIME_UTC | datetime | Start time in ISO 8601 UTC format. Example: 2025-11-25T00:45:00Z. |
SOURCE_SYSTEM | string | The source system identifier. Typically AXP. |
ACCOUNT_ID | string | Your Avaya Infinity™ account/tenant identifier. |
COMMIT_TS | datetime | Timestamp when this row was last written to the data store. Use this to detect updates to previously retrieved records. |
Dataset Reference
queue: Queue Performance Metrics
queue: Queue Performance MetricsInterval-level performance metrics per queue and communication channel. Use for reporting on queue throughput, wait times, and abandonment rates.
| Column | Type | Description |
|---|---|---|
QUEUE_ID | string | Unique queue identifier. |
QUEUE_NAME | string | Display name of the queue. |
CHANNEL | string | Communication channel: phone, email, chat, etc. |
SUB_CHANNEL | string | Channel direction: inbound or outbound. |
INTERACTIONS | number | Interactions handled (connected to an agent) during the interval. |
INTERACTIONSOFFERED | number | Total interactions offered to the queue, including abandoned. |
WAITTIME | number | Total customer wait time in seconds across all interactions. |
MAXOCWTIME | number | Maximum observed customer wait time in seconds during the interval. |
HOLDTIME | number | Total hold time in seconds across all interactions. |
INTERACTIONTIME | number | Total active interaction (talk/handle) time in seconds. |
WRAPUPTIME | number | Total wrap-up time in seconds across all interactions. |
ABNINTERACTIONS | number | Number of interactions abandoned before connecting to an agent. |
ABNWAITTIME | number | Total wait time in seconds for abandoned interactions. |
OUTFLOWINTERACTIONS | number | Interactions that left the queue via overflow or transfer. |
INFLOWINTERACTIONS | number | Interactions that entered the queue from another queue or overflow source. |
I_INTERACTIONTIME | number | Interval total interaction time in seconds (per-interval aggregate). |
I_WRAPUPTIME | number | Interval total wrap-up time in seconds. |
I_STAFFTIME | number | Total time agents were staffed (logged in) during the interval, in seconds. |
OUTOFFOCUSTIME | number | Total time agents were out-of-focus on this queue during the interval. |
INTERACTION_OUTOFFOCUSTIME | number | Out-of-focus time occurring during active interactions. |
WRAPUP_OUTOFFOCUSTIME | number | Out-of-focus time occurring during wrap-up. |
I_OUTOFFOCUSTIME | number | Interval aggregate out-of-focus time. |
INTERACTION_INFOCUSTIME | number | In-focus time during active interactions. |
WRAPUP_INFOCUSTIME | number | In-focus time during wrap-up. |
agent: Agent Performance Metrics
agent: Agent Performance MetricsInterval-level performance metrics per agent and communication channel. Use for individual agent reporting, productivity analysis, and time-in-state calculations.
| Column | Type | Description |
|---|---|---|
AGENT_ID | string | Unique agent identifier. |
AGENT_NAME | string | Agent's display name. |
AGENT_EMAIL | string | Agent's email address. |
CHANNEL | string | Communication channel: phone, email, chat, etc. |
SUB_CHANNEL | string | Channel direction: inbound or outbound. |
INTERACTIONS | number | Total interactions handled by the agent during the interval. |
WAITTIME | number | Total customer wait time before agent accepted, in seconds. |
HOLDTIME | number | Total hold time in seconds. |
INTERACTIONTIME | number | Total active interaction time in seconds. |
WRAPUPTIME | number | Total wrap-up time in seconds. |
HOLD_INTERACTIONS | number | Number of interactions where hold was used. |
TRANSFERED_INTERACTIONS | number | Number of interactions transferred by this agent. |
I_INTERACTIONTIME | number | Interval aggregate interaction time. |
I_WRAPUPTIME | number | Interval aggregate wrap-up time. |
I_RINGTIME | number | Total time interactions rang before the agent answered, in seconds. |
I_AUXTIME | number | Total time agent spent in auxiliary (not-ready) states during the interval. |
I_STAFFTIME | number | Total time the agent was staffed (logged in) during the interval. |
TI_AVAILTIME | number | Total available time across the interval (staffed minus aux). |
TI_STAFFTIME | number | Total staffed time across the interval. |
TI_AUXTIME | number | Total aux time across the interval. |
OUTOFFOCUSTIME | number | Total out-of-focus time across all states. |
INTERACTION_OUTOFFOCUSTIME | number | Out-of-focus time during active interactions. |
WRAPUP_OUTOFFOCUSTIME | number | Out-of-focus time during wrap-up. |
INTERACTION_INFOCUSTIME | number | In-focus time during active interactions. |
WRAPUP_INFOCUSTIME | number | In-focus time during wrap-up. |
agentAux: Agent Auxiliary Status
agentAux: Agent Auxiliary StatusInterval-level aux status metrics per agent, broken down by status type. Use to analyse time agents spend in each not-ready state.
| Column | Type | Description |
|---|---|---|
AGENT_ID | string | Unique agent identifier. |
AGENT_NAME | string | Agent's display name. |
AGENT_TAGS | string | Comma-separated list of tags assigned to the agent (e.g. team-alpha,support). |
STATUS_TYPE | string | Login state category, e.g. Q Login, busy. |
STATUS | string | Specific status name within the status type, e.g. Available, On Call. |
AGENT_TIME_ZONE | string | The agent's configured time zone (IANA format, e.g. America/New_York). |
I_STAFFTIME | number | Interval staffed time in seconds. |
TI_STAFFTIME | number | Total staffed time across the interval. |
I_AUXTIME | number | Interval aux time in seconds for this specific status. |
TI_AUXTIME | number | Total aux time across the interval for this status. |
agentByQueue: Agent Performance by Queue
agentByQueue: Agent Performance by QueueAgent performance metrics aggregated at the queue level. Use when you need to understand which agents handled work for each queue, rather than agent-level totals across all queues.
| Column | Type | Description |
|---|---|---|
AGENT_ID | string | Unique agent identifier. |
AGENT_NAME | string | Agent's display name. |
QUEUE_ID | string | Queue identifier the metrics are scoped to. |
QUEUE_NAME | string | Display name of the queue. |
CHANNEL | string | Communication channel. |
SUB_CHANNEL | string | Channel direction. |
INTERACTIONS | number | Interactions handled by this agent for this queue during the interval. |
I_INTERACTIONTIME | number | Total interaction time in seconds. |
I_WRAPUPTIME | number | Total wrap-up time in seconds. |
HOLD_INTERACTIONS | number | Interactions where hold was used. |
AUXIN_INTERACTIONS | number | Interactions where the agent entered an aux state during handling. |
HOLDTIME | number | Total hold time in seconds. |
TRANSFERED_INTERACTIONS | number | Interactions transferred by this agent. |
AUXOUT_INTERACTIONS | number | Interactions where the agent exited an aux state during handling. |
I_AUXINTIME | number | Total time spent entering aux states during interactions. |
I_AUXOUTTIME | number | Total time spent exiting aux states during interactions. |
ASSISTS | number | Number of supervisor assists received during interactions. |
agentLoginSessions: Agent Login Sessions
agentLoginSessions: Agent Login SessionsRecords each agent login session. Use for staffing analysis and shift-level reporting.
Note: The column schema for this dataset is not represented in the API reference examples. Contact Avaya Support or query the dataset and inspect the
columnHeadersarray for the full list of available fields.
agentLoginLogoutByQueue: Agent Login/Logout by Queue
agentLoginLogoutByQueue: Agent Login/Logout by QueueLogin and logout events recorded at the queue level. Use for queue-level staffing history.
| Column | Type | Description |
|---|---|---|
SESSION_ID | string | Unique identifier for this login session. |
QUEUE_ID | string | Queue the agent logged into. |
AGENT_ID | string | Unique agent identifier. |
LOGIN_TIME | datetime | UTC timestamp when the agent logged into this queue. |
LOGOUT_TIME | datetime | UTC timestamp when the agent logged out. Empty string if still logged in. |
LOGOUT_REASON | string | Reason for logout, e.g. Manual. Empty if still logged in. |
cxAgentLoginLogout: CX Agent Login/Logout
cxAgentLoginLogout: CX Agent Login/LogoutFull login session records with duration broken down by agent status type. Use for adherence reporting and session-level compliance data.
| Column | Type | Description |
|---|---|---|
ID | string | Unique session record identifier. |
USER_ID | string | Unique agent/user identifier. |
STATUS_TYPE | string | Session type, e.g. CX Login. |
STATUS | string | Agent status during this record: Available, Offline, etc. |
START_TIME | datetime | Session start time in UTC. |
END_TIME | datetime | Session end time in UTC. Empty string if session is still active. |
DURATION | number | Total session duration in seconds. 0 if session is still active. |
DURATION_AVAILABLE | number | Time in seconds the agent was in Available status. |
DURATION_AWAY | number | Time in seconds the agent was in Away status. |
DURATION_BUSY | number | Time in seconds the agent was in Busy status. |
DURATION_OFFLINE | number | Time in seconds the agent was in Offline status. |
IS_SYSTEM | number | 1 if this was a system-generated status change; 0 if agent-initiated. |
IS_LOGIN | number | 1 if this record represents a login event. |
CREATED_AT | datetime | UTC timestamp when this record was created. |
UPDATED_AT | datetime | UTC timestamp when this record was last updated. Empty if unchanged since creation. |
interactionSegments: Interaction Segments (Analytics Insights required)
interactionSegments: Interaction Segments (Analytics Insights required)Segment-level detail for every interaction, including agent assignment, queue routing, timing, transfer details, and outcome. Each interaction may produce multiple segment rows (one per routing/handling step).
| Column | Type | Description |
|---|---|---|
INTERACTION_SEGMENT_ID | string | Unique identifier for this segment. |
INTERACTION_ID | string | The parent interaction identifier. |
QUEUE_ID | string | Queue the interaction was routed through for this segment. |
USER_ID | string | Agent assigned to this segment. |
STATUS | string | Segment status, e.g. connected. |
COMM_TYPE | string | Communication type, e.g. task, voice, chat. |
SUB_COMM_TYPE | string | Sub-type, e.g. other, inbound. |
WAIT_TIME | number | Customer wait time in seconds before agent connection. |
HOLD_TIME | number | Hold time in seconds during this segment. |
TIME_INTERACTING | number | Active interaction time in seconds. |
WRAP_UP_TIME | number | Wrap-up time in seconds. |
END_TIME | datetime | UTC timestamp when this segment ended. |
EVENT | string | Event type for this segment record, e.g. status. |
EVENT_DESC | string | Human-readable description of the event, e.g. connected. |
SEGMENT_NUMBER | number | Sequence number of this segment within the interaction. |
COMPLETION_TYPE | string | How the interaction was completed, if applicable. |
COMPLETION_VALUE | string | Value associated with the completion type. |
COMPLETION_DISPLAY_NAME | string | Display name for the completion outcome. |
COMPLETION_TIME_UNIX | number | Unix timestamp of completion. |
TRANSFER_LOCATION | string | Destination of a transfer, if applicable. |
TRANSFER_RESULT | string | Outcome of the transfer. |
XFER_LOC_QUEUE_ID | string | Queue ID of the transfer destination. |
XFER_LOC_INTERACTION_ID | string | Interaction ID at the transfer destination. |
SILENCE_SEGMENTS | string | Silence segment data, if recorded. |
SILENCE_TOTAL | number | Total silence duration in seconds. |
INTERACTION_TYPE | string | Type classification of the interaction. |
INTERACTION_NOTES | string | Free-text notes attached to the interaction. |
INTERACTION_RESULT | string | Outcome or result of the interaction. |
INTERACTION_SUBJECT | string | Subject or topic of the interaction. |
FIRST_LAST_NAME | string | Customer's name if available. |
QUEUE_NAME | string | Display name of the queue. |
SOURCE_PHONE_NUMBER | string | Customer's source phone number for voice interactions. |
SOURCE_EMAIL | string | Customer's email address for email/digital interactions. |
INTERACTION_TAGS | string | Tags associated with the interaction. |
workflowTrace: Workflow Execution Trace (Analytics Insights required)
workflowTrace: Workflow Execution Trace (Analytics Insights required)Step-by-step execution history for workflow sessions. Each row represents one history item (a single step execution) within a workflow session. Use for debugging workflow logic, auditing automated routing decisions, and measuring step-level performance.
| Column | Type | Description |
|---|---|---|
WORKFLOWSESSION_ID | string | Unique identifier for the workflow session. |
WORKFLOWSESSION_INTERACTIONID | string | The interaction ID associated with this session. |
UPDATEHISTORYITEM_ID | string | Unique identifier for this specific step execution record. |
WORKFLOWSESSION_WORKFLOWNAME | string | Name of the workflow that was executed. |
HISTORYITEM_DURATION_MS | number | Duration of this step in milliseconds. |
UPDATEHISTORYITEM_STARTTIME | datetime | UTC timestamp when this step started. |
UPDATEHISTORYITEM_ENDTIME | datetime | UTC timestamp when this step ended. |
WORKFLOWSESSION_STARTTIME | datetime | UTC timestamp when the overall workflow session started. |
WORKFLOWSESSION_ENDTIME | datetime | UTC timestamp when the overall workflow session ended. |
WORKFLOWSESSION_DURATION_MS | number | Total workflow session duration in milliseconds. |
FORMATTED_HISTORYITEM_DURATION | string | Human-readable step duration, e.g. 00:00:05.000. |
UPDATEHISTORYITEM_WORKFLOWITEMID | string | ID of the workflow item (step definition) that was executed. |
UPDATEHISTORYITEM_EXITPORT | string | Exit port taken from this step (e.g. success, failure). |
UPDATEHISTORYITEM_PROMPT | string | Prompt presented to the caller or system at this step, if applicable. |
UPDATEHISTORYITEM_INPUT | string | Input received at this step, if applicable. |
UPDATEHISTORYITEM_ENDEVENT | string | Event that caused this step to end. |
UPDATEHISTORYITEM_MODE | string | Execution mode, e.g. auto. |
UPDATEHISTORYITEM_TYPE | string | Step type, e.g. PlayMessage, GetInput, RouteToQueue. |
ITEM_DESCRIPTION | string | Descriptive label for the step type. |
UPDATEHISTORYITEM_LABEL | string | User-defined label for this step in the workflow designer. |
WORKFLOWSESSION_WORKFLOWID | string | ID of the workflow definition. |
WORKFLOWSESSION_WORKFLOWVERSIONID | string | ID of the specific workflow version executed. |
WORKFLOWSESSION_WORKFLOWVERSIONNUMBER | string | Version number of the workflow, e.g. 1.0. |
WORKFLOWSESSION_DATA_VARIABLES | string | JSON object of workflow variables at session end. |
WORKFLOWSESSION_DATA_SOURCE | string | Source data for the session, e.g. api. |
WORKFLOWSESSION_COMMTYPE | string | Communication type for the session, e.g. voice. |
WORKFLOWSESSION_CHANNELTYPE | string | Channel type, e.g. phone. |
WORKFLOWSESSION_LANGUAGE | string | Language code for the session, e.g. en. |
WORKFLOWSESSION_ISVOICE | boolean | true if this was a voice session. |
WORKFLOWSESSION_ISCHAT | boolean | true if this was a chat session. |
WORKFLOWSESSION_ISDIGITAL | boolean | true if this was a digital (non-voice) session. |
WORKFLOWSESSION_ISTASK | boolean | true if this was a task session. |
WORKFLOWSESSION_ISEMBEDDED | boolean | true if this was an embedded (sub-workflow) session. |
workflow, mpccdr, transcript, clientSessions
workflow, mpccdr, transcript, clientSessionsThese datasets follow the same column-oriented response format. The available columns vary by dataset. Query the endpoint and inspect the columnHeaders array in the response to discover the full schema for each. Contact Avaya Support for detailed field-level documentation.
Integration Patterns
Pattern 1: Full Pagination All Records for a Date Range
Iterate through all pages for a given interval using nextPageToken.
import requests
def get_all_records(access_token, customer_id, dataset_name, interval, **params):
"""Retrieve all records for a dataset and interval, handling pagination."""
base_url = f'https://core.{customer_id}.ec.avayacloud.com/api/analytics/v2/datasets/{dataset_name}'
headers = {'Authorization': f'Bearer {access_token}'}
all_records = []
column_headers = None
next_page_token = None
while True:
query_params = {'interval': interval, **params}
if next_page_token:
query_params['nextPageToken'] = next_page_token
response = requests.get(base_url, headers=headers, params=query_params)
if response.status_code == 202:
print('Data not yet available. Retry shortly.')
break
response.raise_for_status()
data = response.json()
if column_headers is None:
column_headers = data['columnHeaders']
all_records.extend(data['records'])
next_page_token = data['pagination'].get('nextPageToken', '')
if not next_page_token:
break # No more pages
print(f'Retrieved {len(all_records)} records')
return column_headers, all_records
# Usage
headers, records = get_all_records(
access_token, 'avaya1234', 'agent',
'starting:20250201,ending:20250201',
datasetType='daily'
)
column_names = [col['name'] for col in headers]
rows = [dict(zip(column_names, record)) for record in records]Pattern 2: Handling the 202 Accepted Response with Retry
Data for recent intervals may not yet be processed. Implement a retry with backoff.
async function getDatasetWithRetry(accessToken, customerId, datasetName, interval, maxRetries = 5) {
const url = `https://core.${customerId}.ec.avayacloud.com/api/analytics/v2/datasets/${datasetName}`;
for (let attempt = 0; attempt < maxRetries; attempt++) {
const response = await fetch(`${url}?interval=${encodeURIComponent(interval)}`, {
headers: { Authorization: `Bearer ${accessToken}` }
});
if (response.status === 200) {
return response.json();
}
if (response.status === 202) {
const delaySeconds = Math.pow(2, attempt) * 30; // 30s, 60s, 120s...
console.log(`Data not yet available. Retrying in ${delaySeconds}s (attempt ${attempt + 1}/${maxRetries})`);
await new Promise(r => setTimeout(r, delaySeconds * 1000));
continue;
}
const error = await response.json();
throw new Error(`${response.status}: ${error.title} — ${error.detail}`);
}
throw new Error('Max retries exceeded. Data may not be available for this interval.');
}Pattern 3: Filtering by Channel and Agent
Combine filter with interval parameters to scope results.
# Agent data for phone channel only, for a specific date
curl -X GET \
"https://core.avaya1234.ec.avayacloud.com/api/analytics/v2/datasets/agent?interval=starting:20250310,ending:20250310&datasetType=daily&filter=CHANNEL:phone" \
-H "Authorization: Bearer {access_token}"
# Queue data filtered to a specific queue ID
curl -X GET \
"https://core.avaya1234.ec.avayacloud.com/api/analytics/v2/datasets/queue?interval=starting:202503100800,ending:202503101700&filter=QUEUE_ID:003d0110243d0fd4d9c7f27dea" \
-H "Authorization: Bearer {access_token}"Common Scenarios
All Values in Records Are Strings
Even though columnHeaders declares types such as number and datetime, all values in records are returned as strings. Cast values in your application:
column_map = {col['name']: col['type'] for col in data['columnHeaders']}
column_names = list(column_map.keys())
for record in data['records']:
row = {}
for i, value in enumerate(record):
col_name = column_names[i]
col_type = column_map[col_name]
if col_type == 'number' and value:
row[col_name] = float(value)
elif col_type == 'datetime' and value:
row[col_name] = value # parse with your preferred datetime library
else:
row[col_name] = valueEmpty String vs. Null in Records
Some fields return an empty string "" rather than null when no value is present. For example, LOGOUT_TIME for a session that is still active. Treat empty strings as absent values when they appear in number or datetime typed columns.
Unicode-Escaped Ampersands in Pagination Links
The links.next URL may contain \u0026 in place of &. If you are using links.next directly for subsequent requests, ensure your HTTP client handles unicode escaping, or extract the nextPageToken from pagination.nextPageToken and construct your own URL instead.
Querying Data from the Analytics Insights Datasets Without Entitlement
If your account does not have the Analytics Insights entitlement and you request interactionSegments or workflowTrace, the API returns 403 Forbidden:
{
"title": "Forbidden",
"status": 403,
"detail": "This dataset requires the Analytics Insights entitlement. Please contact your administrator to enable Analytics Insights for your account."
}Contact your Avaya administrator to check or enable entitlements.
Error Reference
| HTTP Status | Cause | What to do |
|---|---|---|
202 Accepted | Request valid but data not yet processed for the interval | Retry after a short delay. columnHeaders are returned but records will be empty. |
400 Bad Request | Missing interval, malformed parameter, or unsupported filter column | Check error detail for the specific field. Ensure interval is present and correctly formatted. |
401 Unauthorized | Missing or invalid Bearer token (may also return as a 302 redirect) | Verify Authorization: Bearer {token} header is present and the token has not expired. |
403 Forbidden | Insufficient permissions, or Analytics Insights dataset requested without entitlement | Check detail for the specific reason. Contact your administrator for entitlement queries. |
404 Not Found | Invalid datasetName | Verify the dataset name against the Available Datasets table. |
500 Internal Server Error | Platform error | Retry with exponential backoff. Contact Avaya Support if the issue persists. |
Where Next?
- Try the interactive API explorer: The Historical API Reference lets you query live datasets directly from your browser.
- Subscribe to real-time events: For live agent and interaction state changes rather than historical snapshots, use the Notification API.
- Get live queue metrics: For real-time queue occupancy and agent availability, use the Queue Metrics API.
- Review authentication: For a refresher on token management, see How to Authenticate with Avaya Infinity™ APIs.
Related Resources
Updated 11 days ago
