Ending a User Session
End User Session API
The End User Session API allows you to explicitly terminate all active and inactive sessions for an end user in your Talkdesk Identity instance, forcing the user to sign in again on every device.
When to Use This Endpoint
Use this endpoint when you need to force a user to log out from all devices and browsers, regardless of whether their sessions are currently active.
Prerequisites
Before calling this endpoint, ensure that:
- You have a valid OAuth 2.0 access token.
- The access token includes the
user-session-public:endscope. - You know the user's ID, which must be exactly 24 characters long.
Endpoint
POST /oauth/end_user_sessionHeaders
| Header | Value |
|---|---|
| Authorization | Bearer YOUR_ACCESS_TOKEN |
| Content-Type | application/x-www-form-urlencoded |
Form Parameters
| Parameter | Required | Description |
|---|---|---|
user_id | Yes | The unique identifier of the user whose sessions you want to terminate. Must be exactly 24 characters. |
reason | No | Optional reason for terminating the sessions. Currently, the only supported value is force_logout. |
Example Request
curl -X POST https://api.talkdeskapp.com/oauth/end_user_session \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "user_id=1234567890abcdef12345678" \
-d "reason=force_logout"Expected Behavior
A successful request terminates all sessions associated with the specified user across every device and browser. The user will be required to authenticate again before accessing Talkdesk.
API Reference
See the End User Sessions API reference for additional details about this endpoint and its responses.
Troubleshooting
If you encounter issues or have questions, open a support ticket through the Talkdesk support portal.
Updated 18 days ago