This API call enables you to terminate all sessions of a specific user.
To execute this request, you need the Service Provider API (ServiceProviderAPI) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.
/api/cluster/v2/userSessions
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| userId | string | User ID (mandatory) | query | optional |
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request. User id must be filled in. |
| 404 | User sessions not found |
| 500 | Operation failed |
| 510 | Failed to invalidate sessions |
In this example, the request deletes all user sessions with user ID value user.name. The response code of 200 indicates that the deletion was successful.
curl -X DELETE "https://myManaged.cluster.com/api/cluster/v2/userSessions?userId=user.name" -H "accept: */*"
https://myManaged.cluster.com/api/cluster/v2/userSessions?userId=user.name
200