> 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.

# ✨ Bulk unassign workspace members

DELETE http://localhost:8000/api/workspaces/{id}/memberships/bulk/

This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)

Unassign workspace members in bulk. Pass selector fields via query parameters (`all`, `included`, `excluded`) and optional paginated-list filters (`search`, `ids`). For backward compatibility, a JSON body with bulk fields is still accepted.

Reference: https://api.labelstud.io/api-reference/api-reference/workspaces/members/bulk/delete

## 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)

### Query parameters

- `all` (boolean, optional) — Apply unassignment to all currently matched workspace members.
- `excluded` (string, optional) — Comma-separated list of user IDs to keep assigned when `all=true`.
- `ids` (string, optional) — Comma-separated list of user IDs to filter matched members.
- `included` (string, optional) — Comma-separated list of user IDs to unassign when `all=false`.
- `search` (string, optional) — Search term for filtering matched members by name or email.

## Response

### 200

- `unassignments` (integer, optional)

## Examples

### Legacy SDK usage (supported)

**Response**

```json
{
  "description": "Backward-compatible legacy call with DELETE body: ls.workspaces.members.bulk.delete(\n    id=123,\n    request_options={'additional_body_parameters': {'all': False, 'included': [456, 789]}},\n)",
  "summary": "Legacy SDK usage (supported)"
}
```

**SDK Code**

```python Legacy SDK usage (supported)
import requests

url = "http://localhost:8000/api/workspaces/1/memberships/bulk/"

headers = {"Authorization": "Token  <api_key>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript Legacy SDK usage (supported)
const url = 'http://localhost:8000/api/workspaces/1/memberships/bulk/';
const options = {method: 'DELETE', headers: {Authorization: 'Token  <api_key>'}};

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

```go Legacy SDK usage (supported)
package main

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

func main() {

	url := "http://localhost:8000/api/workspaces/1/memberships/bulk/"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Token  <api_key>")

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

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

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

}
```

```ruby Legacy SDK usage (supported)
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/workspaces/1/memberships/bulk/")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Token  <api_key>'

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

```java Legacy SDK usage (supported)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("http://localhost:8000/api/workspaces/1/memberships/bulk/")
  .header("Authorization", "Token  <api_key>")
  .asString();
```

```php Legacy SDK usage (supported)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'http://localhost:8000/api/workspaces/1/memberships/bulk/', [
  'headers' => [
    'Authorization' => 'Token  <api_key>',
  ],
]);

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

```csharp Legacy SDK usage (supported)
using RestSharp;

var client = new RestClient("http://localhost:8000/api/workspaces/1/memberships/bulk/");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Token  <api_key>");
IRestResponse response = client.Execute(request);
```

```swift Legacy SDK usage (supported)
import Foundation

let headers = ["Authorization": "Token  <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/workspaces/1/memberships/bulk/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```

### SDK usage

**Response**

```json
{
  "description": "SDK call example using DELETE query params: ls.workspaces.members.bulk.delete(\n    id=123,\n    all_=False,\n    included=[456, 789],\n)",
  "summary": "SDK usage"
}
```

**SDK Code**

```python SDK usage
import requests

url = "http://localhost:8000/api/workspaces/1/memberships/bulk/"

headers = {"Authorization": "Token  <api_key>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript SDK usage
const url = 'http://localhost:8000/api/workspaces/1/memberships/bulk/';
const options = {method: 'DELETE', headers: {Authorization: 'Token  <api_key>'}};

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

```go SDK usage
package main

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

func main() {

	url := "http://localhost:8000/api/workspaces/1/memberships/bulk/"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Token  <api_key>")

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

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

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

}
```

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

url = URI("http://localhost:8000/api/workspaces/1/memberships/bulk/")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Token  <api_key>'

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

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

HttpResponse<String> response = Unirest.delete("http://localhost:8000/api/workspaces/1/memberships/bulk/")
  .header("Authorization", "Token  <api_key>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'http://localhost:8000/api/workspaces/1/memberships/bulk/', [
  'headers' => [
    'Authorization' => 'Token  <api_key>',
  ],
]);

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

```csharp SDK usage
using RestSharp;

var client = new RestClient("http://localhost:8000/api/workspaces/1/memberships/bulk/");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Token  <api_key>");
IRestResponse response = client.Execute(request);
```

```swift SDK usage
import Foundation

let headers = ["Authorization": "Token  <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/workspaces/1/memberships/bulk/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```