Invalidate user sessions
Base URL
https://{kibana_url}
POST
/api/security/session/_invalidate
Auth
Invalidate user sessions that match a query. To use this API, you must be a superuser.
Expand all
A required header to protect against CSRF attacks
{
}
match
enum
required
The method Kibana uses to determine which sessions to invalidate. If it is all, all existing sessions will be invalidated. If it is query, only the sessions that match the query will be invalidated.
Values:
all
query
query
object
The query that Kibana uses to match the sessions to invalidate when the match parameter is set to query.
+
Show 2 properties
provider
object
required
The authentication providers that will have their user sessions invalidated.
+
Show 2 properties
name
string
The authentication provider name.
type
string
required
The authentication provide type. For example: basic, token, saml, oidc, kerberos, or pki.
username
string
The username that will have its sessions invalidated.
200
Indicates a successful call
application/json
total
integer
The number of sessions that were successfully invalidated.
403
Indicates that the user may not be authorized to invalidate sessions for other users.
Thank you for your feedback.
Base URL
https://{kibana_url}
Examples
Invalidate all sessions
2 languages
Invalidate all SAML sessions
2 languages
Invalidate sessions for a provider
2 languages
Invalidate sessions for a user
2 languages
Request
Console
1 / 2 languages
‹
›
Run POST api/security/session/_invalidate to invalidate all existing sessions.
Show more
1
2
3
4
POST kbn:/api/security/session/_invalidate
{
"match" : "all"
}
Generated from the API spec
1
2
3
4
5
6
7
curl -X POST "${KIBANA_URL}/api/security/session/_invalidate" \
-H "kbn-xsrf: true" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"match" : "all"
}'
Generated from the API spec
Response
Generated from the API spec
Request
Console
1 / 2 languages
‹
›
Run POST api/security/session/_invalidate to invalidate sessions that were created by any SAML authentication provider.
Show more
1
2
3
4
5
6
7
POST kbn:api/security/session/_invalidate
{
"match" : "query",
"query": {
"provider" : { "type": "saml" }
}
}
Generated from the API spec
1
2
3
4
5
6
7
8
9
10
curl -X POST "${KIBANA_URL}/api/security/session/_invalidate" \
-H "kbn-xsrf: true" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"match" : "query",
"query": {
"provider" : { "type": "saml" }
}
}'
Generated from the API spec
Response
Generated from the API spec
Request
Console
1 / 2 languages
‹
›
Run POST api/security/session/_invalidate to invalidate sessions that were created by the SAML authentication provider named saml1.
Show more
1
2
3
4
5
6
7
POST kbn:api/security/session/_invalidate
{
"match" : "query",
"query": {
"provider" : { "type": "saml", "name": "saml1" }
}
}
Generated from the API spec
1
2
3
4
5
6
7
8
9
10
curl -X POST "${KIBANA_URL}/api/security/session/_invalidate" \
-H "kbn-xsrf: true" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"match" : "query",
"query": {
"provider" : { "type": "saml", "name": "saml1" }
}
}'
Generated from the API spec
Response
Generated from the API spec
Request
Console
1 / 2 languages
‹
›
Run POST api/security/session/_invalidate to invalidate sessions that were created by any OpenID Connect authentication provider for the user with the username user@my-oidc-sso.com.
Show more
1
2
3
4
5
6
7
8
POST kbn:api/security/session/_invalidate
{
"match" : "query",
"query": {
"provider" : { "type": "oidc" },
"username": "user@my-oidc-sso.com"
}
}
Generated from the API spec
1
2
3
4
5
6
7
8
9
10
11
curl -X POST "${KIBANA_URL}/api/security/session/_invalidate" \
-H "kbn-xsrf: true" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"match" : "query",
"query": {
"provider" : { "type": "oidc" },
"username": "user@my-oidc-sso.com"
}
}'
Generated from the API spec
Response
Generated from the API spec