---
title: "Create a service token"
method: POST
path: "/api/fleet/service_tokens"
tags: ["Fleet service tokens"]
---

# Create a service token

`POST /api/fleet/service_tokens`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/service_tokens</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Create a Fleet Server service token. The token is used to enroll Fleet Server instances with Kibana.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Headers

- `kbn-xsrf` string, required

## Request body

- object, nullable
  - `remote` boolean

## Response `200`

Successful response

- object
  - `name` string, required
  - `value` string, required

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/deb2e8b751e7/schema)
