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

# Remove a user

DELETE https://api.modex.com/v1/clients/{client_id}/users/{client_user_id}

Removes a user from a client you own. The user loses access to that client's account. Their Modex login isn't deleted.

**Path:** `client_id`, `client_user_id` (UUIDs).

Returns `{"ok": true}`. A user who isn't on the client returns 404. A client you don't own returns 403.

Reference: https://docs.modex.com/api-reference/account/client-seats/remove-client-user

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `client_id` (string, required)
- `client_user_id` (string, required)

## Response

### 200

OK

- `ok` (boolean, optional) — Always `true` on success.

## Errors

### 404 Not Found Error

Not Found

- `error` (ApiErrorError, required)

## Types

### ApiErrorError

- `type` (string, required) — Error category: invalid_request, authentication_error, permission_error, not_found, rate_limit_error, or api_error.
- `code` (string, required) — Specific error code. Same as `type`, except `validation_error` for request-body validation failures.
- `message` (string, required) — Human-readable explanation.
- `details` (map from string to list of string, optional) — Validation errors only: each invalid field mapped to its messages.

## Examples

**Response**

```json
{
  "ok": true
}
```

**SDK Code**

```python Removed
import requests

url = "https://api.modex.com/v1/clients/client_id/users/client_user_id"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Removed
const url = 'https://api.modex.com/v1/clients/client_id/users/client_user_id';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

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

```go Removed
package main

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

func main() {

	url := "https://api.modex.com/v1/clients/client_id/users/client_user_id"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://api.modex.com/v1/clients/client_id/users/client_user_id")

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

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

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

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

HttpResponse<String> response = Unirest.delete("https://api.modex.com/v1/clients/client_id/users/client_user_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.modex.com/v1/clients/client_id/users/client_user_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Removed
using RestSharp;

var client = new RestClient("https://api.modex.com/v1/clients/client_id/users/client_user_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Removed
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modex.com/v1/clients/client_id/users/client_user_id")! 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()
```