End session
endSession
End an active session
Operation ID: endSessionDELETE
https://api.salesforce.com/einstein/ai-agent/v1/sessions/{session-id}
Send a message to the agent to end a session. The endpoint contains the ID of the active session, which was returned in the response of the Start Session call.
Request
curl "https://api.salesforce.com/einstein/ai-agent/v1/sessions/{session-id}" \
-X DELETE \
-H "Authorization: Bearer •••••" \
-H "x-session-end-reason: Transfer"URI parameters
session-id
string
Required
The ID of the active session, which is the sessionId value returned from the Start Session call.
Headers
Authorization
string
Required
Authorization information that contains the JWT.
Bearer •••••
x-session-end-reason
string
enum
Required
The reason the session ended.
Enum values:
- UserRequest
- Transfer
- Expiration
- Error
- Other
Transfer
Responses
Batched Response (Headless)
{
"messages": [
{
"id": "a133c185-73a7-4adf-b6d9-b7fd62babb4e",
"type": "Inform"
}
],
"_links": {
"self": {
"href": "https://api.salesforce.com/sessions"
},
"messages": {
"href": "https://api.salesforce.com/sessions"
},
"session": {
"href": "https://api.salesforce.com/sessions"
},
"end": {
"href": "https://api.salesforce.com/sessions"
}
}
}
Body
Media type:
application/json
messages
array
Required
Array of response messages. Each message can be one of the following response message types: Inform, TextChunk, ValidationFailureChunk, ProgressIndicator, Inquire, Confirm, Failure, Escalate, SessionEnded, EndOfTurn, Error.
_links
object
Required
List of Agentforce endpoints for HATEOS compliance.