> This page is for Developers.

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

# Delete a user

DELETE https://one.zuora.com/scim/v2/Users/{id}

Deactivates a specific user identified by the user ID.


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/oneid/scim/delete-a-specific-user

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Request

### Path parameters

- `id` (string, required) — The ID of the user to delete.

### Headers

- `Idempotency-Key` (string, required) — Unique key used to ensure idempotent behavior.
- `Accept-Encoding` (string, optional) — Indicates the response's preferred content encoding. Supported values are `gzip` and `identity`.
- `Content-Encoding` (string, optional) — This header is returned if you specify the `Accept-Encoding: gzip` request header and the response contains over 1000 bytes of data.

## Response

### 200

OK

- `id` (string, optional) — The unique identifier for the user resource.
- `userName` (string, optional) — The unique username of the user.
- `displayName` (string, optional) — The display name of the user, used for user interfaces and profile views.
- `active` (boolean, optional) — Indicates whether the user account is active (true) or inactive (false).
- `emails` (list of ScimV2UsersIdDeleteResponsesContentApplicationJsonSchemaEmailsItems, optional)
- `meta` (ScimV2UsersIdDeleteResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, optional) — Indicates whether the request was successful. For a 401 Unauthorized response, this will be false.
- `reasons` (list of ScimV2UsersIdDeleteResponsesContentApplicationJsonSchemaReasonsItems, optional)

### 403 Forbidden Error

Forbidden

- `timestamp` (datetime, optional) — The date and time when the error occurred, in ISO 8601 format.
- `status` (integer, optional) — The HTTP status code for the response. For a 403 Forbidden response, this will be 403.
- `error` (string, optional) — A short, general description of the error.
- `message` (string, optional) — A detailed message explaining why access is forbidden, such as lack of permissions.
- `path` (string, optional) — The request path that triggered the error.

## Types

### ScimV2UsersIdDeleteResponsesContentApplicationJsonSchemaEmailsItems

- `value` (string, optional) — The email address associated with the user.
- `primary` (boolean, optional) — Indicates whether this email address is the primary one for the user.

### ScimV2UsersIdDeleteResponsesContentApplicationJsonSchemaMeta

- `resourceType` (string, optional) — The type of the resource, e.g., 'User'.
- `created` (datetime, optional) — The date and time when the user resource was created.
- `lastModified` (datetime, optional) — The date and time when the user resource was last modified.

### ScimV2UsersIdDeleteResponsesContentApplicationJsonSchemaReasonsItems

- `message` (string, optional) — A message describing the reason for the authorization failure.
- `code` (string, optional) — An application-specific error code indicating the nature of the authorization issue.

## Examples

**Response**

```json
{
  "id": "123456",
  "userName": "johndoe",
  "displayName": "John Doe",
  "active": true,
  "emails": [
    {
      "value": "johndoe@example.com",
      "primary": true
    }
  ],
  "meta": {
    "resourceType": "User",
    "created": "2023-01-01T12:00:00Z",
    "lastModified": "2023-01-01T12:00:00Z"
  }
}
```

**SDK Code**

```python SCIM_deleteASpecificUser_example
import requests

url = "https://one.zuora.com/scim/v2/Users/id"

headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```javascript SCIM_deleteASpecificUser_example
const url = 'https://one.zuora.com/scim/v2/Users/id';
const options = {
  method: 'DELETE',
  headers: {'Idempotency-Key': 'Idempotency-Key', Authorization: 'Bearer <token>'}
};

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

```go SCIM_deleteASpecificUser_example
package main

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

func main() {

	url := "https://one.zuora.com/scim/v2/Users/id"

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

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	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 SCIM_deleteASpecificUser_example
require 'uri'
require 'net/http'

url = URI("https://one.zuora.com/scim/v2/Users/id")

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

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

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

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

HttpResponse<String> response = Unirest.delete("https://one.zuora.com/scim/v2/Users/id")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://one.zuora.com/scim/v2/Users/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

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

```csharp SCIM_deleteASpecificUser_example
using RestSharp;

var client = new RestClient("https://one.zuora.com/scim/v2/Users/id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift SCIM_deleteASpecificUser_example
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://one.zuora.com/scim/v2/Users/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()
```