---
id: update-user
title: "Update a User"
description: "Update information about a User"
sidebar_label: "Update a User"
hide_title: true
hide_table_of_contents: true
api: {"description":"Update information about a User","tags":["Users"],"operationId":"updateUser","security":[{"BearerAuth":[]},{"TokenAuth":[]}],"parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"string"},"description":"The unique identifier of a user"}],"requestBody":{"description":"User update","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"description":"User's NetBird account role","type":"string"},"auto_groups":{"description":"Groups to auto-assign to peers registered by this user","type":"array","items":{"type":"string"}}},"required":["role","auto_groups"],"title":"UserRequest"}}}},"responses":{"200":{"description":"A User object","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"User ID","type":"string"},"email":{"description":"User's email address","type":"string"},"name":{"description":"User's name from idp provider","type":"string"},"role":{"description":"User's NetBird account role","type":"string"},"status":{"description":"User's status","type":"string","enum":["active","invited","disabled"]},"auto_groups":{"description":"Groups to auto-assign to peers registered by this user","type":"array","items":{"type":"string"}},"is_current":{"description":"Is true if authenticated user is the same as this user","type":"boolean","readOnly":true},"is_service_user":{"description":"Is true if this user is a service user","type":"boolean","readOnly":true}},"required":["id","email","name","role","auto_groups","status"],"title":"User"}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"put","path":"/api/users/{userId}","servers":[{"url":"https://netbird.io","description":"Default server"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"TokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Prefix the value with \\\"Token\\\" to indicate the custom authorization type"}},"jsonRequestBodyExample":{"role":"string","auto_groups":["string"]},"info":{"title":"NetBird REST API","description":"API to manipulate groups, rules, policies and retrieve information about peers and users","version":"0.0.1"},"postman":{"name":"Update a User","description":{"content":"Update information about a User","type":"text/plain"},"url":{"path":["api","users",":userId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of a user","type":"text/plain"},"type":"any","value":"","key":"userId"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PUT","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}},"auth":{"type":"bearer","bearer":[{"type":"any","value":"<Bearer Token>","key":"token"}]}}}
sidebar_class_name: "put api-method"
info_path: api/netbird-rest-api
custom_edit_url: null
---

import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import TabItem from "@theme/TabItem";

## Update a User



Update information about a User

<details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"in":"path","name":"userId","required":true,"schema":{"type":"string"},"description":"The unique identifier of a user"}}></ParamsItem></ul></div></details><MimeTabs><TabItem label={"application/json"} value={"application/json-schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}><div style={{"marginTop":"1rem","marginBottom":"1rem"}}>

User update

</div></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"role"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"User's NetBird account role","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"auto_groups"} required={true} schemaName={"string[]"} qualifierMessage={undefined} schema={{"description":"Groups to auto-assign to peers registered by this user","type":"array","items":{"type":"string"}}}></SchemaItem></ul></details></TabItem></MimeTabs><div><ApiTabs><TabItem label={"200"} value={"200"}><div>

A User object

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"User ID","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"email"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"User's email address","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"User's name from idp provider","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"role"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"User's NetBird account role","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"status"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** [`active`, `invited`, `disabled`]"} schema={{"description":"User's status","type":"string","enum":["active","invited","disabled"]}}></SchemaItem><SchemaItem collapsible={false} name={"auto_groups"} required={true} schemaName={"string[]"} qualifierMessage={undefined} schema={{"description":"Groups to auto-assign to peers registered by this user","type":"array","items":{"type":"string"}}}></SchemaItem><SchemaItem collapsible={false} name={"is_current"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Is true if authenticated user is the same as this user","type":"boolean","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"is_service_user"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Is true if this user is a service user","type":"boolean","readOnly":true}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"id\": \"string\",\n  \"email\": \"string\",\n  \"name\": \"string\",\n  \"role\": \"string\",\n  \"status\": \"active\",\n  \"auto_groups\": [\n    \"string\"\n  ],\n  \"is_current\": true,\n  \"is_service_user\": true\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>

Bad Request

</div><div></div></TabItem><TabItem label={"401"} value={"401"}><div>

Requires authentication

</div><div></div></TabItem><TabItem label={"403"} value={"403"}><div>

Forbidden

</div><div></div></TabItem><TabItem label={"500"} value={"500"}><div>

Internal Server Error

</div><div></div></TabItem></ApiTabs></div>
      