CreateBlogSupport
Log inSign up
Home
Webex Contact Center
  • Overview
  • Guides
  • API REFERENCE
  • AI
  • Configuration
  • Data
  • Desktop
  • Journey
  • Media And Routing
  • Changelog
  • SDK
  • Customer Journey Data Service
  • AI Assistant for Developers
  • Webhooks
  • Contact Center Sandbox
  • Using Webhooks
  • Troubleshoot the API
  • Beta Program
  • Webex Status API
  • Contact Center Service Apps
  • FAQs

Webex Contact Center

Authentication

This guide covers authentication; session registration and cleanup; agent station login and logout; automatic relogin; multi-login behavior; and agent state management in the Contact Center SDK.

Note: For single-session apps, you can rely on method promises alone, subscribe to events mainly for multi-session support (for example, handling more than one active session).


anchorPrerequisites

anchor
  • A Webex access token (via OAuth or an access token string).
  • Initialize the SDK with your token using Webex.init() as mentioned in the Quickstart Guide.

Optionally, you can control Contact Center plugin behavior via configuration flags:

  • allowMultiLogin (default: true)
  • allowAutomatedRelogin (opt-in)

anchorSession Registration and Cleanup

anchor
Register

Establishes the connection to Contact Center services and fetches the agent profile.

await webex.cc.register();
Request Parameters

None.

Response Payload
keydescription
agentIdUnique identifier for the agent.
agentNameDisplay name of the agent.
teamsArray of teams the agent belongs to. Each item includes at least id and name.
defaultDnDefault directory number configured for the agent.
dnCurrent directory number assigned to the agent (may be empty if not applicable).
webRtcEnabledWhether browser-based calling (BROWSER) is enabled for the agent.
loginVoiceOptionsAllowed login device types for the agent. Values may include BROWSER, EXTENSION, AGENT_DN.
wrapupCodesArray of wrap-up codes available to the agent. Each item includes id and name.
idleCodesArray of idle (aux) codes available to the agent. Each item includes id, name, and isSystem.
lastStateAuxCodeIdAux code id associated with the agent’s last state.
lastStateChangeTimestampISO timestamp of the last agent state change.
lastIdleCodeChangeTimestampISO timestamp of the last aux code change.
outDialEpEntry point id to use for outdial.
isAgentLoggedInWhether the agent is already logged in on a station.

Note: If allowAutomatedRelogin is enabled at init, the SDK can perform an automatic relogin when needed.


Deregister

Closes sockets, removes listeners, and clears cached agent configuration.

await webex.cc.deregister();
Request Parameters

None.

Response Payload

None. The operation completes when resources are released.

Note: This does NOT perform a station logout. If you want the agent to log out, call the stationLogout() method first.


anchorAgent Login

anchor

Use stationLogin to log the agent into a specific device type:

await webex.cc.stationLogin({
  teamId: '<TEAM_ID>',
  loginOption: 'BROWSER' | 'EXTENSION' | 'AGENT_DN',
  dialNumber: '<DN-OR-EXT>' // required for EXTENSION and AGENT_DN; ignored for BROWSER
});
Request Parameters
keytyperequireddescription
teamIdstringyesTeam id to log the agent into. Typically taken from the profile returned by register().
loginOptionstringyesDevice type to use. One of BROWSER, EXTENSION, AGENT_DN.
dialNumberstringconditionalRequired for EXTENSION and AGENT_DN; ignored for BROWSER.

Behavioral details:

  • For loginOption: 'AGENT_DN', the SDK validates the dial number. If invalid, the promise rejects with an error indicating INVALID_DIAL_NUMBER.
Response Payload

On success, the resolved data includes a media profile summary and login details.

keydescription
deviceTypeThe device type used for the login (BROWSER, EXTENSION, or AGENT_DN).
dnThe directory number used/assigned for the session (if applicable).
auxCodeIdAux code id applied at login time (defaults to 0 in many deployments).
lastStateChangeTimestampISO timestamp of the last agent state change.
lastIdleCodeChangeTimestampISO timestamp of the last aux code change.
mmProfileMedia profile summary for the session (object).
Success & Failure events
webex.cc.on('agent:stationLoginSuccess', (data) => {
  // Update UI with deviceType, dn, auxCodeId, timestamps, etc.
});

webex.cc.on('agent:stationLoginFailed', (error) => {
  // Inspect error for input validation or other failures (e.g., error.data.fieldName, error.data.message)
});

anchorAgent Logout

anchor
await webex.cc.stationLogout({ logoutReason: 'logout' });
Request Parameters
keytyperequireddescription
logoutReasonstringnoOptional free-text or enumerated reason. Common value: logout.
Response Payload

None. The operation completes when the station is logged out.

Success & Failure events
webex.cc.on('agent:logoutSuccess', () => {
  // Station logout completed; update UI state
});

webex.cc.on('agent:logoutFailed', (error) => {
  // Handle failure
});

anchorAgent State: Available and Idle (Aux Codes)

anchor

Change the agent state using setAgentState:

await webex.cc.setAgentState({
  state: 'Available' | 'Idle',
  auxCodeId: '<AUX_CODE_ID>',
  lastStateChangeReason: '<FREE_TEXT_REASON>',
});
Request Parameters
keytyperequireddescription
statestringyesTarget state. One of Available or Idle.
auxCodeIdstringconditionalRequired when state is Idle; commonly '0' represents Available.
lastStateChangeReasonstringnoOptional free-text reason to accompany the change.
agentIdstringnoOptional; when provided, targets a specific agent id. Defaults to the current agent.
Response Payload

None. Use events to react to the resulting state.

Success & Failure events
webex.cc.on('agent:stateChangeSuccess', (data) => {
  // Make UI changes as per auxCodeId and timestamps
});

webex.cc.on('agent:stateChangeFailed', (error) => {
  // Handle failure
});

anchorRelogin (Silent Relogin)

anchor

When allowAutomatedRelogin is enabled during Webex.init, the SDK can automatically relogin if the agent already has an active session.

Request Parameters

None (automatic behavior).

Response Payload

Delivered via the success event payload.

keydescription
deviceTypeThe device type the agent is logged into (BROWSER, EXTENSION, or AGENT_DN).
dnThe directory number used/assigned for the session (if applicable).
auxCodeIdAux code id applied to the agent at the time of relogin.
lastStateChangeTimestampISO timestamp of the last agent state change.
lastIdleCodeChangeTimestampISO timestamp of the last aux code change.
Success event
webex.cc.on('agent:reloginSuccess', (data) => {
  // Automatic relogin completed; update UI (deviceType, dn, aux code, timestamps)
});

anchorMulti-Login Behavior

anchor

The plugin supports a multi-login flag:

  • allowMultiLogin (default: false)

If another session is detected for the same agent and the allowMultiLogin flag is false, the SDK emits:

  • agent:multiLogin

The consuming application can use this event to prompt the user to close one of the sessions or to take other appropriate action -

webex.cc.on('agent:multiLogin', (data) => {
  // Another session detected; prompt the user or close one session
});

anchorPutting It Together: Minimal Flow

anchor
// 1) Initialize Webex with token and (optionally) CC plugin flags
const webex = Webex.init({
  config: {
    cc: { allowAutomatedRelogin: true, allowMultiLogin: true },
  },
  credentials: { access_token: token }
});

// 2) Register
const profile = await webex.cc.register();

// 3) Login (choose device type)
await webex.cc.stationLogin({
  teamId: profile.teams[0].id || profile.teams[0].teamId, // use the appropriate team identifier from the profile
  loginOption: 'BROWSER',
  dialNumber: ''
});

// 4) Set state to Available (auxCodeId '0' is a common default)
await webex.cc.setAgentState({ state: 'Available', auxCodeId: '0', lastStateChangeReason: 'Manual' });

// 5) Later: Logout and/or Deregister
await webex.cc.stationLogout({ logoutReason: 'logout' });
await webex.cc.deregister();

anchorEvents to handle

anchor

From the SDK emissions:

  • As mentioned before, in single-session flows, these events are not required; you can rely on the resolved/rejected promises of the API calls.

  • agent:stationLoginSuccess: Fired after successful station login.

  • agent:stationLoginFailed: Fired if station login fails.

  • agent:logoutSuccess: Fired after successful station logout.

  • agent:logoutFailed: Fired if station logout fails.

  • agent:stateChange: Fired for generic agent state change notifications.

  • agent:stateChangeSuccess: Fired when state change succeeds.

  • agent:stateChangeFailed: Fired when state change fails.

  • agent:reloginSuccess: Fired after an automatic relogin completes (when enabled).

  • agent:multiLogin: Fired when multiple logins are detected for the same agent.

In This Article
  • Prerequisites
  • Session Registration and Cleanup
  • Agent Login
  • Agent Logout
  • Agent State: Available and Idle (Aux Codes)
  • Relogin (Silent Relogin)
  • Multi-Login Behavior
  • Putting It Together: Minimal Flow
  • Events to handle

Connect

Support

Developer Community

Developer Events

Contact Sales

Handy Links

Webex Ambassadors

Webex App Hub

Resources

Open Source Bot Starter Kits

Download Webex

DevNet Learning Labs

Terms of Service

Privacy Policy

Cookie Policy

Trademarks

© 2025 Cisco and/or its affiliates. All rights reserved.