AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityPlannedWe plan to add this functionality in a future Elastic Stack update. Subject to changes.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Delete a service account from a namespace of your own.
Deleting an account that still has service tokens is rejected unless force is true.
A forced delete leaves the tokens behind: they cannot authenticate while no account of that name exists, and recreating the account is rejected until they are deleted.
Note
The elastic namespace is reserved for the built-in service accounts that ship with Elasticsearch.
A name that no user-managed service account could have is rejected rather than reported as not found.
The manage_service_account privilege does not authorize this API.
The namespace, which is a top-level grouping of service accounts.
It must start with a letter or digit and can contain only letters, digits, hyphens, and underscores, up to a maximum of 128 characters.
It cannot be elastic, which is reserved for built-in service accounts.
servicestringrequired
The service name.
It must start with a letter or digit and can contain only letters, digits, hyphens, and underscores, up to a maximum of 128 characters.
If wait_for (the default) then wait for a refresh to make this operation visible to search, if true then refresh the affected shards to make this operation visible to search, if false then do nothing with refreshes.
Values:truefalsewait_for
forceboolean · default: false
If false (the default), deleting a service account that still has service tokens is rejected.
If true, the account is deleted and its tokens are left in place.
If the service account is successfully deleted, the request returns {"found": true}.
Otherwise, the response will have status code 404 and found is set to false.