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 nameDescriptionEntitlement
agentAgent performance metrics per intervalStandard
queueQueue performance metrics per intervalStandard
agentAuxAgent auxiliary/status data per intervalStandard
agentByQueueAgent performance metrics broken down by queueStandard
agentLoginSessionsAgent login session dataStandard
agentLoginLogoutByQueueAgent login/logout events at the queue levelStandard
cxAgentLoginLogoutCX Agent login/logout session events with status duration breakdownStandard
clientSessionsClient session dataStandard
mpccdrMPC CDR dataStandard
transcriptInteraction transcriptsStandard
workflowWorkflow execution dataStandard
interactionSegmentsSegment-level interaction data including agent and queue detailsAnalytics Insights
workflowTraceStep-by-step workflow execution trace with timing and variablesAnalytics Insights

Analytics Insights datasets: interactionSegments and workflowTrace require the Analytics Insights entitlement. Requests for these datasets without the entitlement return 403 Forbidden with 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 query
  • records: an array of rows, where each row is an array of values in the same order as columnHeaders

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

The 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. prevPageToken and links.prev are reserved for future use and currently always return an empty string. Do not rely on them for backward navigation.
  • When nextPageToken is an empty string, you are on the last page with no more records to fetch.
  • The links.next URL may contain unicode-escaped ampersands (\u0026). Parse these correctly when constructing subsequent requests, or use the nextPageToken value directly in your own URL construction.

The filter Parameter

The 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):

ColumnExample
CHANNELCHANNEL:phone
AGENT_IDAGENT_ID:002d011106bf83ae15133ec0a7
QUEUE_IDQUEUE_ID:003d0110243d0fd4d9c7f27dea
ACCOUNT_IDACCOUNT_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

ParameterInRequiredTypeDescription
datasetNamepathYesstringThe dataset to query. See Available Datasets.
intervalqueryYesstringTime range filter. Format depends on datasetType. See The interval Parameter.
datasetTypequeryNostringinterval (default) or daily. Determines the format expected for interval.
filterqueryNostringRow filter in COLUMN:value format. See The filter Parameter.
pageSizequeryNointegerResults per page. Default: 20. Maximum: 200.
nextPageTokenqueryNostringCursor token from a previous response to retrieve the next page.
prevPageTokenqueryNostringReserved 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:

ColumnTypeDescription
ROW_IDstringUnique identifier for this row, generated by the data pipeline.
ROW_DATE_UTCdatetimeUTC date for this row, used for partitioning. Format: YYYY-MM-DD.
STARTTIMEstringStart time of the interval in HH:mm format (local time).
INTERVALnumberInterval duration in minutes (typically 15 for interval datasets).
STARTTIME_UTCdatetimeStart time in ISO 8601 UTC format. Example: 2025-11-25T00:45:00Z.
SOURCE_SYSTEMstringThe source system identifier. Typically AXP.
ACCOUNT_IDstringYour Avaya Infinity™ account/tenant identifier.
COMMIT_TSdatetimeTimestamp 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

Interval-level performance metrics per queue and communication channel. Use for reporting on queue throughput, wait times, and abandonment rates.

ColumnTypeDescription
QUEUE_IDstringUnique queue identifier.
QUEUE_NAMEstringDisplay name of the queue.
CHANNELstringCommunication channel: phone, email, chat, etc.
SUB_CHANNELstringChannel direction: inbound or outbound.
INTERACTIONSnumberInteractions handled (connected to an agent) during the interval.
INTERACTIONSOFFEREDnumberTotal interactions offered to the queue, including abandoned.
WAITTIMEnumberTotal customer wait time in seconds across all interactions.
MAXOCWTIMEnumberMaximum observed customer wait time in seconds during the interval.
HOLDTIMEnumberTotal hold time in seconds across all interactions.
INTERACTIONTIMEnumberTotal active interaction (talk/handle) time in seconds.
WRAPUPTIMEnumberTotal wrap-up time in seconds across all interactions.
ABNINTERACTIONSnumberNumber of interactions abandoned before connecting to an agent.
ABNWAITTIMEnumberTotal wait time in seconds for abandoned interactions.
OUTFLOWINTERACTIONSnumberInteractions that left the queue via overflow or transfer.
INFLOWINTERACTIONSnumberInteractions that entered the queue from another queue or overflow source.
I_INTERACTIONTIMEnumberInterval total interaction time in seconds (per-interval aggregate).
I_WRAPUPTIMEnumberInterval total wrap-up time in seconds.
I_STAFFTIMEnumberTotal time agents were staffed (logged in) during the interval, in seconds.
OUTOFFOCUSTIMEnumberTotal time agents were out-of-focus on this queue during the interval.
INTERACTION_OUTOFFOCUSTIMEnumberOut-of-focus time occurring during active interactions.
WRAPUP_OUTOFFOCUSTIMEnumberOut-of-focus time occurring during wrap-up.
I_OUTOFFOCUSTIMEnumberInterval aggregate out-of-focus time.
INTERACTION_INFOCUSTIMEnumberIn-focus time during active interactions.
WRAPUP_INFOCUSTIMEnumberIn-focus time during wrap-up.

agent: Agent Performance Metrics

Interval-level performance metrics per agent and communication channel. Use for individual agent reporting, productivity analysis, and time-in-state calculations.

ColumnTypeDescription
AGENT_IDstringUnique agent identifier.
AGENT_NAMEstringAgent's display name.
AGENT_EMAILstringAgent's email address.
CHANNELstringCommunication channel: phone, email, chat, etc.
SUB_CHANNELstringChannel direction: inbound or outbound.
INTERACTIONSnumberTotal interactions handled by the agent during the interval.
WAITTIMEnumberTotal customer wait time before agent accepted, in seconds.
HOLDTIMEnumberTotal hold time in seconds.
INTERACTIONTIMEnumberTotal active interaction time in seconds.
WRAPUPTIMEnumberTotal wrap-up time in seconds.
HOLD_INTERACTIONSnumberNumber of interactions where hold was used.
TRANSFERED_INTERACTIONSnumberNumber of interactions transferred by this agent.
I_INTERACTIONTIMEnumberInterval aggregate interaction time.
I_WRAPUPTIMEnumberInterval aggregate wrap-up time.
I_RINGTIMEnumberTotal time interactions rang before the agent answered, in seconds.
I_AUXTIMEnumberTotal time agent spent in auxiliary (not-ready) states during the interval.
I_STAFFTIMEnumberTotal time the agent was staffed (logged in) during the interval.
TI_AVAILTIMEnumberTotal available time across the interval (staffed minus aux).
TI_STAFFTIMEnumberTotal staffed time across the interval.
TI_AUXTIMEnumberTotal aux time across the interval.
OUTOFFOCUSTIMEnumberTotal out-of-focus time across all states.
INTERACTION_OUTOFFOCUSTIMEnumberOut-of-focus time during active interactions.
WRAPUP_OUTOFFOCUSTIMEnumberOut-of-focus time during wrap-up.
INTERACTION_INFOCUSTIMEnumberIn-focus time during active interactions.
WRAPUP_INFOCUSTIMEnumberIn-focus time during wrap-up.

agentAux: Agent Auxiliary Status

Interval-level aux status metrics per agent, broken down by status type. Use to analyse time agents spend in each not-ready state.

ColumnTypeDescription
AGENT_IDstringUnique agent identifier.
AGENT_NAMEstringAgent's display name.
AGENT_TAGSstringComma-separated list of tags assigned to the agent (e.g. team-alpha,support).
STATUS_TYPEstringLogin state category, e.g. Q Login, busy.
STATUSstringSpecific status name within the status type, e.g. Available, On Call.
AGENT_TIME_ZONEstringThe agent's configured time zone (IANA format, e.g. America/New_York).
I_STAFFTIMEnumberInterval staffed time in seconds.
TI_STAFFTIMEnumberTotal staffed time across the interval.
I_AUXTIMEnumberInterval aux time in seconds for this specific status.
TI_AUXTIMEnumberTotal aux time across the interval for this status.

agentByQueue: Agent Performance by Queue

Agent 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.

ColumnTypeDescription
AGENT_IDstringUnique agent identifier.
AGENT_NAMEstringAgent's display name.
QUEUE_IDstringQueue identifier the metrics are scoped to.
QUEUE_NAMEstringDisplay name of the queue.
CHANNELstringCommunication channel.
SUB_CHANNELstringChannel direction.
INTERACTIONSnumberInteractions handled by this agent for this queue during the interval.
I_INTERACTIONTIMEnumberTotal interaction time in seconds.
I_WRAPUPTIMEnumberTotal wrap-up time in seconds.
HOLD_INTERACTIONSnumberInteractions where hold was used.
AUXIN_INTERACTIONSnumberInteractions where the agent entered an aux state during handling.
HOLDTIMEnumberTotal hold time in seconds.
TRANSFERED_INTERACTIONSnumberInteractions transferred by this agent.
AUXOUT_INTERACTIONSnumberInteractions where the agent exited an aux state during handling.
I_AUXINTIMEnumberTotal time spent entering aux states during interactions.
I_AUXOUTTIMEnumberTotal time spent exiting aux states during interactions.
ASSISTSnumberNumber of supervisor assists received during interactions.

agentLoginSessions: Agent Login Sessions

Records 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 columnHeaders array for the full list of available fields.


agentLoginLogoutByQueue: Agent Login/Logout by Queue

Login and logout events recorded at the queue level. Use for queue-level staffing history.

ColumnTypeDescription
SESSION_IDstringUnique identifier for this login session.
QUEUE_IDstringQueue the agent logged into.
AGENT_IDstringUnique agent identifier.
LOGIN_TIMEdatetimeUTC timestamp when the agent logged into this queue.
LOGOUT_TIMEdatetimeUTC timestamp when the agent logged out. Empty string if still logged in.
LOGOUT_REASONstringReason for logout, e.g. Manual. Empty if still logged in.

cxAgentLoginLogout: CX Agent Login/Logout

Full login session records with duration broken down by agent status type. Use for adherence reporting and session-level compliance data.

ColumnTypeDescription
IDstringUnique session record identifier.
USER_IDstringUnique agent/user identifier.
STATUS_TYPEstringSession type, e.g. CX Login.
STATUSstringAgent status during this record: Available, Offline, etc.
START_TIMEdatetimeSession start time in UTC.
END_TIMEdatetimeSession end time in UTC. Empty string if session is still active.
DURATIONnumberTotal session duration in seconds. 0 if session is still active.
DURATION_AVAILABLEnumberTime in seconds the agent was in Available status.
DURATION_AWAYnumberTime in seconds the agent was in Away status.
DURATION_BUSYnumberTime in seconds the agent was in Busy status.
DURATION_OFFLINEnumberTime in seconds the agent was in Offline status.
IS_SYSTEMnumber1 if this was a system-generated status change; 0 if agent-initiated.
IS_LOGINnumber1 if this record represents a login event.
CREATED_ATdatetimeUTC timestamp when this record was created.
UPDATED_ATdatetimeUTC timestamp when this record was last updated. Empty if unchanged since creation.

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).

ColumnTypeDescription
INTERACTION_SEGMENT_IDstringUnique identifier for this segment.
INTERACTION_IDstringThe parent interaction identifier.
QUEUE_IDstringQueue the interaction was routed through for this segment.
USER_IDstringAgent assigned to this segment.
STATUSstringSegment status, e.g. connected.
COMM_TYPEstringCommunication type, e.g. task, voice, chat.
SUB_COMM_TYPEstringSub-type, e.g. other, inbound.
WAIT_TIMEnumberCustomer wait time in seconds before agent connection.
HOLD_TIMEnumberHold time in seconds during this segment.
TIME_INTERACTINGnumberActive interaction time in seconds.
WRAP_UP_TIMEnumberWrap-up time in seconds.
END_TIMEdatetimeUTC timestamp when this segment ended.
EVENTstringEvent type for this segment record, e.g. status.
EVENT_DESCstringHuman-readable description of the event, e.g. connected.
SEGMENT_NUMBERnumberSequence number of this segment within the interaction.
COMPLETION_TYPEstringHow the interaction was completed, if applicable.
COMPLETION_VALUEstringValue associated with the completion type.
COMPLETION_DISPLAY_NAMEstringDisplay name for the completion outcome.
COMPLETION_TIME_UNIXnumberUnix timestamp of completion.
TRANSFER_LOCATIONstringDestination of a transfer, if applicable.
TRANSFER_RESULTstringOutcome of the transfer.
XFER_LOC_QUEUE_IDstringQueue ID of the transfer destination.
XFER_LOC_INTERACTION_IDstringInteraction ID at the transfer destination.
SILENCE_SEGMENTSstringSilence segment data, if recorded.
SILENCE_TOTALnumberTotal silence duration in seconds.
INTERACTION_TYPEstringType classification of the interaction.
INTERACTION_NOTESstringFree-text notes attached to the interaction.
INTERACTION_RESULTstringOutcome or result of the interaction.
INTERACTION_SUBJECTstringSubject or topic of the interaction.
FIRST_LAST_NAMEstringCustomer's name if available.
QUEUE_NAMEstringDisplay name of the queue.
SOURCE_PHONE_NUMBERstringCustomer's source phone number for voice interactions.
SOURCE_EMAILstringCustomer's email address for email/digital interactions.
INTERACTION_TAGSstringTags associated with the interaction.

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.

ColumnTypeDescription
WORKFLOWSESSION_IDstringUnique identifier for the workflow session.
WORKFLOWSESSION_INTERACTIONIDstringThe interaction ID associated with this session.
UPDATEHISTORYITEM_IDstringUnique identifier for this specific step execution record.
WORKFLOWSESSION_WORKFLOWNAMEstringName of the workflow that was executed.
HISTORYITEM_DURATION_MSnumberDuration of this step in milliseconds.
UPDATEHISTORYITEM_STARTTIMEdatetimeUTC timestamp when this step started.
UPDATEHISTORYITEM_ENDTIMEdatetimeUTC timestamp when this step ended.
WORKFLOWSESSION_STARTTIMEdatetimeUTC timestamp when the overall workflow session started.
WORKFLOWSESSION_ENDTIMEdatetimeUTC timestamp when the overall workflow session ended.
WORKFLOWSESSION_DURATION_MSnumberTotal workflow session duration in milliseconds.
FORMATTED_HISTORYITEM_DURATIONstringHuman-readable step duration, e.g. 00:00:05.000.
UPDATEHISTORYITEM_WORKFLOWITEMIDstringID of the workflow item (step definition) that was executed.
UPDATEHISTORYITEM_EXITPORTstringExit port taken from this step (e.g. success, failure).
UPDATEHISTORYITEM_PROMPTstringPrompt presented to the caller or system at this step, if applicable.
UPDATEHISTORYITEM_INPUTstringInput received at this step, if applicable.
UPDATEHISTORYITEM_ENDEVENTstringEvent that caused this step to end.
UPDATEHISTORYITEM_MODEstringExecution mode, e.g. auto.
UPDATEHISTORYITEM_TYPEstringStep type, e.g. PlayMessage, GetInput, RouteToQueue.
ITEM_DESCRIPTIONstringDescriptive label for the step type.
UPDATEHISTORYITEM_LABELstringUser-defined label for this step in the workflow designer.
WORKFLOWSESSION_WORKFLOWIDstringID of the workflow definition.
WORKFLOWSESSION_WORKFLOWVERSIONIDstringID of the specific workflow version executed.
WORKFLOWSESSION_WORKFLOWVERSIONNUMBERstringVersion number of the workflow, e.g. 1.0.
WORKFLOWSESSION_DATA_VARIABLESstringJSON object of workflow variables at session end.
WORKFLOWSESSION_DATA_SOURCEstringSource data for the session, e.g. api.
WORKFLOWSESSION_COMMTYPEstringCommunication type for the session, e.g. voice.
WORKFLOWSESSION_CHANNELTYPEstringChannel type, e.g. phone.
WORKFLOWSESSION_LANGUAGEstringLanguage code for the session, e.g. en.
WORKFLOWSESSION_ISVOICEbooleantrue if this was a voice session.
WORKFLOWSESSION_ISCHATbooleantrue if this was a chat session.
WORKFLOWSESSION_ISDIGITALbooleantrue if this was a digital (non-voice) session.
WORKFLOWSESSION_ISTASKbooleantrue if this was a task session.
WORKFLOWSESSION_ISEMBEDDEDbooleantrue if this was an embedded (sub-workflow) session.

workflow, mpccdr, transcript, clientSessions

These 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] = value

Empty 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 StatusCauseWhat to do
202 AcceptedRequest valid but data not yet processed for the intervalRetry after a short delay. columnHeaders are returned but records will be empty.
400 Bad RequestMissing interval, malformed parameter, or unsupported filter columnCheck error detail for the specific field. Ensure interval is present and correctly formatted.
401 UnauthorizedMissing 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 ForbiddenInsufficient permissions, or Analytics Insights dataset requested without entitlementCheck detail for the specific reason. Contact your administrator for entitlement queries.
404 Not FoundInvalid datasetNameVerify the dataset name against the Available Datasets table.
500 Internal Server ErrorPlatform errorRetry with exponential backoff. Contact Avaya Support if the issue persists.

Where Next?


Related Resources