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

Tasks

This page documents how to work with tasks using only public SDK methods and events.

It is necessary to listen to all task events only if your application supports multi-session usage (i.e., the same agent is signed in from multiple tabs, windows, or devices). For single-session applications, promise-based method responses are sufficient for most scenarios, and you typically only need to subscribe to a select set of events. The specific events required are indicated in the relevant sections below.

anchorOverview

anchor

Tasks represent customer interactions. Your app typically:

  • Listens for new and existing tasks
  • Renders a task list and a selected task view
  • Accepts or declines inbound tasks
  • Performs channel-appropriate controls (e.g., telephony call controls)
  • Transfers or consults when supported
  • Ends and wraps up tasks
  • Initiates outbound calls (telephony)

anchorReceiving Tasks

anchor

Subscribe to task events from the plugin:

// New inbound tasks
webex.cc.on('task:incoming', (task) => {
  // Add task to your UI and set currentTask
});

// Existing/updated tasks
webex.cc.on('task:hydrate', (task) => {
  // Refresh UI for updated task data
});

// Optional: render task list
const taskList = webex.cc.taskManager.getAllTasks();

anchorSelecting and Handling a Task

anchor

When a task is selected, update the UI and enable/disable controls based on the channel and state. For example, telephony tasks expose voice controls, while digital tasks do not.

anchorResponse Type: TaskResponse

anchor

All task operations resolve to a common response union type:

variantdescription
AgentContactStructured contact update payload containing task/interaction data (e.g., trackingId, agentId, mediaResourceId, interaction, consultMediaResourceId, destAgentId, etc.).
ErrorError object when an operation fails.
voidNo payload for operations that do not return data.

Use per-method sections below to see whether a given call typically returns a payload or void.

AgentContact payload structure

When a task method resolves with an AgentContact, common fields include:

keydescription
interactionIdUnique identifier for the interaction.
trackingIdTracking identifier for diagnostics/telemetry.
agentIdCurrent agent id.
mediaResourceIdMedia resource id for the active leg.
destAgentIdDestination agent id (consult/transfer scenarios).
consultMediaResourceIdMedia resource id used during consult.
interactionFull interaction object (see next section).
reason / reasonCodeReason details when present (e.g., rejections).
Interaction structure

Top-level fields on the interaction object (core subset):

keydescription
interactionIdUnique interaction id.
mediaTypeChannel type (e.g., telephony, chat, email, social).
stateCurrent interaction state.
participantsParticipants map/object.
mainInteractionIdMain interaction id (optional).
mediaMap of media entries keyed by id (see Media entry).
callProcessingDetailsSelected call-processing fields (see below).

Media entry structure (core subset):

keydescription
mediaResourceIdMedia resource id.
mediaTypeMedia channel type.
isHoldWhether media is held.

callProcessingDetails (core subset):

keydescription
QMgrNameQueue Manager name.
virtualTeamNameVirtual team name.
customerNameCustomer’s name.
ani / dnisCaller and dialed numbers (where applicable).
pauseResumeEnabledWhether pause/resume is enabled (optional).
isPausedWhether interaction is paused (optional).
ronaTimeoutRONA timeout (seconds).

anchorAccept Task

anchor
await currentTask.accept();
Request Parameters

No parameters.

Response Payload
  • Telephony (BROWSER): resolves with no payload.
  • Digital (chat, email, social): resolves with a TaskResponse object (includes at least trackingId).
Relevant Task Events
  • task:assigned — Emitted when the task has been successfully accepted.
  • task:media — Emitted for telephony tasks with a remote audio track.

anchorDecline Task

anchor
await currentTask.decline();
Request Parameters

No parameters.

Response Payload
  • Resolves with no payload.
Relevant Task Events
  • task:rejected — Emitted with a reason when a task is rejected/unanswered.

anchorVoice Media (Telephony)

anchor

For telephony tasks, attach remote audio when media is available:

currentTask.on('task:media', (track) => {
  const audioElement = document.getElementById('remote-audio');
  audioElement.srcObject = new MediaStream([track]);
});

anchorTelephony Controls

anchor

Use these controls only for telephony tasks.

Hold Task
await currentTask.hold();
Request Parameters

No parameters.

Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:hold — Emitted when the task is placed on hold.
Resume Task
await currentTask.resume();
Request Parameters

No parameters.

Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:resume — Emitted when the task is resumed from hold.
Mute/Unmute (WebRTC)
await currentTask.toggleMute();
Request Parameters

No parameters.

Response Payload
  • Resolves with no payload.
Pause Recording
await currentTask.pauseRecording();
Request Parameters

No parameters.

Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:recordingPaused
  • task:recordingPauseFailed
Resume Recording
await currentTask.resumeRecording({ autoResumed: false });
Request Parameters
keytyperequireddescription
autoResumedbooleannoSet by caller to indicate automatic resume. Defaults to false.
Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:recordingResumed
  • task:recordingResumeFailed

anchorTransfer (All Channels Where Supported)

anchor

Transfer the active task to an agent or a queue:

await currentTask.transfer({ to: '<DEST_ID>', destinationType: 'AGENT' /* or 'QUEUE' */ });
Request Parameters
keytyperequireddescription
tostringyesDestination id (agent or queue).
destinationTypestringyesOne of AGENT or QUEUE.
Response Payload
  • Resolves with a TaskResponse.

anchorConsult and Consult Transfer (Telephony)

anchor
Start Consult
await currentTask.consult({ to: '<DEST_ID>', destinationType: 'AGENT' /* or 'QUEUE' */ });
Request Parameters
keytyperequireddescription
tostringyesDestination id (agent or queue).
destinationTypestringyesOne of AGENT or QUEUE.
holdParticipantsbooleannoWhether to hold other participants (defaults to true).
Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:consultCreated — When a consult is initiated.
  • task:offerConsult — When a consult offe is received.
  • task:consulting — When the consult is in progress.
  • task:consultAccepted — When an incoming consult is accepted.
  • task:consultQueueFailed — When consult to queue fails.
End Consult
await currentTask.endConsult({ isConsult: true, taskId: currentTask.data?.interactionId /*, queueId */ });
Request Parameters
keytyperequireddescription
isConsultbooleanyesMust be true to indicate consult termination.
taskIdstringyesTask interaction id.
queueIdstringconditionalRequired when ending a queue consult before it is accepted.
Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:consultEnd
  • task:consultQueueCancelled (when queue consult is cancelled)
Consult Transfer
await currentTask.consultTransfer({ to: '<DEST_ID>', destinationType: 'AGENT' /* or 'QUEUE' */ });
Request Parameters
keytyperequireddescription
tostringyesDestination id (agent or queue).
destinationTypestringyesOne of AGENT or QUEUE.
Response Payload
  • Resolves with a TaskResponse.

anchorEnd and Wrap-up

anchor
End Task
await currentTask.end();
Request Parameters

No parameters.

Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:end — Includes wrapUpRequired in task.data to indicate wrap-up necessity.

Subscribe to task:end to determine wrap-up behavior. The event payload includes fields such as wrapUpRequired (when configured). Without this event, your app may not know when to present the wrap-up.

Automatic Wrap-up Timer

Some deployments configure an automatic wrap-up timer. When present, the SDK exposes this via task.autoWrapup after a task ends with wrap-up required.

  • task.autoWrapup.isRunning() — Returns whether the timer is currently active.
  • task.autoWrapup.getTimeLeftSeconds() — Returns remaining seconds before auto wrap-up completes.

Recommended usage (listen to task:end and show a countdown when available):

webex.cc.on('task:end', (task) => {
  if (!task.data?.wrapUpRequired) return;

  const autoWrap = task.autoWrapup;
  if (autoWrap?.isRunning()) {
    const autoWrapupInterval = setInterval(() => {
      // Add UI logic inside the interval
  }, 1000);
  }
});

If you manage task state via selection/hydration, you can also check currentTask.data.wrapUpRequired and currentTask.autoWrapup in your UI update routine to start/stop the timer when entering wrap-up.

Wrap-up Task
await currentTask.wrapup({ wrapUpReason: '<REASON>', auxCodeId: '<CODE_ID>' });
Request Parameters
keytyperequireddescription
auxCodeIdstringyesRequired wrap-up code id.
wrapUpReasonstringyesRequired human-readable wrap-up reason.
Response Payload
  • Resolves with a TaskResponse.
Relevant Task Events
  • task:wrappedup

anchorOutbound Dialing (Telephony)

anchor
await webex.cc.startOutdial('<E164_OR_VALID_NUMBER>'); // E164 is an International Standard of Telephone numbers
Request Parameters
keytyperequireddescription
destinationstringyesPhone number to dial (prefer E.164).
Response Payload
  • Resolves with a TaskResponse (includes identifiers like interactionId).

Ensure the agent is allowed to outdial and in the correct state.

anchorDestination Lists for Transfer/Consult

anchor

Populate destinations using the plugin APIs:

const queues = await webex.cc.getQueues(); // filter by channelType === 'TELEPHONY' if needed
const buddies = await webex.cc.getBuddyAgents({ mediaType: 'telephony' });
Queue Item (example fields)
keydescription
idQueue id used for consult/transfer.
nameQueue display name.
channelTypeChannel type (e.g., TELEPHONY).
Buddy Agent Item (example fields)
keydescription
agentIdAgent id to consult/transfer.
agentNameDisplay name shown in UI.
stateAgent state (e.g., Available/Idle).

anchorTask Events (Common)

anchor

These events are commonly used when building task UIs:

  • task:incoming: New inbound task is offered to the agent.
  • task:hydrate: When UI reloads (ie. relogin case) and an existing task was present. The payload is delivered to refresh local UI/state.
  • task:assigned: Task was successfully accepted and assigned to the agent.
  • task:media (telephony): Remote audio track is available; attach it to an <audio> element.
  • task:hold (telephony): Active telephony leg was placed on hold.
  • task:resume (telephony): Active telephony leg was resumed from hold.
  • task:consultCreated (telephony): A consult leg was initiated by the agent.
  • task:offerConsult (telephony): An incoming consult offer was received.
  • task:consultAccepted (telephony): The consult offer was accepted and connected.
  • task:consulting (telephony): Consult is in progress (connected state).
  • task:consultQueueFailed (telephony): Consult to a queue failed to connect.
  • task:consultQueueCancelled (telephony): Queue consult was cancelled before connection.
  • task:consultEnd (telephony): Consult leg ended.
  • task:end: Task ended; includes wrap-up info like wrapUpRequired.
  • task:wrappedup: Wrap‑up completed and submitted.
  • task:rejected: Task was rejected or went unanswered; includes reason also (ie. rejected or unavailable).
In This Article
  • Overview
  • Receiving Tasks
  • Selecting and Handling a Task
  • Response Type: TaskResponse
  • Accept Task
  • Decline Task
  • Voice Media (Telephony)
  • Telephony Controls
  • Transfer (All Channels Where Supported)
  • Consult and Consult Transfer (Telephony)
  • End and Wrap-up
  • Outbound Dialing (Telephony)
  • Destination Lists for Transfer/Consult
  • Task Events (Common)

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.