Newer Version Available

This content describes an older version of this product. View Latest

MessagingSession

Represents a session on a Messaging channel. This object is available in API version 47.0 and later.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

Fields

Field Details
AcceptTime
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The time when an agent accepts an incoming Messaging session.
AgentMessageCount
Type
int
Properties
Nillable
Description
The number of messages sent by the agent during the session.

This value isn’t calculated in enhanced Messaging sessions. If you’re trying to assess agent performance, consider calculating the messaging session length (EndTimeAcceptTime) instead.

AgentType
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of agent that is assigned to the Messaging session. Possible values are:
  • Agent
  • Bot
  • BotToAgent—Bot & Agent
  • System—Used for triggered outbound messages
CaseId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the case associated with this Messaging session.
ChannelEndUserFormula
Type
string
Properties
Filter, Group, idLookup, Nillable, Sort
Description
A concatenation of the Messaging channel and Messaging user.
ChannelGroup
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The group of the associated Messaging channel.
ChannelIntent
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The intent of the associated Messaging channel.
ChannelKey
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The unique identifier for the associated Messaging channel.
ChannelLocale
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The locale of the associated Messaging channel.
ChannelName
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The name of the associated Messaging channel.
ChannelType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of the associated Messaging channel. Possible values are:
  • EmbeddedMessaging—Available in API version 55.0 and later.
  • Facebook
  • Phone
  • Text
  • Voice
  • WhatsApp
ConversationId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort
Description
The ID of the related conversation. Available in API version 55.0 and later.
This field is a relationship field.
Relationship Name
Conversation
Relationship Type
Lookup
Refers To
Conversation
EndTime
Type
dateTime
Properties
Create, Filter, Nillable, Sort
Description
The time when the Messaging session ended.
EndUserAccountId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the end user's account record.
This is a relationship field.
Relationship Name
EndUserAccount
Relationship Type
Lookup
Refers To
Account
EndUserContactId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the end user's contact record.
This is a relationship field.
Relationship Name
EndUserContact
Relationship Type
Lookup
Refers To
Contact
EndUserMessageCount
Type
int
Properties
Nillable
Description
The number of messages sent by the Messaging end user.

This value isn’t calculated in enhanced Messaging sessions. If you’re trying to assess agent performance, consider calculating the messaging session length (EndTimeAcceptTime) instead.

LastReferencedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.
LeadId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the Lead associated with this Messaging session.
MessagingChannelId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The ID of the Messaging channel associated with this Messaging session.
This is a relationship field.
Relationship Name
MessagingChannel
Relationship Type
Lookup
Refers To
MessagingChannel
MessagingEndUserId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The ID of the Messaging end user associated with this Messaging session.
This is a relationship field.
Relationship Name
MessagingEndUser
Relationship Type
Lookup
Refers To
MessagingEndUser
Name
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The name of this Messaging session.
OpportunityId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the opportunity record associated with this Messaging session.
Origin
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
The origin of this Messaging session. Possible values are:
  • AgentInitiated
  • ConversationClose—Messaging user deleted the conversation in Apple Messages
  • ConversationControlLost—Third-party bot resumes control from Salesforce bot or agent
  • Help
  • InboundInitiated
  • OptIn—Opt In Status Change
  • OptOut—Opt Out Status Change
  • TriggeredOutbound
Messaging sessions can’t be created using Apex code. They can be created only through customer initiation or by using Process Builder, flows, or the Start Conversation action.
OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
The ID of the owner associated with this Messaging session.
This is a polymorphic relationship field.
Relationship Name
Owner
Relationship Type
Lookup
Refers To
Group, User
PreviewDetails
Type
string
Properties
Nillable
Description
The preview shown to an agent for this Messaging session.
SessionKey
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
The identifier for the Messaging session.
StartTime
Type
dateTime
Properties
Create, Filter, Nillable, Sort
Description
The time when the Messaging session started.
Status
Type
picklist
Properties
Create, Filter, Group, Restricted picklist, Sort
Description
The status of the Messaging session. Possible values are:
  • New (standard channels only)
  • Active
  • Consent (enhanced channels only)
  • Waiting
  • Paused (enhanced channels only)
  • Inactive (enhanced channels only)
  • Ended
  • Error (enhanced channels only)
To learn more about these statuses, see Lifecycle of a Messaging Session in Salesforce Help.
TargetUserId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the target user associated with this Messaging session.
This is a relationship field.
Relationship Name
TargetUser
Relationship Type
Lookup
Refers To
User

Associated Objects

This object has the following associated objects. Unless noted, they’re available in the same API version as this object.

MessagingSessionFeed
Feed tracking is available for the object.
MessagingSessionHistory
History is available for tracked fields of the object.
MessagingSessionOwnerSharingRule
Sharing rules are available for the object.
MessagingSessionShare
Sharing is available for the object.