Create a service token

POST /api/fleet/service_tokens

Create a service token

Headers

  • The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json; Elastic-Api-Version=2023-10-31

Body

  • remote boolean

    Default value is false.

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31
    Hide response attributes Show response attributes object
  • 400 application/json; Elastic-Api-Version=2023-10-31
    Hide response attributes Show response attributes object
POST /api/fleet/service_tokens
curl \
 -X POST https://localhost:5601/api/fleet/service_tokens \
 -H "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
 -H "elastic-api-version: 2023-10-31" \
 -H "kbn-xsrf: true"
Request examples
# Headers
elastic-api-version: 2023-10-31
kbn-xsrf: true

# Payload
{
  "remote": false
}
Response examples (200)
{
  "name": "string",
  "value": "string"
}
Response examples (400)
{
  "error": "string",
  "message": "string",
  "statusCode": 42.0
}