@avaya/infinity-agent-sdk - v1.0.0
    Preparing search index...

    A contact center interaction between an agent and a customer.

    Lifecycle

    1. Interaction arrives - currentStatus is PENDING.
    2. Agent calls accept (or reject to decline).
    3. Status transitions to CONNECTED; agent can perform actions on it like mute, hold, transfer, or start a conference.
    4. Agent wraps-up the interaction
    5. Interaction status moves to WRAP_UP; agent records notes and classification codes.
    6. Agent calls close or complete to finalize; status becomes COMPLETED.

    Capability groups

    Group Key members
    Lifecycle accept, reject, disconnectCall, close, complete, extendWrapUp
    Call Controls mute, unmute, holdCall, resumeCall, sendDtmf
    Transfer blindTransfer, attendedTransfer, cancelTransfer, completeTransfer
    Conference conference, cancelConference, completeConference
    Viewer isViewer, getViewers, currentViewingState, joinCall, leaveCall, leave
    Monitoring claimOwnership, barge, unbarge, coach
    Events subscribe, unsubscribe, unsubscribeAll
    Messaging sendMessage, getMessages
    Details setNotes, setSubject, mergeCustomFields, getTransferableUsers, getTransferableQueues
    Classification setClassificationType, setClassificationResult
    Capability Guards canAccept, canReject, canClose, canComplete, canWrapUp, canExtendWrapUp, canResolve, canUnresolve, canDisconnectCall, canMute, canUnmute, canHold, canResume, canSendDtmf, canTransfer, canBlindTransfer, canExternalBlindTransfer, canAttendedTransfer, canExternalAttendedTransfer, canCancelTransfer, canCompleteTransfer, canConference, canCancelConference, canCompleteConference, canSetSubject, canSetNotes, canMergeCustomFields, canSetClassification, canSendMessage, canGetMessages, canJoinCall, canLeaveCall, canLeave, canClaimOwnership, canBarge, canUnbarge, canCoach - each returns false when the action is not permitted in the current state
    Properties currentStatus, interactionId, communicationType, communicationSubType, initialCommunicationType, initialCommunicationSubType, isElite, engagementId, customer, queueDetails, routingDetails, ownerDetails, startTime, endTime, isOwner, isConsultTarget, isMuted, isHold, transferDetails, wrapUpDeadline, subject, notes, customFields, classificationType, classificationResult
    // 1. Subscribe to incoming interactions on the user object
    user.subscribe(UserEventType.INTERACTION_RECEIVED, async ({ payload }) => {
    const interaction = payload.interaction;

    // 2. Accept the call
    await interaction.accept();
    console.log("Accepted interaction:", interaction.interactionId);

    // 3. React to call events
    interaction.subscribe(InteractionEventType.INTERACTION_CALL_DISCONNECTED, () => {
    console.log("Call ended - entering wrap-up");
    });

    interaction.subscribe(InteractionEventType.INTERACTION_WRAP_UP, async () => {
    // 4. Record notes during wrap-up
    await interaction.setNotes("Customer requested a follow-up call next Tuesday");

    // 5. Close as resolved
    await interaction.close(ResolutionStatus.RESOLVED);
    });
    });

    The SDK maintains a single Interaction instance per interaction and mutates its fields in place as state changes — the object reference is stable across updates. Framework consumers (React, Vue, etc.) that rely on reference equality for change detection must therefore trigger their own re-render on each subscribed event — for example by bumping a version counter, re-emitting the enclosing array, or lifting the data into a store that produces a fresh snapshot per event.

    Implements

    Index

    Properties

    • get interactionId(): string

      The platform-assigned unique identifier for this interaction.

      Returns string

    • get isHold(): boolean

      Whether the interaction call is currently on hold.

      Returns boolean

    • get isElite(): boolean

      Whether this interaction is routed through Avaya Elite Voice. Set at interaction creation and does not change during the interaction.

      Returns boolean

    • get engagementId(): string

      Identifier shared by interactions that belong to the same customer journey (e.g. an inbound call and a subsequent callback). Use this to link related interactions in CRM integrations. Stable for the lifetime of the interaction.

      Returns string

    • get endTime(): Date | undefined

      When the interaction finished wrap-up. undefined while the interaction is still active or in wrap-up.

      Returns Date | undefined

    • get isOwner(): boolean

      Whether the current agent is the owner of this interaction.

      Returns boolean

    • get isConsultTarget(): boolean

      Whether the current agent is the consulted agent (transfer target) for an in-progress attended transfer on this interaction. true when the interaction status is ATTENDED_TRANSFER and this agent's userId matches the transfer target.

      Viewers can subscribe to InteractionEventType.INTERACTION_TRANSFER and check this property to detect when an attended transfer is directed at them — the typical response is to prompt the agent to accept from the new pending interaction that the server routes to them.

      Returns boolean

    • get subject(): string

      The subject or title of the interaction.

      Returns string

    • get customFields(): Record<string, unknown>

      Custom key/value data persisted on the interaction.

      Update via mergeCustomFields (it deep-merges; keys not mentioned are preserved).

      Returns Record<string, unknown>

    • get isMuted(): boolean

      Whether the current user's microphone is currently muted on this interaction, regardless of role (owner, attended-transfer consult agent, or viewer).

      Returns boolean

    • get wrapUpDeadline(): number | undefined

      Unix timestamp (seconds) when wrap-up expires. Undefined before the interaction enters wrap-up or if no timer is configured.

      Returns number | undefined

    Call Controls

    • Mutes the current user's microphone for this interaction, regardless of role (owner, attended-transfer consult agent, or viewer). Check canMute before calling. Fires INTERACTION_CALL_MUTED on success.

      Returns Promise<void>

      Promise that resolves when the platform confirms the mute

    • Unmutes the current user's microphone for this interaction, regardless of role (owner, attended-transfer consult agent, or viewer). Check canMute before calling. Fires INTERACTION_CALL_UNMUTED on success.

      Returns Promise<void>

      Promise that resolves when the platform confirms the unmute

    • Sends a dual-tone multi-frequency (DTMF) digit during an active voice interaction. Check canSendDtmf before calling.

      Parameters

      • digit: string

        A single DTMF character: 0–9, *, #, a-d or A-D

      Returns void

    • Places the customer call on hold. The customer then hears hold music. Check canHold before calling. Fires INTERACTION_CALL_HELD on success.

      Returns Promise<void>

      Promise that resolves when the platform confirms the call is on hold

    • Resumes a held customer call, reconnecting the agent to the customer. Check canResume before calling. Fires INTERACTION_CALL_RESUMED on success.

      Returns Promise<void>

      Promise that resolves when the platform confirms the call is resumed

    Capability Guards

    • Returns true when the agent can accept this interaction. Only valid when the interaction is in PENDING or ATTENDED_TRANSFER status.

      Returns boolean

    • Returns true when the agent can close this interaction. Only returns true when the agent is the owner and the interaction is in CONNECTED, HOLD, or ATTENDED_TRANSFER status.

      Returns boolean

    • Returns true when the agent can complete this interaction. Only valid when the agent is the owner and the interaction is in WRAP_UP status.

      Returns boolean

    • Whether the agent can update the subject on this interaction. Only applicable for the owning agent when status is CONNECTED, ATTENDED_TRANSFER, HOLD, or WRAP_UP. Returns false for viewers.

      Returns boolean

    • Returns true when the agent can send a chat message on this interaction. Only valid when the interaction is connected and the agent is the owner or a viewer.

      Returns boolean

    • Returns true when the agent can fetch message history on this interaction. Allowed whenever the agent is the owner or a viewer.

      Returns boolean

    • Returns true when DTMF tones can be sent on this interaction. Only applicable for connected voice interactions where audio is active; not applicable for viewers.

      Returns boolean

    • Returns true when the agent is permitted to reject this interaction.

      Returns boolean

    • Returns true when the current user can mute their own microphone on this interaction right now. Use canUnmute for the inverse direction.

      Returns boolean

    • Returns true when the current user can unmute their own microphone on this interaction right now.

      Returns boolean

    • Returns true when the agent can place this interaction on hold. Only valid when the agent is the owner and the call is connected.

      Returns boolean

    • Returns true when the agent can resume a held interaction. Only valid when the agent is the owner and the call is on hold.

      Returns boolean

    • Returns true when the agent can initiate a blind transfer on this interaction. Only valid when the agent is the owner.

      Returns boolean

    • Returns true when the agent can initiate an attended (consultative) transfer. Only valid when the agent is the owner and the call is connected. Not applicable for a consulted agent in an attended transfer.

      Returns boolean

    • Returns true when the agent can attended transfer to an external phone number. Checks all base attended-transfer conditions plus the external transfer permission on the queue.

      Returns boolean

    • Returns true when the agent can initiate a conference on this interaction. Only valid when the agent is the owner and the call is connected.

      Returns boolean

    • Returns true when the agent can cancel an in-progress attended transfer. Applicable for both the originating agent and the consulted agent, except for transfers to a queue.

      Returns boolean

    • Returns true when the agent can cancel an in-progress conference. Only valid when the agent is the owner and the call is connected.

      Returns boolean

    • Returns true when the agent can disconnect the call to the customer. Only valid when the agent is the owner and the call is connected.

      Returns boolean

    • Returns true when the agent can transfer this interaction (blind or attended). Only valid when the agent is the owner and the call is connected. Not applicable for a consulted agent in an attended transfer.

      Returns boolean

    • Returns true when the agent can perform wrap-up actions (close/complete) on this interaction. Only valid when the agent is the owner and the interaction is in WRAP_UP state.

      Returns boolean

    • Returns true when the agent can extend the wrap-up timer. Checks ownership, wrap-up status, queue configuration, and that at least 5 seconds remain.

      Returns boolean

    • Returns true when the agent can mark this interaction as resolved. Only valid when the agent is the owner and the interaction is in CONNECTED or ATTENDED_TRANSFER state.

      Returns boolean

    • Returns true when the agent can change a resolved interaction back to unresolved. Only valid when the agent is the owner and the call has been disconnected.

      Returns boolean

    • Returns true when the agent can update the notes on this interaction.

      Returns boolean

    • Returns true when the agent can set classification type or result codes on this interaction.

      Returns boolean

    • Returns true when the agent can complete an in-progress attended transfer. Only valid for the owner of the interaction (not the consulted agent).

      Returns boolean

    • Returns true when the agent can complete an in-progress conference. Only valid when the agent is the owner and the call is connected. Not applicable for a consulted agent in an attended transfer.

      Returns boolean

    • Returns true when the current user can leave the call as a viewer.

      Returns boolean

    • Returns true when the current user can join the call as a viewer.

      Returns boolean

    • Returns true when the current user can be leave interaction as a viewer.

      Returns boolean

    • Returns true when the current viewer can claim ownership of this interaction. Evaluates viewer status, interaction status, monitoring permissions, hybrid restrictions, audio state (phone only), and queue access.

      Returns boolean

    Classification

    Conference

    • Initiates a conference by connecting the call into a three-way conversation. Check canConference before calling.

      Returns Promise<void>

      Promise that resolves when the server accepts the conference request

    • Cancels an in-progress conference, dropping the consulted party and returning to the original call. Check canCancelConference before calling.

      Returns Promise<void>

      Promise that resolves when the server confirms the conference is cancelled

    • Completes an in-progress conference. The consulted agent transitions to a viewer role and the customer call continues between the owner and the viewer. Fires INTERACTION_CONFERENCE_COMPLETE on success. Check canCompleteConference before calling.

      Returns Promise<void>

      Promise that resolves when the server confirms the conference is complete

    Details

    • Sets free-text notes on the interaction. Triggers INTERACTION_NOTES_UPDATED on success. Check canSetNotes before calling.

      Parameters

      • notes: string

        The notes text to associate with the interaction

      Returns Promise<void>

      Promise that resolves when the platform confirms the notes are saved

    • Sets the subject on the interaction. Check canSetSubject before calling.

      Parameters

      • subject: string

        The subject text to associate with the interaction

      Returns Promise<void>

      Promise that resolves when the platform confirms the subject is saved

    • Updates custom fields on the interaction. It deep-merges the provided object into the existing customFields record - keys not mentioned are preserved. Check canMergeCustomFields before calling.

      Parameters

      • fields: Record<string, unknown>

        Custom key/value data to merge into the interaction

      Returns Promise<void>

      Promise that resolves when the custom fields are saved

    Events

    Lifecycle

    • Accepts the incoming interaction, transitioning its status from PENDING to CONNECTED.

      Returns Promise<void>

      Promise that resolves when the platform confirms the interaction is accepted

    • Rejects the incoming interaction. Check canReject before calling.

      Returns Promise<void>

      Promise that resolves when the platform confirms the rejection

    • Disconnects the voice call with the customer, triggering the INTERACTION_CALL_DISCONNECTED event and moving the interaction toward wrap-up. Check canDisconnectCall before calling.

      Returns Promise<void>

      Promise that resolves when the platform confirms the call is disconnected

    • Completes and finalizes the interaction without specifying a resolution status. Use close instead when recording a ResolutionStatus.

      Returns Promise<void>

      Promise that resolves when the platform confirms the interaction is completed

    • Extends the wrap-up timer by the configured number of seconds. Resolves when the server confirms the extension Fires INTERACTION_WRAP_UP_EXTENDED with the new deadline on success.

      Returns Promise<void>

      Promise that resolves when the extension is confirmed

    Messaging

    Monitoring

    • Claims ownership of this interaction. The current user must be a viewer. Check canClaimOwnership before calling.

      Returns Promise<void>

      Promise that resolves when the claim request is accepted

    Transfer

    • Cancels an in-progress attended transfer, reconnecting the originating agent to the customer. Check canCancelTransfer before calling.

      Returns Promise<void>

      Promise that resolves when the server confirms the cancellation

    • Completes an in-progress attended transfer, handing the customer call off to the consulted agent. Fires INTERACTION_TRANSFER_COMPLETE on both agents' sessions. Check canCompleteTransfer before calling.

      Returns Promise<void>

      Promise that resolves when the server confirms the transfer is complete

    Viewer

    • Returns true when the current agent is participating as a viewer on this interaction.

      Returns boolean

    • Leaves the call audio as a viewer (stays as viewer but disconnects audio). Check canLeaveCall before calling.

      Returns Promise<void>

      Promise that resolves when the platform confirms the call leave

    • Joins the call audio as a viewer. Check canJoinCall before calling.

      Returns Promise<void>

      Promise that resolves when the platform confirms the call join

    • Removes the current user as a viewer from this interaction. Check canLeave before calling.

      Returns Promise<void>

      Promise that resolves when the platform confirms the removal