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

    A reason code representing an agent status or queue logout reason.

    Each ReasonCode has a type (a ReasonType value such as AVAILABLE or AWAY) that identifies the availability state, and an optional reason string that holds the human-readable label configured for that status in your contact center.

    Reason codes are fetched from the platform via User.getAssignableReasonCodes and are passed directly to User.changeStatus to update the agent's status.

    // Fetch all available status options and build a simple picker
    const reasons = await user.getAssignableReasonCodes();

    reasons.forEach(r => {
    console.log(`${r.type}: ${r.reason ?? '(no label)'}`);
    // e.g. "available: Ready"
    // "away: On Break"
    // "busy: In a Meeting"
    });
    // Apply the first "away" status to put the agent on break
    const onBreak = reasons.find(r => r.type === ReasonType.AWAY);
    if (onBreak) {
    await user.changeStatus(onBreak);
    }
    type ReasonCode = {
        type: ReasonType;
        reason?: string;
        eliteAuxCode?: string;
    }
    Index

    Properties

    The availability state this reason represents

    reason?: string

    The display text or description of the reason. Optional for status changes where only the type is required.

    eliteAuxCode?: string

    Elite PBX auxiliary code associated with this reason.

    Present only for reasons configured with an Elite PBX mapping (typically away or busy reasons used by hybrid/Elite agents).

    The SDK already filters away/busy reasons without an eliteAuxCode out of User.getAssignableReasonCodes for Elite users, so consumers don't usually have to.

    undefined when the reason has no Elite mapping configured.