Spaces method and path for this operation:
post /s/{space_id}/api/fleet/service_tokens
Refer to Spaces for more information.
Create a Fleet Server service token. The token is used to enroll Fleet Server instances with Kibana.
[Required authorization] Route required privileges: fleet-agents-all.
POST
/api/fleet/service_tokens
curl \
--request POST 'https://<KIBANA_URL>/api/fleet/service_tokens' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"remote":true}'
Request example
Generate a service token for a remote Fleet Server
{
"remote": true
}
Response examples (200)
The generated Fleet Server service token
{
"name": "elastic/fleet-server/token-1234567890",
"value": "AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTEyMzQ1Njc4OTA6QUJDREVGR0hJSktMTU5P"
}
Response examples (400)
Example of a generic error response
{
"error": "Bad Request",
"message": "An error message describing what went wrong",
"statusCode": 400
}