channel.ended.v0


Beta/Early Access Program

This API is in the Beta/Early Access Program and is still under development. If you are interested in using this API, please contact your Customer Success Manager or Account Manager. Participation in this pilot program is at the discretion of Product Management and not guaranteed.

Use of this API outside of the program is prohibited.

Description

This type of event indicates that a channel has ended. A channel.ended event means that there will be no further activity on the channel.

This type of event can happen in a number of different ways. For example, a customer channel might end when the customer disconnects by hanging up. Or an agent channel might end when the agent completes post-interaction tasks and exits the wrap state.

A notification will be sent at the moment the channel lifecycle ends.

A channel.ended notification can be used to calculate the duration of the proceeding phase. If the proceeding phase was the connected phase, the event will occur at the same time as the channel.disconnected type of event.

Example

Here is an example of a channel.ended.v0 notification: 

{
   "specversion":"1.0",
   "type":"channel.ended.v0",
   "id":"2VejGqWZPqHXHVNcfUPUO8IASAp",
   "source":"/channel",
   "subject":"740109c1-12d5-430f-9543-131fe5c4edcb",
   "time":"2022-08-30T14:34:36.6134321Z",
   "datacontenttype":"application/json",
   "data":{
      "timestamp":"2022-08-30T14:34:36.088Z",
      "reason":"released",
      "channel":{
         "conversationId":"3e71f453-116a-3abc-7769-bc678ef6e080",
         "interactionId":"1371f451-116a-4abc-8869-bc678ef67070",
         "channelId":"740109c1-12d5-430f-9543-131fe5c4edcb",
         "party":{
            "role":"agent",
            "agentId":"1544",
            "userId":"ef71f453-556a-3abc-7769-bc678ef6e090"
         }
      }
   }
}

Properties

  • specversion — The version of the specification being used.
  • type — The type of event, which is channel.ended.v0. This comprises three parts: the entity performing the event, a description of the event, and the version of the event. 
  • id — When combined with the source, forms a unique identifier for the notification. The format is a ksuid.
  • source — The type of event source.
  • subject — The subject of the event, which in this case is the channel. The value is the channel ID, which is a GUID.
  • time — An ISO 8601 UTC datetime representing the moment the notification was sent.
  • datacontenttype — The content type used by the data property.
  • data — The event payload. 
    • timestamp — An ISO 8601 UTC datetime representing the moment the channel ended. The preceding phase (which could be connected, unexpected, or wrap) will end at exactly the same moment.

      This is not the timestamp of when a notification related to this event was sent. 
    • reason — The reason that the channel ended. Possible values are: 
      • released — The channel participant manually ended the channel. 
      • deviceBusy — The channel entered an alerting state, but the channel participant did not accept because their device was busy. The most common example is an inbound phone call where the phone is already engaged.
      • notAccepted — The channel entered an alerting state, but the channel participant did not accept the interaction within the timeout for accepting interactions.
      • deviceUnreachable — The channel entered an alerting state, but the channel participant did not accept because their device — such as their phone or microphone — was not reachable.
      • rejected — The channel entered an alerting state, but the interaction was manually or automatically rejected when assigned to the agent. For example, an agent is offered a chat and they click Reject.
      • fault — The channel entered an alerting state, but the channel participant did not connect for an unexpected reason, possibly due to configuration or network errors.
      • connectionUnavailable — The channel entered an alerting state, but could not be connected to the agent because the required media channel — currently only phone calls using WebRTC — was not available.
    • channel — This object provides some further information about the channel that has ended.
      • conversationId — A unique identifier assigned to a conversation within VCC. The conversation ID is a GUID (Globally Unique Identifier) such as '4f27b3a1-6f02-4006-8b9d-5f6e1c1a8f65.
      • interactionId — The unique identifier of the interaction that the channel is part of. It is a UUID.
      • channelId — The unique identifier of the channel that has ended. It is a UUID.
      • party — This object provides some further information about the party on the channel.
        • role — The role of the party on the channel. Possible values are external, agent, monitor, and voicemail.
        • agentId — The ID for the party if they are an agent or monitor role.
        • userId — The ID for the user.