Element API

@avaya/infinity-elements-api v1.0.0


ElementAPI

ElementAPI - Main API for web components to interact with the Infinity Extensibility Framework

This is the primary interface that elements use to communicate with core-agent-ui.
Uses window.postMessage for API requests/responses and events, with BroadcastChannel
for inter-element communication.

The methods are organized into four API families:

  • Interaction API Family - Controls and monitors customer interactions throughout their lifecycle. Initiate new voice and chat interactions, execute controls (transfer, consult, conference), and subscribe to interaction events.

  • Media API Family - Manages channel-specific capabilities including DTMF tones on voice channels and rich text messages with formatting and attachments.

  • Agent API Family - Manages agent presence and availability. Modify agent state and subscribe to state change notifications.

  • Admin API Family - Provides environmental and configuration data including logged-in agent context, users, queues, and reason codes.

Examples

import { ElementAPI } from '@avaya/infinity-elements-api';

const api = new ElementAPI({
  elementId: 'my-element',
  timeout: 5000,
  debug: true
});
const userInfo = await api.getUserInfo();
console.log('Agent name:', userInfo.displayName);
console.log('Agent status:', userInfo.agentStatus);
api.onInteractionAccepted((interactionId) => {
  console.log('Interaction accepted:', interactionId);
});

api.onInteractionEnded((interactionId) => {
  console.log('Interaction ended:', interactionId);
});

Constructors

Constructor

new ElementAPI(options: ElementAPIOptions): ElementAPI;

Creates a new ElementAPI instance

Parameters

ParameterType
optionsElementAPIOptions

Returns

ElementAPI

Example

const api = new ElementAPI({
  elementId: 'my-custom-element',
  timeout: 10000,
  debug: true
});

Interaction API Family

getInteraction()

getInteraction(): Promise<InteractionInfo>;

Get information about the current active interaction

Returns

Promise<InteractionInfo>

Promise resolving to the interaction information

Throws

Error if no active interaction exists

Example

try {
  const interaction = await api.getInteraction();
  console.log('Interaction ID:', interaction.interactionId);
  console.log('Customer:', interaction.customer?.name);
  console.log('Status:', interaction.status);
} catch (error) {
  console.error('No active interaction');
}

getUserInteractions()

getUserInteractions(params?: GetUserInteractionsParams): Promise<GetUserInteractionsResponse>;

Get user interactions including owned and viewing interactions

Retrieves all active interactions for the current or specified user,
including interactions they own and ones they are viewing.
Optionally includes queue and user details.

Parameters

ParameterTypeDescription
params?GetUserInteractionsParamsOptional parameters

Returns

Promise<GetUserInteractionsResponse>

Promise resolving to user interactions data

Examples

// Get current user's interactions with full details
const result = await api.getUserInteractions({ details: true });
console.log('Owned interactions:', result.interactions);
console.log('Viewing interactions:', result.viewing);
console.log('Logged in queues:', result.queue.loggedIn);
// Get interactions without queue/user details for better performance
const result = await api.getUserInteractions({ details: false });
const totalCount = result.interactions.length + result.viewing.length;
console.log('Total active interactions:', totalCount);

viewerRemoveInteraction()

viewerRemoveInteraction(): Promise<{
  message: string;
}>;

Remove the current interaction from the viewer

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.viewerRemoveInteraction();

endInteraction()

endInteraction(): Promise<{
  message: string;
}>;

End the current interaction

Terminates the active interaction and disconnects the call.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.endInteraction();
console.log('Interaction ended');

startVoiceCall()

startVoiceCall(): Promise<{
  message: string;
}>;

Start a voice call for the current interaction

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.startVoiceCall();

createVoiceInteraction()

createVoiceInteraction(params: CreateVoiceInteractionParams): Promise<{
  message: string;
}>;

Create a new voice interaction with a Queue ID and Phone Number

Creates a new outbound voice call interaction to the specified phone number
and assigns it to the specified queue.

Parameters

ParameterTypeDescription
paramsCreateVoiceInteractionParamsVoice interaction parameters

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.createVoiceInteraction({
  phoneNumber: '+1234567890',
  queueId: '003'
});

completeBlindTransfer()

completeBlindTransfer(options: BlindTransferOptions): Promise<boolean>;

Complete a blind transfer

Transfers the call to another agent or number without consultation.

Parameters

ParameterTypeDescription
optionsBlindTransferOptionsTransfer configuration

Returns

Promise<boolean>

Promise resolving to true if successful

Example

const interaction = await api.getInteraction();
await api.completeBlindTransfer({
  interactionId: interaction.interactionId,
  transferTo: '[email protected]',
  transferToName: 'John Doe',
  transferCallerIdType: 'internal'
});

singleStepTransfer()

singleStepTransfer(params: SingleStepTransferParams): Promise<{
  message: string;
}>;

Perform a single-step transfer

Transfers the interaction directly to the specified target.

Parameters

ParameterTypeDescription
paramsSingleStepTransferParamsTransfer parameters

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.singleStepTransfer({
  targetId: 'user123',
  targetName: 'Support Team'
});

consultCall()

consultCall(options: ConsultCallOptions): Promise<{
  message: string;
}>;

Initiate a consult call

Starts a consultation with another agent, phone number, or queue while keeping
the original caller on hold.

Parameters

ParameterTypeDescription
optionsConsultCallOptionsConsult call configuration

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Examples

const interaction = await api.getInteraction();
await api.consultCall({
  interactionId: interaction.interactionId,
  transferTo: '[email protected]'
});
await api.consultCall({
  interactionId: interaction.interactionId,
  phoneNumber: '+1234567890'
});
// Get available queues first
const queues = await api.getTransferQueuesInteraction();
const targetQueue = queues.find(q => q.name === 'Support Queue');

await api.consultCall({
  interactionId: interaction.interactionId,
  queueId: targetQueue.id
});

completeAttendedTransfer()

completeAttendedTransfer(): Promise<{
  message: string;
}>;

Complete an attended transfer

Finalizes the attended transfer after consulting with the target party.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

// After consulting
await api.completeAttendedTransfer();

attendedTransferWarm()

attendedTransferWarm(): Promise<{
  message: string;
}>;

Perform a warm attended transfer

Introduces the caller to the transfer target before completing the transfer.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.attendedTransferWarm();

attendedTransferCancel()

attendedTransferCancel(): Promise<{
  message: string;
}>;

Cancel an attended transfer

Cancels the ongoing attended transfer and returns to the original call.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.attendedTransferCancel();

acceptInteraction()

acceptInteraction(): Promise<{
  message: string;
}>;

Accept an incoming interaction

Accepts a queued or alerting interaction.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

api.onInteractionAccepted(async (interactionId) => {
  console.log('New interaction:', interactionId);
});

// When ready to accept
await api.acceptInteraction();

onInteractionStatusChanged()

onInteractionStatusChanged(callback: InteractionStatusChangedCallback): () => void;

Subscribe to interaction status changes

Fires when the status of an interaction changes (e.g., alerting, connected, held)

Parameters

ParameterTypeDescription
callbackInteractionStatusChangedCallbackFunction to call when interaction status changes

Returns

Unsubscribe function

(): void;

Returns

void

Example

const unsubscribe = api.onInteractionStatusChanged(({ interactionId, status }) => {
  console.log(`Interaction ${interactionId} status changed to ${status}`);
});

// Later, to unsubscribe:
unsubscribe();

onInteractionAccepted()

onInteractionAccepted(callback: InteractionAcceptedCallback): () => void;

Subscribe to interaction accepted events

Fires when an agent accepts an incoming interaction

Parameters

ParameterTypeDescription
callbackInteractionAcceptedCallbackFunction to call when an interaction is accepted

Returns

Unsubscribe function

(): void;

Returns

void

Example

api.onInteractionAccepted((interactionId) => {
  console.log('Accepted interaction:', interactionId);
  // Load customer data, show interaction UI, etc.
});

onInteractionEnded()

onInteractionEnded(callback: InteractionEndedCallback): () => void;

Subscribe to interaction ended events

Fires when an interaction is ended or disconnected

Parameters

ParameterTypeDescription
callbackInteractionEndedCallbackFunction to call when an interaction ends

Returns

Unsubscribe function

(): void;

Returns

void

Example

api.onInteractionEnded((interactionId) => {
  console.log('Interaction ended:', interactionId);
  // Clean up UI, save data, etc.
});

onInteractionUpdated()

onInteractionUpdated(callback: InteractionUpdatedCallback): () => void;

Subscribe to interaction updated events

Fires when an interaction is updated with new information

Parameters

ParameterTypeDescription
callbackInteractionUpdatedCallbackFunction to call when an interaction is updated

Returns

Unsubscribe function

(): void;

Returns

void

Example

api.onInteractionUpdated(({ interactionId, payload }) => {
  console.log('Interaction updated:', interactionId);
  console.log('New data:', payload);
});

onConsultStatusChanged()

onConsultStatusChanged(callback: ConsultStatusChangedCallback): () => void;

Subscribe to consult status changes

Fires when the status of a consultation changes

Parameters

ParameterTypeDescription
callbackConsultStatusChangedCallbackFunction to call when consult status changes

Returns

Unsubscribe function

(): void;

Returns

void

Example

api.onConsultStatusChanged(({ interactionId, consultStatus, consultParty }) => {
  console.log(`Consult ${consultStatus} with ${consultParty}`);
});

Media API Family

sendDialpadDigit()

sendDialpadDigit(
   digit: DialpadDigit, 
   audioOutputDeviceId: string | null, 
   noSendDialTone: boolean, 
   audioContextOverride?: "none" | "standard" | "webkit"): Promise<{
  message: string;
}>;

Send a DTMF dialpad digit during a call

Parameters

ParameterTypeDescription
digitDialpadDigitThe dialpad digit to send (0-9)
audioOutputDeviceIdstring | nullAudio output device ID or null for default
noSendDialTonebooleanWhether to suppress the dial tone sound
audioContextOverride?"none" | "standard" | "webkit"Audio context type override

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

import { DialpadDigit } from '@avaya/infinity-elements-api';

await api.sendDialpadDigit(
  DialpadDigit.One,
  null,
  false
);

insertTextIntoFeedInput()

insertTextIntoFeedInput(text: string): Promise<{
  message: string;
}>;

Insert text into the chat feed input field

Parameters

ParameterTypeDescription
textstringThe text to insert

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example

await api.insertTextIntoFeedInput('Hello, how can I help you today?');
sendRichMediaMessage()
sendRichMediaMessage(options: SendRichMediaMessageOptions): Promise<{
  message: string;
}>;

Send a rich media message (image, file, etc.) to the interaction

Parameters

ParameterTypeDescription
optionsSendRichMediaMessageOptionsMessage options (must provide either mediaUrl or file)

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Deprecated

This method is deprecated and will be removed in a future version.

Examples

await api.sendRichMediaMessage({
  name: 'Product Image',
  mediaUrl: 'https://example.com/image.jpg',
  text: 'Here is the product you requested'
});
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];

await api.sendRichMediaMessage({
  name: 'Document',
  file: file,
  text: 'Attached document'
});

sendChatMessage()

sendChatMessage(options: SendChatMessageOptions): Promise<{
  message: string;
}>;

Send a chat message to the interaction

Supports sending text messages, media from URLs, or file uploads.
At least one of text, mediaUrl, or file must be provided.

Parameters

ParameterTypeDescription
optionsSendChatMessageOptionsMessage options (must provide interactionId and at least one of text, mediaUrl, or file)

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Examples

await api.sendChatMessage({
  interactionId: 'int-123',
  text: 'Hello, how can I help you today?'
});
await api.sendChatMessage({
  interactionId: 'int-123',
  mediaUrl: 'https://example.com/image.jpg',
  text: 'Here is the product you requested'
});
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];

await api.sendChatMessage({
  interactionId: 'int-123',
  file: file,
  text: 'Attached document'
});
await api.sendChatMessage({
  interactionId: 'int-123',
  text: 'Please review this document',
  file: documentFile,
  fileName: 'Important Document.pdf'
});

onReceivedFeedMessage()

onReceivedFeedMessage(callback: FeedMessageCallback): () => void;

Subscribe to feed messages

Fires when a new message is received in the interaction feed

Parameters

ParameterTypeDescription
callbackFeedMessageCallbackFunction to call when a feed message is received

Returns

Unsubscribe function

(): void;

Returns

void

Example

api.onReceivedFeedMessage((message) => {
  console.log('New message:', message.text);
  console.log('From:', message.from);
});

Agent API Family

getUserInfo()

getUserInfo(): Promise<UserInfo>;

Get information about the current logged-in user/agent

Returns

Promise<UserInfo>

Promise resolving to the user information including agent status, queues, and profile

Example

const userInfo = await api.getUserInfo();
console.log('Agent:', userInfo.displayName);
console.log('Status:', userInfo.agentStatus);
console.log('Queues:', userInfo.queues);
console.log('Email:', userInfo.email);

setAgentStatus()

setAgentStatus(
   userId: string, 
   status: AgentStatus, 
   reason?: {
  id: string;
  name: string;
}): Promise<{
  message: string;
}>;

Set the agent's status (Available, Away, Busy, etc.)

Parameters

ParameterTypeDescription
userIdstringThe user ID of the agent
statusAgentStatusThe new agent status
reason?{ id: string; name: string; }Optional reason for the status change (required for some statuses)
reason.id?string-
reason.name?string-

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Examples

const userInfo = await api.getUserInfo();
await api.setAgentStatus(userInfo.id, 'Available');
const userInfo = await api.getUserInfo();
await api.setAgentStatus(userInfo.id, 'Away', {
  id: 'lunch',
  name: 'Lunch Break'
});

getAvayaJwt()

getAvayaJwt(options: {
  authorizationEndpoint?: string;
  tokenEndpoint?: string;
  clientId?: string;
  scopes?: string[];
  redirectUri?: string;
  popupOptions?: PopupOptions;
  forceRefresh?: boolean;
}): Promise<string>;

Get Avaya JWT token with multi-level request deduplication and automatic refresh

  • Returns cached token from localStorage if available and not expired
  • Automatically refreshes token if expired (using refresh token)
  • Prevents duplicate concurrent fetch requests (instance-level)
  • Prevents duplicate OAuth popups across iframes/elements (cross-iframe coordination)
  • Initiates Keycloak OAuth flow if no token exists

Cross-iframe coordination ensures that if 10 iframes all call getAvayaJwt(),
only ONE OAuth popup will appear, and all iframes will receive the same token.

Uses the existing inter-element BroadcastChannel for coordination (consistent with other APIs)

GUARANTEE: This function ALWAYS either returns a JWT string or throws an error.
There are no code paths that return undefined or hang indefinitely.

Parameters

ParameterTypeDescription
options{ authorizationEndpoint?: string; tokenEndpoint?: string; clientId?: string; scopes?: string[]; redirectUri?: string; popupOptions?: PopupOptions; forceRefresh?: boolean; }Configuration options (all optional, uses defaults if not provided)
options.authorizationEndpoint?stringKeycloak authorization endpoint URL
options.tokenEndpoint?stringKeycloak token endpoint URL
options.clientId?stringOAuth client ID
options.scopes?string[]OAuth scopes to request
options.redirectUri?stringOAuth redirect URI (URL to redirect.html)
options.popupOptions?PopupOptionsPopup window size/position (defaults to 500x600)
options.forceRefresh?booleanForce token refresh even if not expired (defaults to false)

Returns

Promise<string>

Promise The JWT token (never returns undefined, always throws on error)

Example

// Use defaults
const jwt = await api.getAvayaJwt();

// With configuration
const jwt = await api.getAvayaJwt({
  authorizationEndpoint: 'https://keycloak.example.com/auth/realms/xxx/protocol/openid-connect/auth',
  tokenEndpoint: 'https://keycloak.example.com/auth/realms/xxx/protocol/openid-connect/token',
  clientId: 'my-client-id',
  redirectUri: 'https://myapp.com/redirect.html',
  forceRefresh: true
});

refreshToken()

refreshToken(options: {
  tokenEndpoint?: string;
  clientId?: string;
}): Promise<string>;

Refresh the access token using the stored refresh token

Parameters

ParameterTypeDescription
options{ tokenEndpoint?: string; clientId?: string; }Configuration options
options.tokenEndpoint?stringKeycloak token endpoint URL (required)
options.clientId?stringOAuth client ID (required)

Returns

Promise<string>

Promise The new JWT access token

Throws

Error if refresh token is not available or refresh fails

Example

try {
  const newJwt = await api.refreshToken({
    tokenEndpoint: 'https://keycloak.example.com/auth/realms/xxx/protocol/openid-connect/token',
    clientId: 'my-client-id'
  });
  console.log('Token refreshed successfully');
} catch (error) {
  console.error('Token refresh failed:', error);
  // May need to re-authenticate
}

clearAvayaJwt()

clearAvayaJwt(): void;

Clear the cached JWT token and force re-authentication on next getAvayaJwt call

Returns

void

Example

api.clearAvayaJwt();
const newJwt = await api.getAvayaJwt(); // Will trigger OAuth flow

Admin API Family

getUsers()

getUsers(params?: {
  interactionId?: string;
  filter?: string;
}): Promise<GetUsersResponse[]>;

Get a list of users in Infinity

Returns users available for transfer or consult operations. Returns up to 100 users.

  • App Level (sidebar widgets): Provide interactionId parameter
  • Interaction Level (interaction widgets): Omit interactionId, uses interaction context automatically

Parameters

ParameterTypeDescription
params?{ interactionId?: string; filter?: string; }Optional parameters
params.interactionId?stringRequired for app-level widgets, optional for interaction-level widgets
params.filter?stringOptional substring search against user name fields

Returns

Promise<GetUsersResponse[]>

Promise resolving to array of user information

Examples

const users = await api.getUsers();
users.forEach(user => {
  console.log(`${user.fullName} - ${user.cxStatus.status} - ${user.presence}`);
});
const users = await api.getUsers({ filter: 'john' });
console.log('Found users:', users.map(u => u.fullName));
const users = await api.getUsers({ interactionId: 'int-123' });
users.forEach(user => {
  console.log(`${user.fullName} - ${user.cxStatus.status} - ${user.presence}`);
});
const users = await api.getUsers({
  interactionId: 'int-123',
  filter: 'john'
});
const users = await api.getUsers({ filter: searchInput });
const eligibleUsers = users.filter(u => u.eligible);
eligibleUsers.forEach(user => {
  console.log(`${user.fullName} (${user.extension}) - ${user.cxStatus.status}`);
});

getUserQueues()

getUserQueues(params?: {
  filter?: string;
}): Promise<UserQueueInfo[]>;

Get all queues available to the current user (App Level)

Returns a basic list of queues the agent has access to.

Parameters

ParameterTypeDescription
params?{ filter?: string; }Optional filter parameters
params.filter?string-

Returns

Promise<UserQueueInfo[]>

Promise resolving to array of user queue information

Example

const queues = await api.getUserQueues();
console.log('Available queues:', queues.map(q => q.name));

// With filter
const salesQueues = await api.getUserQueues({ filter: 'Sales' });

getTransferQueues()

getTransferQueues(params: {
  interactionId: string;
  filter?: string;
}): Promise<InteractionQueueInfo[]>;

Get transfer queues with real-time statistics (App Level)

Returns detailed queue information including waiting interactions, active agents,
and average wait times. Requires explicit interactionId since this is used at app level
where interaction context is not available.

Parameters

ParameterTypeDescription
params{ interactionId: string; filter?: string; }Required interactionId and optional filter parameters
params.interactionIdstring-
params.filter?string-

Returns

Promise<InteractionQueueInfo[]>

Promise resolving to array of queue information with statistics

Example

const queues = await api.getTransferQueues({
  interactionId: 'int-123',
  filter: 'support'
});
queues.forEach(queue => {
  console.log(`${queue.name}: ${queue.waitingInteractions} waiting`);
  console.log(`Active agents: ${queue.countActiveAgents}`);
});

getTransferQueuesInteraction()

getTransferQueuesInteraction(params?: {
  filter?: string;
}): Promise<InteractionQueueInfo[]>;

Get transfer queues with real-time statistics (Interaction Level)

Returns detailed queue information including waiting interactions, active agents,
and average wait times. Uses interaction context automatically.

Parameters

ParameterTypeDescription
params?{ filter?: string; }Optional filter parameters
params.filter?string-

Returns

Promise<InteractionQueueInfo[]>

Promise resolving to array of queue information with statistics

Example

const queues = await api.getTransferQueuesInteraction({ filter: 'support' });
queues.forEach(queue => {
  console.log(`${queue.name}: ${queue.waitingInteractions} waiting`);
  console.log(`Active agents: ${queue.countActiveAgents}`);
});

getReasonCodes()

getReasonCodes(params?: GetReasonCodesParams): Promise<GetReasonCodesResponse>;

Get reason codes for agent status changes

Returns available reason codes that can be used when changing agent status.

Parameters

ParameterTypeDescription
params?GetReasonCodesParamsOptional parameters

Returns

Promise<GetReasonCodesResponse>

Promise resolving to reason codes response

Examples

const response = await api.getReasonCodes();
console.log('Reason codes:', response.reasons);
const response = await api.getReasonCodes({ type: 'away' });
const awayReasons = response.reasons;

Inter-Element Communication

sendInterElementMessage()

sendInterElementMessage<T>(message: T): void;

Send a message to other elements via the inter-element BroadcastChannel

Type Parameters

Type ParameterDescription
TThe type of the message

Parameters

ParameterTypeDescription
messageTThe message to send (can be any serializable type)

Returns

void

onInterElementMessage()

onInterElementMessage<T>(callback: (message: T) => void): () => void;

Subscribe to messages from other elements via the inter-element BroadcastChannel
This is the easiest way to listen for messages - just provide a callback function

Type Parameters

Type ParameterDescription
TThe expected type of messages

Parameters

ParameterTypeDescription
callback(message: T) => voidFunction called when a message is received

Returns

Unsubscribe function to stop listening

(): void;

Returns

void

Example

const unsubscribe = api.onInterElementMessage<MyMessageType>((message) => {
  console.log('Received:', message);
});

// Later, stop listening
unsubscribe();

Events

onError()

onError(callback: ErrorCallback): () => void;

Subscribe to error events

Fires when an error occurs in the API

Parameters

ParameterTypeDescription
callbackErrorCallbackFunction to call when an error occurs

Returns

Unsubscribe function

(): void;

Returns

void

Example

api.onError((error) => {
  console.error('API Error:', error.code, error.message);
  // Display error notification to user
});

Lifecycle

destroy()

destroy(): void;

Clean up resources when the React component is unmounted or no longer needed

Removes all event listeners, closes channels, and clears pending requests.
Call this method in your React component's cleanup/unmount lifecycle.

Returns

void

Example

// In a React component
useEffect(() => {
  const api = new ElementAPI();
  return () => {
    api.destroy(); // Cleanup on unmount
  };
}, []);

Enumerations

DialpadDigit

DTMF dialpad digits (0-9) for sending tones during calls

Example

import { DialpadDigit } from '@avaya/infinity-elements-api';

await api.sendDialpadDigit(DialpadDigit.Five, null, false);

Functions

setupOAuthCallbackHandler()

function setupOAuthCallbackHandler(): void;

Setup OAuth callback handler - call once at app initialization

Sets up listener for redirect.html config requests

Returns

void


refreshAccessToken()

function refreshAccessToken(
   refreshToken: string, 
   tokenEndpoint: string, 
clientId: string): Promise<TokenResponse>;

Refresh an expired access token using the refresh token

Elements run in sandboxed iframes (about:srcdoc) which have origin "null".
Direct fetch to Keycloak fails due to CORS.

This function delegates the refresh request to the host (agent-ui) via
postMessage. The host has a proper origin and can make the request
without CORS issues. This is completely silent - no popups or visible UI.

Parameters

ParameterTypeDescription
refreshTokenstringThe refresh token to use
tokenEndpointstringThe token endpoint URL
clientIdstringThe OAuth client ID

Returns

Promise<TokenResponse>


getStoredTokenData()

function getStoredTokenData(jwtStorageKey: string): StoredTokenData | null;

Get stored token data from localStorage

Parameters

ParameterType
jwtStorageKeystring

Returns

StoredTokenData | null


isTokenExpired()

function isTokenExpired(tokenData: StoredTokenData): boolean;

Check if a token is expired

Parameters

ParameterType
tokenDataStoredTokenData

Returns

boolean


isRefreshTokenExpired()

function isRefreshTokenExpired(tokenData: StoredTokenData): boolean;

Check if refresh token is expired

Parameters

ParameterType
tokenDataStoredTokenData

Returns

boolean

Interfaces

InteractionInfo

Properties

PropertyType
idstring
interactionIdstring
statusstring
commType?string
direction?string
customer?{ name?: string; number?: string; id?: string; }
customer.name?string
customer.number?string
customer.id?string
startTime?string
duration?number
metadata?Record<string, unknown>

InteractionUpdatePayload

Properties

PropertyType
idstring
status?string
commType?string
subCommType?string
isAudio?boolean
isHold?boolean
isMute?boolean
details?{ notes?: string; subject?: string; }
details.notes?string
details.subject?string
sourceDetails?{ phoneNumber?: string; email?: string; name?: string; }
sourceDetails.phoneNumber?string
sourceDetails.email?string
sourceDetails.name?string

BlindTransferOptions

Properties

PropertyType
interactionIdstring
transferTostring
transferToNamestring
transferCallerIdType?string

SingleStepTransferParams

Properties

PropertyType
targetIdstring
targetNamestring

CreateVoiceInteractionParams

Properties

PropertyType
phoneNumberstring
queueIdstring

SendRichMediaMessageOptions

Properties

PropertyType
name?string
mediaUrl?string
file?File
text?string

SendChatMessageOptions

Properties

PropertyTypeDescription
interactionIdstringRequired interaction ID
text?stringOptional message text
mediaUrl?stringOptional media URL (image, file, etc.)
file?FileOptional file to upload
fileName?stringOptional file name for the message/file

ConsultCallOptions

Properties

PropertyTypeDescription
interactionIdstring-
transferTo?stringUser ID or handle to consult with (internal user/agent)
phoneNumber?stringPhone number to consult with (external number)
queueId?stringQueue ID to consult to. Can be obtained via getTransferQueuesInteraction

AgentStatus

Properties

PropertyType
idstring
namestring
categorystring

ReasonCode

Properties

PropertyType
idstring
reasonstring
type"away" | "busy" | "available" | "queueLogout"
typeDisplaystring
eliteAuxCode?number
isDisabledboolean
isSystemCode?boolean
createdAtstring
createdBystring
updatedAtstring | null
updatedBystring | null
inWorkflowIdstring | null
inWorkflowVersionIdstring | null
outWorkflowIdstring | null
outWorkflowVersionIdstring | null
queryFieldIdstring | null

GetReasonCodesParams

Properties

PropertyType
type?"away" | "busy" | "available" | "queueLogout" | null

GetReasonCodesResponse

Properties

PropertyType
reasonsReasonCode[]

GetUserInteractionsParams

Properties

PropertyType
userId?string
details?boolean

QueueLoggedIn

Properties

PropertyType
queueIdstring
namestring
queueWeightnumber
timeZonestring
extensionnumber | null
createdOnstring
createdOnUnixnumber

QueueAccess

Properties

PropertyType
queueIdstring
namestring
queueWeightnumber
timeZonestring
extensionnumber | null

UserInteractionsUser

Properties

PropertyType
idstring
firstNamestring
lastNamestring
fullNamestring
titlestring | null
emailstring
extensionstring | null

GetUserInteractionsResponse

Properties

PropertyType
interactionsInteraction[]
viewingInteraction[]
combinedIds?string[]
queue{ loggedIn: QueueLoggedIn[]; access: QueueAccess[]; }
queue.loggedInQueueLoggedIn[]
queue.accessQueueAccess[]
userUserInteractionsUser

ElementAPIOptions

Configuration options for ElementAPI initialization

Properties

PropertyTypeDescription
elementId?stringUnique identifier for this element instance (auto-generated if not provided)
timeout?numberAPI request timeout in milliseconds (default: 5000)
debug?booleanEnable debug logging to console (default: false)

InteractionQueueInfo

Properties

PropertyType
idstring
namestring
extensionstring | null
waitingInteractionsnumber
countOfCallbacksnumber
countActiveAgentsnumber
totalCurrentInteractionsnumber
connectedInteractionsnumber
avgInteractionWaitTimenumber
weightnumber
eligibleboolean

UserQueueInfo

Properties

PropertyType
idstring
namestring

KeycloakConfig

Keycloak OAuth 2.0 PKCE Authentication Module

Supports cross-iframe coordination to prevent multiple OAuth popups

Uses postMessage-based config exchange with redirect.html:

  1. Component opens popup directly
  2. redirect.html requests config via postMessage
  3. Component responds with config + code verifier
  4. redirect.html performs token exchange
  5. redirect.html sends token back to component

No localStorage bridging needed - config stays in memory.

Properties

PropertyTypeDescription
authorizationEndpoint?string-
tokenEndpoint?string-
clientId?string-
scopes?string[]-
redirectUri?stringURL to redirect.html - used for OAuth callback and token refresh

PopupOptions

Properties

PropertyType
width?number
height?number
left?number
top?number

TokenResponse

Properties

PropertyType
access_tokenstring
refresh_token?string
expires_in?number
refresh_expires_in?number
token_type?string
id_token?string

StoredTokenData

Properties

PropertyType
accessTokenstring
refreshToken?string
expiresAt?number
refreshExpiresAt?number

GetUsersResponse

Response from getUsers API
Used for transfer/consult target selection

Properties

PropertyTypeDescription
idstringHandle / internal user ID
firstNamestringFirst name
lastNamestringLast name
fullNamestringFull name
emailstringEmail address
mobilestring | nullMobile phone number
presencestring | nullVoIP/presence status (e.g., "available", "busy", "offline")
cxStatus{ statusType: string; status: string; }CX status information
cxStatus.statusTypestringCX status category (e.g., "available", "busy", "away")
cxStatus.statusstringCX status display name (e.g., "Available", "On Call", "Lunch")
extensionstring | nullExtension number
eligiblebooleanWhether user is eligible for transfer

UserLocation

Properties

PropertyType
addressData?{ address1: string; address2: string; city: string; state: string; country: string; postalCode: string; locationName: string; }
addressData.address1string
addressData.address2string
addressData.citystring
addressData.statestring
addressData.countrystring
addressData.postalCodestring
addressData.locationNamestring
locationIdstring
e911Numberstring
isE911string | boolean
e911CallerIdNumber?string | null

QueueInfo

Properties

PropertyType
queueIdstring
namestring
isAccessboolean
isAutoLoginboolean
proficiency?unknown

UserTag

Properties

PropertyType
tagIdstring
backgroundColorstring
colorstring
iconCodestring
namestring

DefaultLeaveEventToStatus

Properties

PropertyType
actionstring
statusstring

InfinityElement

Properties

PropertyType
accountIdstring
apiVersionIdstring
config{ file: { filename: string; mimetype: string; size: number; storageId: string; }; }
config.file{ filename: string; mimetype: string; size: number; storageId: string; }
config.file.filenamestring
config.file.mimetypestring
config.file.sizenumber
config.file.storageIdstring
createdAtstring
createdBystring
folderIdstring | null
iconstring
idstring
namestring
tagNamestring
updatedAtstring
updatedBystring | null
uploadedAtstring | null
uploadedBystring | null

UserInfo

Properties

PropertyTypeDescription
userIdstringUser ID
status?stringWhether the user is enabled (status === 'enabled' for yes)
firstNamestringFirst name
lastNamestringLast name
nameSuffix?string | nullName suffix (e.g., Jr., Sr., III)
titlestringJob title
emailstringEmail address
mobile?string | nullMobile phone number
languageCode?stringLanguage code (e.g., 'en', 'es')
location?UserLocation | nullE911 location information
timezone?stringTimezone (e.g., 'America/New_York')
licenseType?stringLicense type
consolePermissions?{ account?: Record<"read", string>; api?: Record<"read", string>; callRecordings?: Record<"delete", string>; cx?: Record<"read", string>; mL?: Record<"read", string>; numbers?: Record<"read", string>; objects?: Record<"read", string>; portal?: Record<"console-web", string>; queues?: Record<"read", string>; }Console permissions
consolePermissions.account?Record<"read", string>-
consolePermissions.api?Record<"read", string>-
consolePermissions.callRecordings?Record<"delete", string>-
consolePermissions.cx?Record<"read", string>-
consolePermissions.mL?Record<"read", string>-
consolePermissions.numbers?Record<"read", string>-
consolePermissions.objects?Record<"read", string>-
consolePermissions.portal?Record<"console-web", string>-
consolePermissions.queues?Record<"read", string>-
appPermissions?{ agent?: Record<"read", string>; analytics?: Record<"read", string>; chat?: Record<"read" | "admin", string>; coaching?: Record<"read", string>; contacts?: Record<"read", string>; workflowReplay?: Record<"read", string>; dashboards?: Record<"read", string>; portal?: { app-android: string; app-ios: string; app-osx: string; app-web: string; app-win: string; app-support-access: string; }; queueList?: Record<"read", string>; queueToggling?: Record<"read", string>; teamview?: Record<"read", string>; ucFax?: Record<"read", string>; outreachmonitor?: Record<"read", string>; }Application permissions
appPermissions.agent?Record<"read", string>-
appPermissions.analytics?Record<"read", string>-
appPermissions.chat?Record<"read" | "admin", string>-
appPermissions.coaching?Record<"read", string>-
appPermissions.contacts?Record<"read", string>-
appPermissions.workflowReplay?Record<"read", string>-
appPermissions.dashboards?Record<"read", string>-
appPermissions.portal?{ app-android: string; app-ios: string; app-osx: string; app-web: string; app-win: string; app-support-access: string; }-
appPermissions.portal.app-androidstring-
appPermissions.portal.app-iosstring-
appPermissions.portal.app-osxstring-
appPermissions.portal.app-webstring-
appPermissions.portal.app-winstring-
appPermissions.portal.app-support-accessstring-
appPermissions.queueList?Record<"read", string>-
appPermissions.queueToggling?Record<"read", string>-
appPermissions.teamview?Record<"read", string>-
appPermissions.ucFax?Record<"read", string>-
appPermissions.outreachmonitor?Record<"read", string>-
outboundPermissions?{ task: "0" | "1"; email: "0" | "1"; phone: "0" | "1"; messaging: "0" | "1"; }Outbound permissions by communication type
outboundPermissions.task"0" | "1"-
outboundPermissions.email"0" | "1"-
outboundPermissions.phone"0" | "1"-
outboundPermissions.messaging"0" | "1"-
rejectInteractions?booleanInbound permissions - can reject interactions
monitoringAction?stringMonitoring action configuration
completedAction?stringCompleted action configuration
interactionViewsType?stringInteraction view type
modifyInteractionViews?booleanCan create/edit interaction views
tags?UserTag[]List of assigned tags
personalQueueId?stringPersonal queue ID
defaultOutboundQueue?stringDefault outbound queue name
outboundActionAndStatus?DefaultLeaveEventToStatusOutbound call action and status
inboundActionAndStatus?DefaultLeaveEventToStatusInbound call action and status
callbackActionAndStatus?DefaultLeaveEventToStatusCallback action and status
voicemailActionAndStatus?DefaultLeaveEventToStatusVoicemail action and status
queues?QueueInfo[]List of assigned queues with access, auto-login, and proficiency info
phoneSpaces?numberNumber of concurrent phone interactions allowed
messagingSpaces?numberNumber of concurrent messaging interactions allowed
emailSpaces?numberNumber of concurrent email interactions allowed
taskSpaces?numberNumber of concurrent task interactions allowed
eliteExtension?string | nullElite Agent Extension
eliteAgentId?string | nullElite Agent ID
eliteSipAddress?string | nullSIP Address
eliteSbcGroupId?string | nullSBC Group ID
crmConfigurations?unknownCRM Configuration object
infinityElements?InfinityElement[]App-level Infinity Elements assigned
authToken?stringAuthentication token (JWT) using accessToken

Type Aliases

CHANNEL_NAMES

type CHANNEL_NAMES = {
  INTERACTION_STATUS_CHANGED: "interaction-status-changed";
  INTERACTION_ENDED: "on-interaction-ended";
  INTERACTION_ACCEPTED: "on-interaction-accepted";
  INTERACTION_UPDATED: "on-interaction-updated";
  CONSULT_STATUS_CHANGED: "consult-status-changed";
  FEED_MESSAGE: "feed-message";
  INTER_ELEMENT: "inter-element";
};

Properties

PropertyModifierTypeDefault value
INTERACTION_STATUS_CHANGEDreadonly"interaction-status-changed""interaction-status-changed"
INTERACTION_ENDEDreadonly"on-interaction-ended""on-interaction-ended"
INTERACTION_ACCEPTEDreadonly"on-interaction-accepted""on-interaction-accepted"
INTERACTION_UPDATEDreadonly"on-interaction-updated""on-interaction-updated"
CONSULT_STATUS_CHANGEDreadonly"consult-status-changed""consult-status-changed"
FEED_MESSAGEreadonly"feed-message""feed-message"
INTER_ELEMENTreadonly"inter-element""inter-element"

InteractionStatusChangedCallback()

type InteractionStatusChangedCallback = (payload: {
  interactionId: string;
  status: string;
}) => void;

Parameters

ParameterType
payload{ interactionId: string; status: string; }
payload.interactionIdstring
payload.statusstring

Returns

void


InteractionEndedCallback()

type InteractionEndedCallback = (interactionId: string) => void;

Parameters

ParameterType
interactionIdstring

Returns

void


InteractionAcceptedCallback()

type InteractionAcceptedCallback = (interactionId: string) => void;

Parameters

ParameterType
interactionIdstring

Returns

void


InteractionUpdatedCallback()

type InteractionUpdatedCallback = (payload: {
  interactionId: string;
  event: "interaction.update";
  payload: Interaction;
}) => void;

Parameters

ParameterType
payload{ interactionId: string; event: "interaction.update"; payload: Interaction; }
payload.interactionIdstring
payload.event"interaction.update"
payload.payloadInteraction

Returns

void


ConsultStatusChangedCallback()

type ConsultStatusChangedCallback = (payload: {
  interactionId: string;
  consultStatus: string;
  consultParty?: string;
  error?: string;
}) => void;

Parameters

ParameterType
payload{ interactionId: string; consultStatus: string; consultParty?: string; error?: string; }
payload.interactionIdstring
payload.consultStatusstring
payload.consultParty?string
payload.error?string

Returns

void


FeedMessageCallback()

type FeedMessageCallback = (message: Message) => void;

Parameters

ParameterType
messageMessage

Returns

void


ErrorCallback()

type ErrorCallback = (error: {
  code: string;
  message: string;
  details?: unknown;
}) => void;

Parameters

ParameterType
error{ code: string; message: string; details?: unknown; }
error.codestring
error.messagestring
error.details?unknown

Returns

void

Variables

VERSION

const VERSION: "0.1.0" = "0.1.0";

@avaya/infinity-elements-api v1.0.0


ElementAPI

ElementAPI - Main API for web components to interact with the Infinity Extensibility Framework

This is the primary interface that elements use to communicate with core-agent-ui.
Uses window.postMessage for API requests/responses and events, with BroadcastChannel
for inter-element communication.

The methods are organized into four API families:

  • Interaction API Family - Controls and monitors customer interactions throughout their lifecycle. Initiate new voice and chat interactions, execute controls (transfer, consult, conference), and subscribe to interaction events.

  • Media API Family - Manages channel-specific capabilities including DTMF tones on voice channels and rich text messages with formatting and attachments.

  • Agent API Family - Manages agent presence and availability. Modify agent state and subscribe to state change notifications.

  • Admin API Family - Provides environmental and configuration data including logged-in agent context, users, queues, and reason codes.

Examples

import { ElementAPI } from '@avaya/infinity-elements-api';

const api = new ElementAPI({
  elementId: 'my-element',
  timeout: 5000,
  debug: true
});
const userInfo = await api.getUserInfo();
console.log('Agent name:', userInfo.displayName);
console.log('Agent status:', userInfo.agentStatus);
api.onInteractionAccepted((interactionId) => {
  console.log('Interaction accepted:', interactionId);
});

api.onInteractionEnded((interactionId) => {
  console.log('Interaction ended:', interactionId);
});

Constructors

Constructor

new ElementAPI(options: ElementAPIOptions): ElementAPI;

Creates a new ElementAPI instance

Parameters
ParameterType
optionsElementAPIOptions
Returns

ElementAPI

Example
const api = new ElementAPI({
  elementId: 'my-custom-element',
  timeout: 10000,
  debug: true
});

Methods

Interaction API Family

getInteraction()

getInteraction(): Promise<InteractionInfo>;

Get information about the current active interaction

Returns

Promise<InteractionInfo>

Promise resolving to the interaction information

Throws

Error if no active interaction exists

Example
try {
  const interaction = await api.getInteraction();
  console.log('Interaction ID:', interaction.interactionId);
  console.log('Customer:', interaction.customer?.name);
  console.log('Status:', interaction.status);
} catch (error) {
  console.error('No active interaction');
}

getUserInteractions()

getUserInteractions(params?: GetUserInteractionsParams): Promise<GetUserInteractionsResponse>;

Get user interactions including owned and viewing interactions

Retrieves all active interactions for the current or specified user,
including interactions they own and ones they are viewing.
Optionally includes queue and user details.

Parameters
ParameterTypeDescription
params?GetUserInteractionsParamsOptional parameters
Returns

Promise<GetUserInteractionsResponse>

Promise resolving to user interactions data

Examples
// Get current user's interactions with full details
const result = await api.getUserInteractions({ details: true });
console.log('Owned interactions:', result.interactions);
console.log('Viewing interactions:', result.viewing);
console.log('Logged in queues:', result.queue.loggedIn);
// Get interactions without queue/user details for better performance
const result = await api.getUserInteractions({ details: false });
const totalCount = result.interactions.length + result.viewing.length;
console.log('Total active interactions:', totalCount);

viewerRemoveInteraction()

viewerRemoveInteraction(): Promise<{
  message: string;
}>;

Remove the current interaction from the viewer

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.viewerRemoveInteraction();

endInteraction()

endInteraction(): Promise<{
  message: string;
}>;

End the current interaction

Terminates the active interaction and disconnects the call.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.endInteraction();
console.log('Interaction ended');

startVoiceCall()

startVoiceCall(): Promise<{
  message: string;
}>;

Start a voice call for the current interaction

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.startVoiceCall();

createVoiceInteraction()

createVoiceInteraction(params: CreateVoiceInteractionParams): Promise<{
  message: string;
}>;

Create a new voice interaction with a Queue ID and Phone Number

Creates a new outbound voice call interaction to the specified phone number
and assigns it to the specified queue.

Parameters
ParameterTypeDescription
paramsCreateVoiceInteractionParamsVoice interaction parameters
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.createVoiceInteraction({
  phoneNumber: '+1234567890',
  queueId: '003'
});

completeBlindTransfer()

completeBlindTransfer(options: BlindTransferOptions): Promise<boolean>;

Complete a blind transfer

Transfers the call to another agent or number without consultation.

Parameters
ParameterTypeDescription
optionsBlindTransferOptionsTransfer configuration
Returns

Promise<boolean>

Promise resolving to true if successful

Example
const interaction = await api.getInteraction();
await api.completeBlindTransfer({
  interactionId: interaction.interactionId,
  transferTo: '[email protected]',
  transferToName: 'John Doe',
  transferCallerIdType: 'internal'
});

singleStepTransfer()

singleStepTransfer(params: SingleStepTransferParams): Promise<{
  message: string;
}>;

Perform a single-step transfer

Transfers the interaction directly to the specified target.

Parameters
ParameterTypeDescription
paramsSingleStepTransferParamsTransfer parameters
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.singleStepTransfer({
  targetId: 'user123',
  targetName: 'Support Team'
});

consultCall()

consultCall(options: ConsultCallOptions): Promise<{
  message: string;
}>;

Initiate a consult call

Starts a consultation with another agent, phone number, or queue while keeping
the original caller on hold.

Parameters
ParameterTypeDescription
optionsConsultCallOptionsConsult call configuration
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Examples
const interaction = await api.getInteraction();
await api.consultCall({
  interactionId: interaction.interactionId,
  transferTo: '[email protected]'
});
await api.consultCall({
  interactionId: interaction.interactionId,
  phoneNumber: '+1234567890'
});
// Get available queues first
const queues = await api.getTransferQueuesInteraction();
const targetQueue = queues.find(q => q.name === 'Support Queue');

await api.consultCall({
  interactionId: interaction.interactionId,
  queueId: targetQueue.id
});

completeAttendedTransfer()

completeAttendedTransfer(): Promise<{
  message: string;
}>;

Complete an attended transfer

Finalizes the attended transfer after consulting with the target party.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
// After consulting
await api.completeAttendedTransfer();

attendedTransferWarm()

attendedTransferWarm(): Promise<{
  message: string;
}>;

Perform a warm attended transfer

Introduces the caller to the transfer target before completing the transfer.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.attendedTransferWarm();

attendedTransferCancel()

attendedTransferCancel(): Promise<{
  message: string;
}>;

Cancel an attended transfer

Cancels the ongoing attended transfer and returns to the original call.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.attendedTransferCancel();

acceptInteraction()

acceptInteraction(): Promise<{
  message: string;
}>;

Accept an incoming interaction

Accepts a queued or alerting interaction.

Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
api.onInteractionAccepted(async (interactionId) => {
  console.log('New interaction:', interactionId);
});

// When ready to accept
await api.acceptInteraction();

onInteractionStatusChanged()

onInteractionStatusChanged(callback: InteractionStatusChangedCallback): () => void;

Subscribe to interaction status changes

Fires when the status of an interaction changes (e.g., alerting, connected, held)

Parameters
ParameterTypeDescription
callbackInteractionStatusChangedCallbackFunction to call when interaction status changes
Returns

Unsubscribe function

(): void;
Returns

void

Example
const unsubscribe = api.onInteractionStatusChanged(({ interactionId, status }) => {
  console.log(`Interaction ${interactionId} status changed to ${status}`);
});

// Later, to unsubscribe:
unsubscribe();

onInteractionAccepted()

onInteractionAccepted(callback: InteractionAcceptedCallback): () => void;

Subscribe to interaction accepted events

Fires when an agent accepts an incoming interaction

Parameters
ParameterTypeDescription
callbackInteractionAcceptedCallbackFunction to call when an interaction is accepted
Returns

Unsubscribe function

(): void;
Returns

void

Example
api.onInteractionAccepted((interactionId) => {
  console.log('Accepted interaction:', interactionId);
  // Load customer data, show interaction UI, etc.
});

onInteractionEnded()

onInteractionEnded(callback: InteractionEndedCallback): () => void;

Subscribe to interaction ended events

Fires when an interaction is ended or disconnected

Parameters
ParameterTypeDescription
callbackInteractionEndedCallbackFunction to call when an interaction ends
Returns

Unsubscribe function

(): void;
Returns

void

Example
api.onInteractionEnded((interactionId) => {
  console.log('Interaction ended:', interactionId);
  // Clean up UI, save data, etc.
});

onInteractionUpdated()

onInteractionUpdated(callback: InteractionUpdatedCallback): () => void;

Subscribe to interaction updated events

Fires when an interaction is updated with new information

Parameters
ParameterTypeDescription
callbackInteractionUpdatedCallbackFunction to call when an interaction is updated
Returns

Unsubscribe function

(): void;
Returns

void

Example
api.onInteractionUpdated(({ interactionId, payload }) => {
  console.log('Interaction updated:', interactionId);
  console.log('New data:', payload);
});

onConsultStatusChanged()

onConsultStatusChanged(callback: ConsultStatusChangedCallback): () => void;

Subscribe to consult status changes

Fires when the status of a consultation changes

Parameters
ParameterTypeDescription
callbackConsultStatusChangedCallbackFunction to call when consult status changes
Returns

Unsubscribe function

(): void;
Returns

void

Example
api.onConsultStatusChanged(({ interactionId, consultStatus, consultParty }) => {
  console.log(`Consult ${consultStatus} with ${consultParty}`);
});

Media API Family

sendDialpadDigit()

sendDialpadDigit(
   digit: DialpadDigit, 
   audioOutputDeviceId: string | null, 
   noSendDialTone: boolean, 
   audioContextOverride?: "none" | "standard" | "webkit"): Promise<{
  message: string;
}>;

Send a DTMF dialpad digit during a call

Parameters
ParameterTypeDescription
digitDialpadDigitThe dialpad digit to send (0-9)
audioOutputDeviceIdstring | nullAudio output device ID or null for default
noSendDialTonebooleanWhether to suppress the dial tone sound
audioContextOverride?"none" | "standard" | "webkit"Audio context type override
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
import { DialpadDigit } from '@avaya/infinity-elements-api';

await api.sendDialpadDigit(
  DialpadDigit.One,
  null,
  false
);

insertTextIntoFeedInput()

insertTextIntoFeedInput(text: string): Promise<{
  message: string;
}>;

Insert text into the chat feed input field

Parameters
ParameterTypeDescription
textstringThe text to insert
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Example
await api.insertTextIntoFeedInput('Hello, how can I help you today?');
sendRichMediaMessage()
sendRichMediaMessage(options: SendRichMediaMessageOptions): Promise<{
  message: string;
}>;

Send a rich media message (image, file, etc.) to the interaction

Parameters
ParameterTypeDescription
optionsSendRichMediaMessageOptionsMessage options (must provide either mediaUrl or file)
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Deprecated

This method is deprecated and will be removed in a future version.

Examples
await api.sendRichMediaMessage({
  name: 'Product Image',
  mediaUrl: 'https://example.com/image.jpg',
  text: 'Here is the product you requested'
});
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];

await api.sendRichMediaMessage({
  name: 'Document',
  file: file,
  text: 'Attached document'
});

sendChatMessage()

sendChatMessage(options: SendChatMessageOptions): Promise<{
  message: string;
}>;

Send a chat message to the interaction

Supports sending text messages, media from URLs, or file uploads.
At least one of text, mediaUrl, or file must be provided.

Parameters
ParameterTypeDescription
optionsSendChatMessageOptionsMessage options (must provide interactionId and at least one of text, mediaUrl, or file)
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Examples
await api.sendChatMessage({
  interactionId: 'int-123',
  text: 'Hello, how can I help you today?'
});
await api.sendChatMessage({
  interactionId: 'int-123',
  mediaUrl: 'https://example.com/image.jpg',
  text: 'Here is the product you requested'
});
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];

await api.sendChatMessage({
  interactionId: 'int-123',
  file: file,
  text: 'Attached document'
});
await api.sendChatMessage({
  interactionId: 'int-123',
  text: 'Please review this document',
  file: documentFile,
  fileName: 'Important Document.pdf'
});

onReceivedFeedMessage()

onReceivedFeedMessage(callback: FeedMessageCallback): () => void;

Subscribe to feed messages

Fires when a new message is received in the interaction feed

Parameters
ParameterTypeDescription
callbackFeedMessageCallbackFunction to call when a feed message is received
Returns

Unsubscribe function

(): void;
Returns

void

Example
api.onReceivedFeedMessage((message) => {
  console.log('New message:', message.text);
  console.log('From:', message.from);
});

Agent API Family

getUserInfo()

getUserInfo(): Promise<UserInfo>;

Get information about the current logged-in user/agent

Returns

Promise<UserInfo>

Promise resolving to the user information including agent status, queues, and profile

Example
const userInfo = await api.getUserInfo();
console.log('Agent:', userInfo.displayName);
console.log('Status:', userInfo.agentStatus);
console.log('Queues:', userInfo.queues);
console.log('Email:', userInfo.email);

setAgentStatus()

setAgentStatus(
   userId: string, 
   status: AgentStatus, 
   reason?: {
  id: string;
  name: string;
}): Promise<{
  message: string;
}>;

Set the agent's status (Available, Away, Busy, etc.)

Parameters
ParameterTypeDescription
userIdstringThe user ID of the agent
statusAgentStatusThe new agent status
reason?{ id: string; name: string; }Optional reason for the status change (required for some statuses)
reason.id?string-
reason.name?string-
Returns

Promise<{
message: string;
}>

Promise resolving to a success message

Examples
const userInfo = await api.getUserInfo();
await api.setAgentStatus(userInfo.id, 'Available');
const userInfo = await api.getUserInfo();
await api.setAgentStatus(userInfo.id, 'Away', {
  id: 'lunch',
  name: 'Lunch Break'
});

getAvayaJwt()

getAvayaJwt(options: {
  authorizationEndpoint?: string;
  tokenEndpoint?: string;
  clientId?: string;
  scopes?: string[];
  redirectUri?: string;
  popupOptions?: PopupOptions;
  forceRefresh?: boolean;
}): Promise<string>;

Get Avaya JWT token with multi-level request deduplication and automatic refresh

  • Returns cached token from localStorage if available and not expired
  • Automatically refreshes token if expired (using refresh token)
  • Prevents duplicate concurrent fetch requests (instance-level)
  • Prevents duplicate OAuth popups across iframes/elements (cross-iframe coordination)
  • Initiates Keycloak OAuth flow if no token exists

Cross-iframe coordination ensures that if 10 iframes all call getAvayaJwt(),
only ONE OAuth popup will appear, and all iframes will receive the same token.

Uses the existing inter-element BroadcastChannel for coordination (consistent with other APIs)

GUARANTEE: This function ALWAYS either returns a JWT string or throws an error.
There are no code paths that return undefined or hang indefinitely.

Parameters
ParameterTypeDescription
options{ authorizationEndpoint?: string; tokenEndpoint?: string; clientId?: string; scopes?: string[]; redirectUri?: string; popupOptions?: PopupOptions; forceRefresh?: boolean; }Configuration options (all optional, uses defaults if not provided)
options.authorizationEndpoint?stringKeycloak authorization endpoint URL
options.tokenEndpoint?stringKeycloak token endpoint URL
options.clientId?stringOAuth client ID
options.scopes?string[]OAuth scopes to request
options.redirectUri?stringOAuth redirect URI (URL to redirect.html)
options.popupOptions?PopupOptionsPopup window size/position (defaults to 500x600)
options.forceRefresh?booleanForce token refresh even if not expired (defaults to false)
Returns

Promise<string>

Promise The JWT token (never returns undefined, always throws on error)

Example
// Use defaults
const jwt = await api.getAvayaJwt();

// With configuration
const jwt = await api.getAvayaJwt({
  authorizationEndpoint: 'https://keycloak.example.com/auth/realms/xxx/protocol/openid-connect/auth',
  tokenEndpoint: 'https://keycloak.example.com/auth/realms/xxx/protocol/openid-connect/token',
  clientId: 'my-client-id',
  redirectUri: 'https://myapp.com/redirect.html',
  forceRefresh: true
});

refreshToken()

refreshToken(options: {
  tokenEndpoint?: string;
  clientId?: string;
}): Promise<string>;

Refresh the access token using the stored refresh token

Parameters
ParameterTypeDescription
options{ tokenEndpoint?: string; clientId?: string; }Configuration options
options.tokenEndpoint?stringKeycloak token endpoint URL (required)
options.clientId?stringOAuth client ID (required)
Returns

Promise<string>

Promise The new JWT access token

Throws

Error if refresh token is not available or refresh fails

Example
try {
  const newJwt = await api.refreshToken({
    tokenEndpoint: 'https://keycloak.example.com/auth/realms/xxx/protocol/openid-connect/token',
    clientId: 'my-client-id'
  });
  console.log('Token refreshed successfully');
} catch (error) {
  console.error('Token refresh failed:', error);
  // May need to re-authenticate
}

clearAvayaJwt()

clearAvayaJwt(): void;

Clear the cached JWT token and force re-authentication on next getAvayaJwt call

Returns

void

Example
api.clearAvayaJwt();
const newJwt = await api.getAvayaJwt(); // Will trigger OAuth flow

Admin API Family

getUsers()

getUsers(params?: {
  interactionId?: string;
  filter?: string;
}): Promise<GetUsersResponse[]>;

Get a list of users in Infinity

Returns users available for transfer or consult operations. Returns up to 100 users.

  • App Level (sidebar widgets): Provide interactionId parameter
  • Interaction Level (interaction widgets): Omit interactionId, uses interaction context automatically
Parameters
ParameterTypeDescription
params?{ interactionId?: string; filter?: string; }Optional parameters
params.interactionId?stringRequired for app-level widgets, optional for interaction-level widgets
params.filter?stringOptional substring search against user name fields
Returns

Promise<GetUsersResponse[]>

Promise resolving to array of user information

Examples
const users = await api.getUsers();
users.forEach(user => {
  console.log(`${user.fullName} - ${user.cxStatus.status} - ${user.presence}`);
});
const users = await api.getUsers({ filter: 'john' });
console.log('Found users:', users.map(u => u.fullName));
const users = await api.getUsers({ interactionId: 'int-123' });
users.forEach(user => {
  console.log(`${user.fullName} - ${user.cxStatus.status} - ${user.presence}`);
});
const users = await api.getUsers({
  interactionId: 'int-123',
  filter: 'john'
});
const users = await api.getUsers({ filter: searchInput });
const eligibleUsers = users.filter(u => u.eligible);
eligibleUsers.forEach(user => {
  console.log(`${user.fullName} (${user.extension}) - ${user.cxStatus.status}`);
});

getUserQueues()

getUserQueues(params?: {
  filter?: string;
}): Promise<UserQueueInfo[]>;

Get all queues available to the current user (App Level)

Returns a basic list of queues the agent has access to.

Parameters
ParameterTypeDescription
params?{ filter?: string; }Optional filter parameters
params.filter?string-
Returns

Promise<UserQueueInfo[]>

Promise resolving to array of user queue information

Example
const queues = await api.getUserQueues();
console.log('Available queues:', queues.map(q => q.name));

// With filter
const salesQueues = await api.getUserQueues({ filter: 'Sales' });

getTransferQueues()

getTransferQueues(params: {
  interactionId: string;
  filter?: string;
}): Promise<InteractionQueueInfo[]>;

Get transfer queues with real-time statistics (App Level)

Returns detailed queue information including waiting interactions, active agents,
and average wait times. Requires explicit interactionId since this is used at app level
where interaction context is not available.

Parameters
ParameterTypeDescription
params{ interactionId: string; filter?: string; }Required interactionId and optional filter parameters
params.interactionIdstring-
params.filter?string-
Returns

Promise<InteractionQueueInfo[]>

Promise resolving to array of queue information with statistics

Example
const queues = await api.getTransferQueues({
  interactionId: 'int-123',
  filter: 'support'
});
queues.forEach(queue => {
  console.log(`${queue.name}: ${queue.waitingInteractions} waiting`);
  console.log(`Active agents: ${queue.countActiveAgents}`);
});

getTransferQueuesInteraction()

getTransferQueuesInteraction(params?: {
  filter?: string;
}): Promise<InteractionQueueInfo[]>;

Get transfer queues with real-time statistics (Interaction Level)

Returns detailed queue information including waiting interactions, active agents,
and average wait times. Uses interaction context automatically.

Parameters
ParameterTypeDescription
params?{ filter?: string; }Optional filter parameters
params.filter?string-
Returns

Promise<InteractionQueueInfo[]>

Promise resolving to array of queue information with statistics

Example
const queues = await api.getTransferQueuesInteraction({ filter: 'support' });
queues.forEach(queue => {
  console.log(`${queue.name}: ${queue.waitingInteractions} waiting`);
  console.log(`Active agents: ${queue.countActiveAgents}`);
});

getReasonCodes()

getReasonCodes(params?: GetReasonCodesParams): Promise<GetReasonCodesResponse>;

Get reason codes for agent status changes

Returns available reason codes that can be used when changing agent status.

Parameters
ParameterTypeDescription
params?GetReasonCodesParamsOptional parameters
Returns

Promise<GetReasonCodesResponse>

Promise resolving to reason codes response

Examples
const response = await api.getReasonCodes();
console.log('Reason codes:', response.reasons);
const response = await api.getReasonCodes({ type: 'away' });
const awayReasons = response.reasons;

Inter-Element Communication

sendInterElementMessage()

sendInterElementMessage<T>(message: T): void;

Send a message to other elements via the inter-element BroadcastChannel

Type Parameters
Type ParameterDescription
TThe type of the message
Parameters
ParameterTypeDescription
messageTThe message to send (can be any serializable type)
Returns

void

onInterElementMessage()

onInterElementMessage<T>(callback: (message: T) => void): () => void;

Subscribe to messages from other elements via the inter-element BroadcastChannel
This is the easiest way to listen for messages - just provide a callback function

Type Parameters
Type ParameterDescription
TThe expected type of messages
Parameters
ParameterTypeDescription
callback(message: T) => voidFunction called when a message is received
Returns

Unsubscribe function to stop listening

(): void;
Returns

void

Example
const unsubscribe = api.onInterElementMessage<MyMessageType>((message) => {
  console.log('Received:', message);
});

// Later, stop listening
unsubscribe();

Events

onError()

onError(callback: ErrorCallback): () => void;

Subscribe to error events

Fires when an error occurs in the API

Parameters
ParameterTypeDescription
callbackErrorCallbackFunction to call when an error occurs
Returns

Unsubscribe function

(): void;
Returns

void

Example
api.onError((error) => {
  console.error('API Error:', error.code, error.message);
  // Display error notification to user
});

Lifecycle

destroy()

destroy(): void;

Clean up resources when the React component is unmounted or no longer needed

Removes all event listeners, closes channels, and clears pending requests.
Call this method in your React component's cleanup/unmount lifecycle.

Returns

void

Example
// In a React component
useEffect(() => {
  const api = new ElementAPI();
  return () => {
    api.destroy(); // Cleanup on unmount
  };
}, []);

Enumerations

DialpadDigit

DTMF dialpad digits (0-9) for sending tones during calls

Example
import { DialpadDigit } from '@avaya/infinity-elements-api';

await api.sendDialpadDigit(DialpadDigit.Five, null, false);

Functions

setupOAuthCallbackHandler()

function setupOAuthCallbackHandler(): void;

Setup OAuth callback handler - call once at app initialization

Sets up listener for redirect.html config requests

Returns

void


refreshAccessToken()

function refreshAccessToken(
   refreshToken: string, 
   tokenEndpoint: string, 
clientId: string): Promise<TokenResponse>;

Refresh an expired access token using the refresh token

Elements run in sandboxed iframes (about:srcdoc) which have origin "null".
Direct fetch to Keycloak fails due to CORS.

This function delegates the refresh request to the host (agent-ui) via
postMessage. The host has a proper origin and can make the request
without CORS issues. This is completely silent - no popups or visible UI.

Parameters
ParameterTypeDescription
refreshTokenstringThe refresh token to use
tokenEndpointstringThe token endpoint URL
clientIdstringThe OAuth client ID
Returns

Promise<TokenResponse>


getStoredTokenData()

function getStoredTokenData(jwtStorageKey: string): StoredTokenData | null;

Get stored token data from localStorage

Parameters
ParameterType
jwtStorageKeystring
Returns

StoredTokenData | null


isTokenExpired()

function isTokenExpired(tokenData: StoredTokenData): boolean;

Check if a token is expired

Parameters
ParameterType
tokenDataStoredTokenData
Returns

boolean


isRefreshTokenExpired()

function isRefreshTokenExpired(tokenData: StoredTokenData): boolean;

Check if refresh token is expired

Parameters
ParameterType
tokenDataStoredTokenData
Returns

boolean

Interfaces

InteractionInfo

Properties

PropertyType
idstring
interactionIdstring
statusstring
commType?string
direction?string
customer?{ name?: string; number?: string; id?: string; }
customer.name?string
customer.number?string
customer.id?string
startTime?string
duration?number
metadata?Record<string, unknown>

InteractionUpdatePayload

Properties

PropertyType
idstring
status?string
commType?string
subCommType?string
isAudio?boolean
isHold?boolean
isMute?boolean
details?{ notes?: string; subject?: string; }
details.notes?string
details.subject?string
sourceDetails?{ phoneNumber?: string; email?: string; name?: string; }
sourceDetails.phoneNumber?string
sourceDetails.email?string
sourceDetails.name?string

BlindTransferOptions

Properties

PropertyType
interactionIdstring
transferTostring
transferToNamestring
transferCallerIdType?string

SingleStepTransferParams

Properties

PropertyType
targetIdstring
targetNamestring

CreateVoiceInteractionParams

Properties

PropertyType
phoneNumberstring
queueIdstring

SendRichMediaMessageOptions

Properties

PropertyType
name?string
mediaUrl?string
file?File
text?string

SendChatMessageOptions

Properties

PropertyTypeDescription
interactionIdstringRequired interaction ID
text?stringOptional message text
mediaUrl?stringOptional media URL (image, file, etc.)
file?FileOptional file to upload
fileName?stringOptional file name for the message/file

ConsultCallOptions

Properties

PropertyTypeDescription
interactionIdstring-
transferTo?stringUser ID or handle to consult with (internal user/agent)
phoneNumber?stringPhone number to consult with (external number)
queueId?stringQueue ID to consult to. Can be obtained via getTransferQueuesInteraction

AgentStatus

Properties

PropertyType
idstring
namestring
categorystring

ReasonCode

Properties

PropertyType
idstring
reasonstring
type"away" | "busy" | "available" | "queueLogout"
typeDisplaystring
eliteAuxCode?number
isDisabledboolean
isSystemCode?boolean
createdAtstring
createdBystring
updatedAtstring | null
updatedBystring | null
inWorkflowIdstring | null
inWorkflowVersionIdstring | null
outWorkflowIdstring | null
outWorkflowVersionIdstring | null
queryFieldIdstring | null

GetReasonCodesParams

Properties

PropertyType
type?"away" | "busy" | "available" | "queueLogout" | null

GetReasonCodesResponse

Properties

PropertyType
reasonsReasonCode[]

GetUserInteractionsParams

Properties

PropertyType
userId?string
details?boolean

QueueLoggedIn

Properties

PropertyType
queueIdstring
namestring
queueWeightnumber
timeZonestring
extensionnumber | null
createdOnstring
createdOnUnixnumber

QueueAccess

Properties

PropertyType
queueIdstring
namestring
queueWeightnumber
timeZonestring
extensionnumber | null

UserInteractionsUser

Properties

PropertyType
idstring
firstNamestring
lastNamestring
fullNamestring
titlestring | null
emailstring
extensionstring | null

GetUserInteractionsResponse

Properties

PropertyType
interactionsInteraction[]
viewingInteraction[]
combinedIds?string[]
queue{ loggedIn: QueueLoggedIn[]; access: QueueAccess[]; }
queue.loggedInQueueLoggedIn[]
queue.accessQueueAccess[]
userUserInteractionsUser

ElementAPIOptions

Configuration options for ElementAPI initialization

Properties

PropertyTypeDescription
elementId?stringUnique identifier for this element instance (auto-generated if not provided)
timeout?numberAPI request timeout in milliseconds (default: 5000)
debug?booleanEnable debug logging to console (default: false)

InteractionQueueInfo

Properties

PropertyType
idstring
namestring
extensionstring | null
waitingInteractionsnumber
countOfCallbacksnumber
countActiveAgentsnumber
totalCurrentInteractionsnumber
connectedInteractionsnumber
avgInteractionWaitTimenumber
weightnumber
eligibleboolean

UserQueueInfo

Properties

PropertyType
idstring
namestring

KeycloakConfig

Keycloak OAuth 2.0 PKCE Authentication Module

Supports cross-iframe coordination to prevent multiple OAuth popups

Uses postMessage-based config exchange with redirect.html:

  1. Component opens popup directly
  2. redirect.html requests config via postMessage
  3. Component responds with config + code verifier
  4. redirect.html performs token exchange
  5. redirect.html sends token back to component

No localStorage bridging needed - config stays in memory.

Properties

PropertyTypeDescription
authorizationEndpoint?string-
tokenEndpoint?string-
clientId?string-
scopes?string[]-
redirectUri?stringURL to redirect.html - used for OAuth callback and token refresh

PopupOptions

Properties

PropertyType
width?number
height?number
left?number
top?number

TokenResponse

Properties

PropertyType
access_tokenstring
refresh_token?string
expires_in?number
refresh_expires_in?number
token_type?string
id_token?string

StoredTokenData

Properties

PropertyType
accessTokenstring
refreshToken?string
expiresAt?number
refreshExpiresAt?number

GetUsersResponse

Response from getUsers API
Used for transfer/consult target selection

Properties

PropertyTypeDescription
idstringHandle / internal user ID
firstNamestringFirst name
lastNamestringLast name
fullNamestringFull name
emailstringEmail address
mobilestring | nullMobile phone number
presencestring | nullVoIP/presence status (e.g., "available", "busy", "offline")
cxStatus{ statusType: string; status: string; }CX status information
cxStatus.statusTypestringCX status category (e.g., "available", "busy", "away")
cxStatus.statusstringCX status display name (e.g., "Available", "On Call", "Lunch")
extensionstring | nullExtension number
eligiblebooleanWhether user is eligible for transfer

UserLocation

Properties

PropertyType
addressData?{ address1: string; address2: string; city: string; state: string; country: string; postalCode: string; locationName: string; }
addressData.address1string
addressData.address2string
addressData.citystring
addressData.statestring
addressData.countrystring
addressData.postalCodestring
addressData.locationNamestring
locationIdstring
e911Numberstring
isE911string | boolean
e911CallerIdNumber?string | null

QueueInfo

Properties

PropertyType
queueIdstring
namestring
isAccessboolean
isAutoLoginboolean
proficiency?unknown

UserTag

Properties

PropertyType
tagIdstring
backgroundColorstring
colorstring
iconCodestring
namestring

DefaultLeaveEventToStatus

Properties

PropertyType
actionstring
statusstring

InfinityElement

Properties

PropertyType
accountIdstring
apiVersionIdstring
config{ file: { filename: string; mimetype: string; size: number; storageId: string; }; }
config.file{ filename: string; mimetype: string; size: number; storageId: string; }
config.file.filenamestring
config.file.mimetypestring
config.file.sizenumber
config.file.storageIdstring
createdAtstring
createdBystring
folderIdstring | null
iconstring
idstring
namestring
tagNamestring
updatedAtstring
updatedBystring | null
uploadedAtstring | null
uploadedBystring | null

UserInfo

Properties

PropertyTypeDescription
userIdstringUser ID
status?stringWhether the user is enabled (status === 'enabled' for yes)
firstNamestringFirst name
lastNamestringLast name
nameSuffix?string | nullName suffix (e.g., Jr., Sr., III)
titlestringJob title
emailstringEmail address
mobile?string | nullMobile phone number
languageCode?stringLanguage code (e.g., 'en', 'es')
location?UserLocation | nullE911 location information
timezone?stringTimezone (e.g., 'America/New_York')
licenseType?stringLicense type
consolePermissions?{ account?: Record<"read", string>; api?: Record<"read", string>; callRecordings?: Record<"delete", string>; cx?: Record<"read", string>; mL?: Record<"read", string>; numbers?: Record<"read", string>; objects?: Record<"read", string>; portal?: Record<"console-web", string>; queues?: Record<"read", string>; }Console permissions
consolePermissions.account?Record<"read", string>-
consolePermissions.api?Record<"read", string>-
consolePermissions.callRecordings?Record<"delete", string>-
consolePermissions.cx?Record<"read", string>-
consolePermissions.mL?Record<"read", string>-
consolePermissions.numbers?Record<"read", string>-
consolePermissions.objects?Record<"read", string>-
consolePermissions.portal?Record<"console-web", string>-
consolePermissions.queues?Record<"read", string>-
appPermissions?{ agent?: Record<"read", string>; analytics?: Record<"read", string>; chat?: Record<"read" | "admin", string>; coaching?: Record<"read", string>; contacts?: Record<"read", string>; workflowReplay?: Record<"read", string>; dashboards?: Record<"read", string>; portal?: { app-android: string; app-ios: string; app-osx: string; app-web: string; app-win: string; app-support-access: string; }; queueList?: Record<"read", string>; queueToggling?: Record<"read", string>; teamview?: Record<"read", string>; ucFax?: Record<"read", string>; outreachmonitor?: Record<"read", string>; }Application permissions
appPermissions.agent?Record<"read", string>-
appPermissions.analytics?Record<"read", string>-
appPermissions.chat?Record<"read" | "admin", string>-
appPermissions.coaching?Record<"read", string>-
appPermissions.contacts?Record<"read", string>-
appPermissions.workflowReplay?Record<"read", string>-
appPermissions.dashboards?Record<"read", string>-
appPermissions.portal?{ app-android: string; app-ios: string; app-osx: string; app-web: string; app-win: string; app-support-access: string; }-
appPermissions.portal.app-androidstring-
appPermissions.portal.app-iosstring-
appPermissions.portal.app-osxstring-
appPermissions.portal.app-webstring-
appPermissions.portal.app-winstring-
appPermissions.portal.app-support-accessstring-
appPermissions.queueList?Record<"read", string>-
appPermissions.queueToggling?Record<"read", string>-
appPermissions.teamview?Record<"read", string>-
appPermissions.ucFax?Record<"read", string>-
appPermissions.outreachmonitor?Record<"read", string>-
outboundPermissions?{ task: "0" | "1"; email: "0" | "1"; phone: "0" | "1"; messaging: "0" | "1"; }Outbound permissions by communication type
outboundPermissions.task"0" | "1"-
outboundPermissions.email"0" | "1"-
outboundPermissions.phone"0" | "1"-
outboundPermissions.messaging"0" | "1"-
rejectInteractions?booleanInbound permissions - can reject interactions
monitoringAction?stringMonitoring action configuration
completedAction?stringCompleted action configuration
interactionViewsType?stringInteraction view type
modifyInteractionViews?booleanCan create/edit interaction views
tags?UserTag[]List of assigned tags
personalQueueId?stringPersonal queue ID
defaultOutboundQueue?stringDefault outbound queue name
outboundActionAndStatus?DefaultLeaveEventToStatusOutbound call action and status
inboundActionAndStatus?DefaultLeaveEventToStatusInbound call action and status
callbackActionAndStatus?DefaultLeaveEventToStatusCallback action and status
voicemailActionAndStatus?DefaultLeaveEventToStatusVoicemail action and status
queues?QueueInfo[]List of assigned queues with access, auto-login, and proficiency info
phoneSpaces?numberNumber of concurrent phone interactions allowed
messagingSpaces?numberNumber of concurrent messaging interactions allowed
emailSpaces?numberNumber of concurrent email interactions allowed
taskSpaces?numberNumber of concurrent task interactions allowed
eliteExtension?string | nullElite Agent Extension
eliteAgentId?string | nullElite Agent ID
eliteSipAddress?string | nullSIP Address
eliteSbcGroupId?string | nullSBC Group ID
crmConfigurations?unknownCRM Configuration object
infinityElements?InfinityElement[]App-level Infinity Elements assigned
authToken?stringAuthentication token (JWT) using accessToken

Type Aliases

CHANNEL_NAMES

type CHANNEL_NAMES = {
  INTERACTION_STATUS_CHANGED: "interaction-status-changed";
  INTERACTION_ENDED: "on-interaction-ended";
  INTERACTION_ACCEPTED: "on-interaction-accepted";
  INTERACTION_UPDATED: "on-interaction-updated";
  CONSULT_STATUS_CHANGED: "consult-status-changed";
  FEED_MESSAGE: "feed-message";
  INTER_ELEMENT: "inter-element";
};

Properties

PropertyModifierTypeDefault value
INTERACTION_STATUS_CHANGEDreadonly"interaction-status-changed""interaction-status-changed"
INTERACTION_ENDEDreadonly"on-interaction-ended""on-interaction-ended"
INTERACTION_ACCEPTEDreadonly"on-interaction-accepted""on-interaction-accepted"
INTERACTION_UPDATEDreadonly"on-interaction-updated""on-interaction-updated"
CONSULT_STATUS_CHANGEDreadonly"consult-status-changed""consult-status-changed"
FEED_MESSAGEreadonly"feed-message""feed-message"
INTER_ELEMENTreadonly"inter-element""inter-element"

InteractionStatusChangedCallback()

type InteractionStatusChangedCallback = (payload: {
  interactionId: string;
  status: string;
}) => void;
Parameters
ParameterType
payload{ interactionId: string; status: string; }
payload.interactionIdstring
payload.statusstring
Returns

void


InteractionEndedCallback()

type InteractionEndedCallback = (interactionId: string) => void;
Parameters
ParameterType
interactionIdstring
Returns

void


InteractionAcceptedCallback()

type InteractionAcceptedCallback = (interactionId: string) => void;
Parameters
ParameterType
interactionIdstring
Returns

void


InteractionUpdatedCallback()

type InteractionUpdatedCallback = (payload: {
  interactionId: string;
  event: "interaction.update";
  payload: Interaction;
}) => void;
Parameters
ParameterType
payload{ interactionId: string; event: "interaction.update"; payload: Interaction; }
payload.interactionIdstring
payload.event"interaction.update"
payload.payloadInteraction
Returns

void


ConsultStatusChangedCallback()

type ConsultStatusChangedCallback = (payload: {
  interactionId: string;
  consultStatus: string;
  consultParty?: string;
  error?: string;
}) => void;
Parameters
ParameterType
payload{ interactionId: string; consultStatus: string; consultParty?: string; error?: string; }
payload.interactionIdstring
payload.consultStatusstring
payload.consultParty?string
payload.error?string
Returns

void


FeedMessageCallback()

type FeedMessageCallback = (message: Message) => void;
Parameters
ParameterType
messageMessage
Returns

void


ErrorCallback()

type ErrorCallback = (error: {
  code: string;
  message: string;
  details?: unknown;
}) => void;
Parameters
ParameterType
error{ code: string; message: string; details?: unknown; }
error.codestring
error.messagestring
error.details?unknown
Returns

void

Variables

VERSION