> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.labelstud.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.labelstud.io/_mcp/server.

# Update user details

PATCH http://localhost:8000/api/users/{id}/
Content-Type: application/json


        Update details for a specific user, such as their name or contact information, in Label Studio.
        

Reference: https://api.labelstud.io/api-reference/api-reference/users/update

## Authentication

- `Authorization` header (required) (prefixed with ` Token   `) — The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: curl [https://label-studio-host/api/projects](https://label-studio-host/api/projects) -H "Authorization: Token \[your-token]"

## Request

### Path parameters

- `id` (integer, required) — User ID

### Body (application/json)

This endpoint expects a PatchedLseUserSerializerUpdateRequest.

- `active_organization` (integer, optional, nullable)
- `allow_newsletters` (boolean, optional, nullable) — Allow sending newsletters to user
- `custom_hotkeys` (any, optional, nullable) — Custom keyboard shortcuts configuration for the user interface
- `date_joined` (datetime, optional)
- `email_notification_settings` (any, optional)
- `first_name` (string, optional)
- `is_email_verified` (boolean, optional, nullable)
- `last_name` (string, optional)
- `onboarding_state` (string, optional, nullable)
- `password` (string, optional)
- `phone` (string, optional)
- `username` (string, optional)

## Response

### 200

- `active_organization_meta` (map from string to string, required)
- `avatar` (string, required, nullable)
- `id` (integer, required)
- `initials` (string, required, default: ?)
- `last_activity` (datetime, required, nullable)
- `lse_fields` (LseFields, required)
- `organization_membership` (OrganizationMembership, required)
- `pause` (map from string to any, required, nullable)
- `username` (string, required)
- `org_membership` (list of OrganizationMembership, required, deprecated)
- `active_organization` (integer, optional, nullable)
- `allow_newsletters` (boolean, optional, nullable) — Allow sending newsletters to user
- `custom_hotkeys` (any, optional, nullable) — Custom keyboard shortcuts configuration for the user interface
- `date_joined` (datetime, optional)
- `email` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)
- `phone` (string, optional)

## Types

### LseFields

- `email_notification_settings` (map from string to any, required) — Get email notification settings with organization-level filtering. Use the model's getter method to ensure all notification types are included with proper defaults for any missing types. Transform the output to include both value and label for each notification type. Filter notifications based on organization's allowed notifications if user belongs to exactly one organization. Role-based filtering: not_activated_user_login is only available to users who are admins or owners in at least one organization.
- `invite_expired` (boolean, required, nullable)
- `invite_expired_at` (datetime, required, nullable)
- `invite_activated` (boolean, optional, nullable)
- `invited_at` (datetime, optional, nullable)
- `invited_by` (integer, optional, nullable)
- `onboarding_state` (enum, optional, nullable) — The current stage of user onboarding * `not_started` - Not Started * `signup` - Signup * `trial_signup` - Trial Signup * `first_tutorial` - First Tutorial * `in_app_guidance` - In App Guidance * `complete` - Complete
  - Allowed values: `not_started`, `signup`, `trial_signup`, `first_tutorial`, `in_app_guidance`, `complete`
- `social_auth_finished` (boolean, optional, nullable) — Is user finished social authentication
- `trial_company` (string, optional, nullable)
- `trial_experience_labeling` (string, optional, nullable)
- `trial_license_enterprise` (boolean, optional, nullable)
- `trial_models_in_production` (string, optional, nullable)
- `trial_role` (enum, optional, nullable) — * `annotator` - Annotator * `annotator_team_manager` - Annotator Team Manager * `business_analyst` - Business Analyst * `business_or_data_team_leadership` - Business Or Data Team Leadership * `data_engineer_platform_engineer` - Data Engineer Platform Engineer * `data_scientist` - Data Scientist * `other` - Other
  - Allowed values: `annotator`, `annotator_team_manager`, `business_analyst`, `business_or_data_team_leadership`, `data_engineer_platform_engineer`, `data_scientist`, `other`

### OrganizationMembership

- `active` (boolean, required)
- `flex` (map from string to any, required, nullable) — Flex claim/window state for FE expired-seat UX (FIT-2339). Non-Flex → null.
- `organization_id` (integer, required) — Organization ID
- `role` (string, required)
- `user_type` (string, required, nullable)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "active_organization_meta": {},
  "avatar": "string",
  "id": 1,
  "initials": "?",
  "last_activity": "2024-01-15T09:30:00Z",
  "lse_fields": {
    "email_notification_settings": {},
    "invite_expired": true,
    "invite_expired_at": "2024-01-15T09:30:00Z",
    "invite_activated": true,
    "invited_at": "2024-01-15T09:30:00Z",
    "invited_by": 1,
    "onboarding_state": "not_started",
    "social_auth_finished": true,
    "trial_company": "string",
    "trial_experience_labeling": "string",
    "trial_license_enterprise": true,
    "trial_models_in_production": "string",
    "trial_role": "annotator"
  },
  "organization_membership": {
    "active": true,
    "flex": {},
    "organization_id": 1,
    "role": "string",
    "user_type": "string"
  },
  "pause": {},
  "username": "string",
  "org_membership": [
    {
      "active": true,
      "flex": {},
      "organization_id": 1,
      "role": "string",
      "user_type": "string"
    }
  ],
  "active_organization": 1,
  "allow_newsletters": true,
  "custom_hotkeys": null,
  "date_joined": "2024-01-15T09:30:00Z",
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "phone": "string"
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8000/api/users/1/"

payload = {}
headers = {
    "Authorization": "Token  <api_key>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:8000/api/users/1/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Token  <api_key>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/users/1/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Token  <api_key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/users/1/")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Token  <api_key>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("http://localhost:8000/api/users/1/")
  .header("Authorization", "Token  <api_key>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'http://localhost:8000/api/users/1/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Token  <api_key>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8000/api/users/1/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Token  <api_key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token  <api_key>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/users/1/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```