Delete service account tokens

Auth

Delete service account tokens for a service in a specified namespace. This route serves both kinds of service account, but the privileges differ: manage_service_account authorizes tokens of built-in accounts in the elastic namespace only, and tokens of a user-managed account require manage_security.

Important

On Serverless, non-operator users can delete tokens for only elastic/fleet-server and elastic/fleet-server-remote. Deleting tokens for any other service account requires operator privileges.

More about service accounts

Required authorization

Cluster privileges manage_service_account

Path parameters

namespace string required

The namespace, which is a top-level grouping of service accounts.

service string required

The service name.

name string required

The name of the service account token.

Query parameters

refresh enum

If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.

Values: true false wait_for

Response

application/json
found boolean required

If the service account token is successfully deleted, the request returns {"found": true}. Otherwise, the response will have status code 404 and found is set to false.