Get service accounts
- GET /_security/service/{namespace}/{service}
- GET /_security/service/{namespace}
- GET /_security/service
Get a list of service accounts that match the provided path parameters.
Built-in service accounts ship with Elasticsearch in the elastic namespace; user-managed service accounts are created with the put user-managed service account API.
NOTE: When type is omitted, a request without a namespace reports built-in accounts only, which preserves the response of a whole-cluster listing.
A request scoped to a namespace reports both kinds, so an account you created is found without naming its kind.
- Cluster privileges:
manage_service_account
Path Parameters
-
namespacestringoptional -
The name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit the
serviceparameter.Leave it out to use
/_security/service. -
servicestringoptional -
The service name. Omit this parameter to retrieve information about all service accounts that belong to the specified
namespace.Leave it out to use
/_security/service.
Query Parameters
-
typeServiceAccountType | ServiceAccountType A comma-separated list of the kinds of service account to return. If it is omitted, it defaults to
built_inwhen no namespace is given and tobuilt_in,user_managedotherwise.Supported values include:
built_in: An account that ships with Elasticsearch, in the reservedelasticnamespace.user_managed: An account created with the put user-managed service account API.
-
Values:
built_inuser_managed
Response
Response Type: map string to ServiceAccountInfo