Create a service account token

  • POST also PUT /_security/service/{namespace}/{service}/credential/token/{name}
  • POST /_security/service/{namespace}/{service}/credential/token

Create a service accounts token for access without requiring basic authentication.

NOTE: Service account tokens never expire. You must actively delete them if they are no longer needed.

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

  • Cluster privileges: manage_service_account
More about service accounts

Query Parameters

refresh enum Refresh

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