> This page is for Postman API Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Remove team members

DELETE https://api.postman.com/teams/{teamId}/bulk-members
Content-Type: application/json

Removes entities, such as users or organizations, from your Postman team. On success, this returns an HTTP `204 No Content` response.

Reference: https://learning.postman.com/api-docs/api-reference/teams/remove-team-members

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Path parameters

- `teamId` (integer, required) — The team's ID.

### Headers

- `identifierType` (string, optional) — Use SCIM user and group IDs instead of Postman user IDs.

### Body (application/json)

This endpoint expects a removeTeamMembers.

- `entities` (list of teamEntityInfo, optional) — A list of entities to remove.

## Response

### 204

Remove Team Member

## Errors

### 400 Bad Request Error

Bad Request

- `RemoveTeamMembersRequestBadRequestError`
  - Teams API Error Schema: teamsError
  - Error (Type, Title, Detail, Status, Instance): commonErrorTypeTitleDetailStatusInstance

### 401 Unauthorized Error

Unauthorized

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### 403 Forbidden Error

Forbidden

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `title` (string, optional) — A short summary of the problem.
- `detail` (TeamsErrorDetail, optional) — Information about the error.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### 500 Internal Server Error

Internal Server Error

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `title` (string, optional) — A short summary of the problem.
- `detail` (TeamsErrorDetail, optional) — Information about the error.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

## Types

### teamEntityInfo

- `entityType` (enum, required) — The entity type.
  - Allowed values: `user`, `group`, `team`, `organization`
- `entityId` (TeamEntityInfoEntityId, required) — The entity's ID.

### teamsError

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `title` (string, optional) — A short summary of the problem.
- `detail` (TeamsErrorDetail, optional) — Information about the error.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### commonErrorTypeTitleDetailStatusInstance

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### TeamsErrorDetail

Information about the error.

- Error Details: teamsErrorDetail
- Invalid Entries for Manage Team Member Roles: teamsErrorDetailInvalidEntries

### TeamEntityInfoEntityId

The entity's ID.

- integer
- string

### teamsErrorDetail

An explanation about the problem.

- `error` (TeamsErrorDetailError, optional) — Information about the error.

### teamsErrorDetailInvalidEntries

An explanation about the problem.

- `error` (string, optional) — The error message.
- `result` (list of TeamsErrorDetailInvalidEntriesResultItems, optional) — A list of invalid entities.

### TeamsErrorDetailError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### TeamsErrorDetailInvalidEntriesResultItems

- `entityType` (string, optional) — The entity type.
- `entityId` (TeamsErrorDetailInvalidEntriesResultItemsEntityId, optional) — The entity ID.
- `role` (string, optional, nullable) — The assigned role.
- `status` (string, optional) — The `Invalid` response status.
- `reason` (string, optional) — The reason for the error.

### TeamsErrorDetailInvalidEntriesResultItemsEntityId

The entity ID.

- integer
- string

## Examples

### Remove Team Members

**Request**

```json
{
  "entities": [
    {
      "entityType": "user",
      "entityId": "87654321"
    },
    {
      "entityType": "user",
      "entityId": "56781234"
    }
  ]
}
```

**SDK Code**

```python Remove Team Members
import requests

url = "https://api.postman.com/teams/123/bulk-members"

payload = { "entities": [
        {
            "entityType": "user",
            "entityId": "87654321"
        },
        {
            "entityType": "user",
            "entityId": "56781234"
        }
    ] }
headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Team Members
const url = 'https://api.postman.com/teams/123/bulk-members';
const options = {
  method: 'DELETE',
  headers: {
    identifierType: 'scim',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"entities":[{"entityType":"user","entityId":"87654321"},{"entityType":"user","entityId":"56781234"}]}'
};

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

```go Remove Team Members
package main

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

func main() {

	url := "https://api.postman.com/teams/123/bulk-members"

	payload := strings.NewReader("{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"87654321\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"56781234\"\n    }\n  ]\n}")

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")
	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 Remove Team Members
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/teams/123/bulk-members")

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

request = Net::HTTP::Delete.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"87654321\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"56781234\"\n    }\n  ]\n}"

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

```java Remove Team Members
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.postman.com/teams/123/bulk-members")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"87654321\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"56781234\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.postman.com/teams/123/bulk-members', [
  'body' => '{
  "entities": [
    {
      "entityType": "user",
      "entityId": "87654321"
    },
    {
      "entityType": "user",
      "entityId": "56781234"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Team Members
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123/bulk-members");
var request = new RestRequest(Method.DELETE);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"87654321\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"56781234\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Team Members
import Foundation

let headers = [
  "identifierType": "scim",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["entities": [
    [
      "entityType": "user",
      "entityId": "87654321"
    ],
    [
      "entityType": "user",
      "entityId": "56781234"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123/bulk-members")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```

### Remove Organization

**Request**

```json
{
  "entities": [
    {
      "entityType": "organization",
      "entityId": "456"
    }
  ]
}
```

**SDK Code**

```python Remove Organization
import requests

url = "https://api.postman.com/teams/123/bulk-members"

payload = { "entities": [
        {
            "entityType": "organization",
            "entityId": "456"
        }
    ] }
headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Organization
const url = 'https://api.postman.com/teams/123/bulk-members';
const options = {
  method: 'DELETE',
  headers: {
    identifierType: 'scim',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"entities":[{"entityType":"organization","entityId":"456"}]}'
};

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

```go Remove Organization
package main

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

func main() {

	url := "https://api.postman.com/teams/123/bulk-members"

	payload := strings.NewReader("{\n  \"entities\": [\n    {\n      \"entityType\": \"organization\",\n      \"entityId\": \"456\"\n    }\n  ]\n}")

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")
	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 Remove Organization
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/teams/123/bulk-members")

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

request = Net::HTTP::Delete.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entities\": [\n    {\n      \"entityType\": \"organization\",\n      \"entityId\": \"456\"\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.delete("https://api.postman.com/teams/123/bulk-members")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entities\": [\n    {\n      \"entityType\": \"organization\",\n      \"entityId\": \"456\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.postman.com/teams/123/bulk-members', [
  'body' => '{
  "entities": [
    {
      "entityType": "organization",
      "entityId": "456"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Organization
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123/bulk-members");
var request = new RestRequest(Method.DELETE);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entities\": [\n    {\n      \"entityType\": \"organization\",\n      \"entityId\": \"456\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Organization
import Foundation

let headers = [
  "identifierType": "scim",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["entities": [
    [
      "entityType": "organization",
      "entityId": "456"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123/bulk-members")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```

### Remove Team

**Request**

```json
{
  "entities": [
    {
      "entityType": "team",
      "entityId": "432"
    }
  ]
}
```

**SDK Code**

```python Remove Team
import requests

url = "https://api.postman.com/teams/123/bulk-members"

payload = { "entities": [
        {
            "entityType": "team",
            "entityId": "432"
        }
    ] }
headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Team
const url = 'https://api.postman.com/teams/123/bulk-members';
const options = {
  method: 'DELETE',
  headers: {
    identifierType: 'scim',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"entities":[{"entityType":"team","entityId":"432"}]}'
};

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

```go Remove Team
package main

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

func main() {

	url := "https://api.postman.com/teams/123/bulk-members"

	payload := strings.NewReader("{\n  \"entities\": [\n    {\n      \"entityType\": \"team\",\n      \"entityId\": \"432\"\n    }\n  ]\n}")

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")
	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 Remove Team
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/teams/123/bulk-members")

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

request = Net::HTTP::Delete.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entities\": [\n    {\n      \"entityType\": \"team\",\n      \"entityId\": \"432\"\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.delete("https://api.postman.com/teams/123/bulk-members")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entities\": [\n    {\n      \"entityType\": \"team\",\n      \"entityId\": \"432\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.postman.com/teams/123/bulk-members', [
  'body' => '{
  "entities": [
    {
      "entityType": "team",
      "entityId": "432"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Team
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123/bulk-members");
var request = new RestRequest(Method.DELETE);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entities\": [\n    {\n      \"entityType\": \"team\",\n      \"entityId\": \"432\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Team
import Foundation

let headers = [
  "identifierType": "scim",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["entities": [
    [
      "entityType": "team",
      "entityId": "432"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123/bulk-members")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```

### Remove Team Member with SCIM IDs

**Request**

```json
{
  "entities": [
    {
      "entityType": "user",
      "entityId": "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86"
    },
    {
      "entityType": "user",
      "entityId": "696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13"
    }
  ]
}
```

**SDK Code**

```python Remove Team Member with SCIM IDs
import requests

url = "https://api.postman.com/teams/123/bulk-members"

payload = { "entities": [
        {
            "entityType": "user",
            "entityId": "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86"
        },
        {
            "entityType": "user",
            "entityId": "696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13"
        }
    ] }
headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Team Member with SCIM IDs
const url = 'https://api.postman.com/teams/123/bulk-members';
const options = {
  method: 'DELETE',
  headers: {
    identifierType: 'scim',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"entities":[{"entityType":"user","entityId":"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86"},{"entityType":"user","entityId":"696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13"}]}'
};

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

```go Remove Team Member with SCIM IDs
package main

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

func main() {

	url := "https://api.postman.com/teams/123/bulk-members"

	payload := strings.NewReader("{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13\"\n    }\n  ]\n}")

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")
	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 Remove Team Member with SCIM IDs
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/teams/123/bulk-members")

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

request = Net::HTTP::Delete.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13\"\n    }\n  ]\n}"

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

```java Remove Team Member with SCIM IDs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.postman.com/teams/123/bulk-members")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13\"\n    }\n  ]\n}")
  .asString();
```

```php Remove Team Member with SCIM IDs
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.postman.com/teams/123/bulk-members', [
  'body' => '{
  "entities": [
    {
      "entityType": "user",
      "entityId": "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86"
    },
    {
      "entityType": "user",
      "entityId": "696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Team Member with SCIM IDs
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123/bulk-members");
var request = new RestRequest(Method.DELETE);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\"\n    },\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Team Member with SCIM IDs
import Foundation

let headers = [
  "identifierType": "scim",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["entities": [
    [
      "entityType": "user",
      "entityId": "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86"
    ],
    [
      "entityType": "user",
      "entityId": "696e7061fe5aa0e7abb54851cdb0e3b21eed4f8daef24d13"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123/bulk-members")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```

### Remove User and Group Team Members

**Request**

```json
{
  "entities": [
    {
      "entityType": "user",
      "entityId": "12345678"
    },
    {
      "entityType": "group",
      "entityId": "1234"
    }
  ]
}
```

**SDK Code**

```python Remove User and Group Team Members
import requests

url = "https://api.postman.com/teams/123/bulk-members"

payload = { "entities": [
        {
            "entityType": "user",
            "entityId": "12345678"
        },
        {
            "entityType": "group",
            "entityId": "1234"
        }
    ] }
headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove User and Group Team Members
const url = 'https://api.postman.com/teams/123/bulk-members';
const options = {
  method: 'DELETE',
  headers: {
    identifierType: 'scim',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"entities":[{"entityType":"user","entityId":"12345678"},{"entityType":"group","entityId":"1234"}]}'
};

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

```go Remove User and Group Team Members
package main

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

func main() {

	url := "https://api.postman.com/teams/123/bulk-members"

	payload := strings.NewReader("{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"12345678\"\n    },\n    {\n      \"entityType\": \"group\",\n      \"entityId\": \"1234\"\n    }\n  ]\n}")

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")
	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 Remove User and Group Team Members
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/teams/123/bulk-members")

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

request = Net::HTTP::Delete.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"12345678\"\n    },\n    {\n      \"entityType\": \"group\",\n      \"entityId\": \"1234\"\n    }\n  ]\n}"

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

```java Remove User and Group Team Members
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.postman.com/teams/123/bulk-members")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"12345678\"\n    },\n    {\n      \"entityType\": \"group\",\n      \"entityId\": \"1234\"\n    }\n  ]\n}")
  .asString();
```

```php Remove User and Group Team Members
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.postman.com/teams/123/bulk-members', [
  'body' => '{
  "entities": [
    {
      "entityType": "user",
      "entityId": "12345678"
    },
    {
      "entityType": "group",
      "entityId": "1234"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove User and Group Team Members
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123/bulk-members");
var request = new RestRequest(Method.DELETE);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entities\": [\n    {\n      \"entityType\": \"user\",\n      \"entityId\": \"12345678\"\n    },\n    {\n      \"entityType\": \"group\",\n      \"entityId\": \"1234\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove User and Group Team Members
import Foundation

let headers = [
  "identifierType": "scim",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["entities": [
    [
      "entityType": "user",
      "entityId": "12345678"
    ],
    [
      "entityType": "group",
      "entityId": "1234"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123/bulk-members")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```