---
title: "Change agent privilege level"
method: POST
path: "/api/fleet/agents/{agentId}/privilege_level_change"
tags: ["Elastic Agents"]
---

# Change agent privilege level

`POST /api/fleet/agents/{agentId}/privilege_level_change`

**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/agents/{agentId}/privilege_level_change</span></div>

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

Change the privilege level of a single agent to unprivileged.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Path parameters

- `agentId` string, required

## Headers

- `kbn-xsrf` string, required

## Request body

- object, nullable
  - `user_info` object
    - `groupname` string
    - `password` string
    - `username` string

## Response `200`

OK: A successful request.

- union
  - KibanaHTTPAPIsActionIdResponse
    - `actionId` string, required
  - KibanaHTTPAPIsActionMessageResponse
    - `message` string, required

## Other responses

- `400` — A 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/versions/531c9e2a7d23/schema)
