> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Manage team member roles

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

Adds or removes member roles in groups, teams, organizations, as well as individual users' roles.

**Note:**

If you remove a role from a group or team, then all members lose the that role's permissions.


Reference: https://learning.postman.com/api-docs/api-reference/teams/manage-team-member-roles

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /teams/{teamId}/bulk-members:
    post:
      operationId: manageTeamMemberRoles
      summary: Manage team member roles
      description: >
        Adds or removes member roles in groups, teams, organizations, as well as
        individual users' roles.


        **Note:**


        If you remove a role from a group or team, then all members lose the
        that role's permissions.
      tags:
        - teams
      parameters:
        - name: teamId
          in: path
          description: The team's ID.
          required: true
          schema:
            $ref: '#/components/schemas/teamId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
        - name: identifierType
          in: header
          description: Use SCIM user and group IDs instead of Postman user IDs.
          required: false
          schema:
            $ref: '#/components/schemas/identifierType'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/manageTeamMemberRolesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ManageTeamMemberRolesRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatusInstance'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/teamsError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/manageTeamMemberRoles'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    teamId:
      type: integer
      title: teamId
    identifierType:
      type: string
      title: identifierType
    teamRoles:
      type: string
      enum:
        - TEAM_MANAGER
        - TEAM_DEVELOPER
        - TEAM_GUEST_DEVELOPER
        - TEAM_GUEST_VIEWER
        - TEAM_PARTNER_MANAGER
        - TEAM_PARTNER_LEAD
        - TEAM_GUEST
        - TEAM_PARTNER
        - TEAM_COMMUNITY_MANAGER
      title: teamRoles
    usersInfo:
      type: object
      properties:
        '{{userId}}':
          type: array
          items:
            $ref: '#/components/schemas/teamRoles'
          description: A list of the user's roles. The array's name is the user's ID.
      title: usersInfo
    userGroupsInfo:
      type: object
      properties:
        '{{userGroupId}}':
          type: array
          items:
            $ref: '#/components/schemas/teamRoles'
          description: >-
            A list of the user group's roles. The array's name is the group's
            ID.
      title: userGroupsInfo
    orgsInfo:
      type: object
      properties:
        '{{orgId}}':
          type: array
          items:
            $ref: '#/components/schemas/teamRoles'
          description: >-
            A list of the organization's roles. The array's name is the
            organization's ID.
      title: orgsInfo
    teamsInfo:
      type: object
      properties:
        '{{teamId}}':
          type: array
          items:
            $ref: '#/components/schemas/teamRoles'
          description: A list of the team's roles. The array's name is the team's ID.
      title: teamsInfo
    manageTeamMemberRolesAdd:
      type: object
      properties:
        users:
          $ref: '#/components/schemas/usersInfo'
        groups:
          $ref: '#/components/schemas/userGroupsInfo'
        orgs:
          $ref: '#/components/schemas/orgsInfo'
        teams:
          $ref: '#/components/schemas/teamsInfo'
      description: Information about the bulk `add` operation.
      title: manageTeamMemberRolesAdd
    manageTeamMemberRolesRemove:
      type: object
      properties:
        users:
          $ref: '#/components/schemas/usersInfo'
        groups:
          $ref: '#/components/schemas/userGroupsInfo'
        orgs:
          $ref: '#/components/schemas/orgsInfo'
        teams:
          $ref: '#/components/schemas/teamsInfo'
      description: Information about the bulk `remove` operation.
      title: manageTeamMemberRolesRemove
    manageTeamMemberRoles:
      type: object
      properties:
        add:
          $ref: '#/components/schemas/manageTeamMemberRolesAdd'
        remove:
          $ref: '#/components/schemas/manageTeamMemberRolesRemove'
      description: Information about the bulk add and bulk remove operations.
      title: manageTeamMemberRoles
    ManageTeamMemberRolesResponseResultItemsEntityId:
      oneOf:
        - type: integer
        - type: string
      description: The entity's ID.
      title: ManageTeamMemberRolesResponseResultItemsEntityId
    ManageTeamMemberRolesResponseResultItems:
      type: object
      properties:
        entityType:
          type: string
          description: The entity type.
        entityId:
          $ref: >-
            #/components/schemas/ManageTeamMemberRolesResponseResultItemsEntityId
          description: The entity's ID.
        role:
          type:
            - string
            - 'null'
          description: The user's role.
        previousRole:
          type:
            - string
            - 'null'
          description: >-
            The user's previous role. This value only returns if the user's role
            is modified.
        status:
          type: string
          description: The request's status.
      title: ManageTeamMemberRolesResponseResultItems
    manageTeamMemberRolesResponse:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/ManageTeamMemberRolesResponseResultItems'
      title: manageTeamMemberRolesResponse
    TeamsErrorDetailError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: TeamsErrorDetailError
    teamsErrorDetail:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TeamsErrorDetailError'
          description: Information about the error.
      description: An explanation about the problem.
      title: teamsErrorDetail
    TeamsErrorDetailInvalidEntriesResultItemsEntityId:
      oneOf:
        - type: integer
        - type: string
      description: The entity ID.
      title: TeamsErrorDetailInvalidEntriesResultItemsEntityId
    TeamsErrorDetailInvalidEntriesResultItems:
      type: object
      properties:
        entityType:
          type: string
          description: The entity type.
        entityId:
          $ref: >-
            #/components/schemas/TeamsErrorDetailInvalidEntriesResultItemsEntityId
          description: The entity ID.
        role:
          type:
            - string
            - 'null'
          description: The assigned role.
        status:
          type: string
          description: The `Invalid` response status.
        reason:
          type: string
          description: The reason for the error.
      title: TeamsErrorDetailInvalidEntriesResultItems
    teamsErrorDetailInvalidEntries:
      type: object
      properties:
        error:
          type: string
          description: The error message.
        result:
          type: array
          items:
            $ref: '#/components/schemas/TeamsErrorDetailInvalidEntriesResultItems'
          description: A list of invalid entities.
      description: An explanation about the problem.
      title: teamsErrorDetailInvalidEntries
    TeamsErrorDetail:
      oneOf:
        - $ref: '#/components/schemas/teamsErrorDetail'
        - $ref: '#/components/schemas/teamsErrorDetailInvalidEntries'
      title: TeamsErrorDetail
    teamsError:
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: >-
            The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that
            identifies the type of problem.
        status:
          type: integer
          description: The HTTP status code generated by the origin server.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/TeamsErrorDetail'
        instance:
          type: string
          description: >-
            The URI reference that identifies the specific occurrence of the
            problem.
      title: teamsError
    commonErrorTypeTitleDetailStatusInstance:
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: >-
            The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that
            identifies the type of problem.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: An explanation about the problem.
        status:
          type: integer
          description: The HTTP status code generated by the origin server.
        instance:
          type: string
          description: >-
            The URI reference that identifies the specific occurrence of the
            problem.
      title: commonErrorTypeTitleDetailStatusInstance
    ManageTeamMemberRolesRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/teamsError'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatusInstance'
      title: ManageTeamMemberRolesRequestBadRequestError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### Assign Team Member's Role



**Request**

```json
{
  "add": {
    "users": {
      "12345678": [
        "TEAM_MANAGER"
      ]
    },
    "groups": {
      "1234": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "user",
      "entityId": 12345678,
      "role": "TEAM_MANAGER",
      "previousRole": null,
      "status": "Accepted"
    },
    {
      "entityType": "group",
      "entityId": 1234,
      "role": "TEAM_DEVELOPER",
      "previousRole": null,
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Assign Team Member's Role
import requests

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

payload = { "add": {
        "users": { "12345678": ["TEAM_MANAGER"] },
        "groups": { "1234": ["TEAM_DEVELOPER"] }
    } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Assign Team Member's Role
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"users":{"12345678":["TEAM_MANAGER"]},"groups":{"1234":["TEAM_DEVELOPER"]}}}'
};

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

```go Assign Team Member's Role
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    },\n    \"groups\": {\n      \"1234\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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 Assign Team Member's Role
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    },\n    \"groups\": {\n      \"1234\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

```java Assign Team Member's Role
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    },\n    \"groups\": {\n      \"1234\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

```php Assign Team Member's Role
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "users": {
      "12345678": [
        "TEAM_MANAGER"
      ]
    },
    "groups": {
      "1234": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Assign Team Member's Role
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    },\n    \"groups\": {\n      \"1234\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Assign Team Member's Role
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["add": [
    "users": ["12345678": ["TEAM_MANAGER"]],
    "groups": ["1234": ["TEAM_DEVELOPER"]]
  ]] as [String : Any]

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

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

### Update Team Member's Role



**Request**

```json
{
  "add": {
    "users": {
      "12345678": [
        "TEAM_MANAGER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "user",
      "entityId": 12345678,
      "role": "TEAM_MANAGER",
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Update Team Member's Role
import requests

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

payload = { "add": { "users": { "12345678": ["TEAM_MANAGER"] } } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Team Member's Role
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"users":{"12345678":["TEAM_MANAGER"]}}}'
};

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

```go Update Team Member's Role
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  }\n}")

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

	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 Update Team Member's Role
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  }\n}"

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

```java Update Team Member's Role
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  }\n}")
  .asString();
```

```php Update Team Member's Role
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "users": {
      "12345678": [
        "TEAM_MANAGER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Team Member's Role
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Team Member's Role
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["add": ["users": ["12345678": ["TEAM_MANAGER"]]]] as [String : Any]

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

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

### Update Team Organization's Role



**Request**

```json
{
  "add": {
    "orgs": {
      "432": [
        "TEAM_GUEST_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "organization",
      "entityId": 345,
      "role": "TEAM_GUEST_DEVELOPER",
      "previousRole": "TEAM_GUEST_VIEWER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Update Team Organization's Role
import requests

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

payload = { "add": { "orgs": { "432": ["TEAM_GUEST_DEVELOPER"] } } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Team Organization's Role
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"orgs":{"432":["TEAM_GUEST_DEVELOPER"]}}}'
};

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

```go Update Team Organization's Role
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"orgs\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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 Update Team Organization's Role
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"orgs\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

```java Update Team Organization's Role
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"orgs\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

```php Update Team Organization's Role
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "orgs": {
      "432": [
        "TEAM_GUEST_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Team Organization's Role
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"add\": {\n    \"orgs\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Team Organization's Role
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["add": ["orgs": ["432": ["TEAM_GUEST_DEVELOPER"]]]] as [String : Any]

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

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

### Update Team Role



**Request**

```json
{
  "add": {
    "teams": {
      "432": [
        "TEAM_GUEST_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "team",
      "entityId": 432,
      "role": "TEAM_GUEST_DEVELOPER",
      "previousRole": "TEAM_GUEST_VIEWER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Update Team Role
import requests

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

payload = { "add": { "teams": { "432": ["TEAM_GUEST_DEVELOPER"] } } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Team Role
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"teams":{"432":["TEAM_GUEST_DEVELOPER"]}}}'
};

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

```go Update Team Role
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"teams\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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 Update Team Role
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"teams\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"teams\": {\n      \"432\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "teams": {
      "432": [
        "TEAM_GUEST_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Team Role
using RestSharp;

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

```swift Update Team Role
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["add": ["teams": ["432": ["TEAM_GUEST_DEVELOPER"]]]] as [String : Any]

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

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

### Update Team Member's Role with SCIM ID



**Request**

```json
{
  "add": {
    "teams": {
      "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": [
        "TEAM_GUEST_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "user",
      "entityId": "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86",
      "role": "TEAM_MANAGER",
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Update Team Member's Role with SCIM ID
import requests

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

payload = { "add": { "teams": { "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": ["TEAM_GUEST_DEVELOPER"] } } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Team Member's Role with SCIM ID
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"teams":{"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86":["TEAM_GUEST_DEVELOPER"]}}}'
};

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

```go Update Team Member's Role with SCIM ID
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"teams\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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 Update Team Member's Role with SCIM ID
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"teams\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

```java Update Team Member's Role with SCIM ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"teams\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

```php Update Team Member's Role with SCIM ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "teams": {
      "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": [
        "TEAM_GUEST_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Team Member's Role with SCIM ID
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"add\": {\n    \"teams\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_GUEST_DEVELOPER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Team Member's Role with SCIM ID
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["add": ["teams": ["f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": ["TEAM_GUEST_DEVELOPER"]]]] as [String : Any]

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

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



**Request**

```json
{
  "remove": {
    "users": {
      "12345678": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "user",
      "entityId": 12345678,
      "role": null,
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Remove Team Member's Role
import requests

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

payload = { "remove": { "users": { "12345678": ["TEAM_DEVELOPER"] } } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Team Member's Role
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"remove":{"users":{"12345678":["TEAM_DEVELOPER"]}}}'
};

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

```go Remove Team Member's Role
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"remove\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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's Role
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"remove\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

```java Remove Team Member's Role
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"remove\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "remove": {
    "users": {
      "12345678": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Team Member's Role
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"remove\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Team Member's Role
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["remove": ["users": ["12345678": ["TEAM_DEVELOPER"]]]] as [String : Any]

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

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

### Add and Remove Roles



**Request**

```json
{
  "add": {
    "users": {
      "12345678": [
        "TEAM_MANAGER"
      ]
    }
  },
  "remove": {
    "users": {
      "87654321": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "user",
      "entityId": 12345678,
      "role": "TEAM_MANAGER",
      "previousRole": null,
      "status": "Accepted"
    },
    {
      "entityType": "user",
      "entityId": 87654321,
      "role": null,
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Add and Remove Roles
import requests

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

payload = {
    "add": { "users": { "12345678": ["TEAM_MANAGER"] } },
    "remove": { "users": { "87654321": ["TEAM_DEVELOPER"] } }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add and Remove Roles
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"users":{"12345678":["TEAM_MANAGER"]}},"remove":{"users":{"87654321":["TEAM_DEVELOPER"]}}}'
};

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

```go Add and Remove Roles
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"87654321\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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 Add and Remove Roles
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"87654321\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

```java Add and Remove Roles
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"87654321\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

```php Add and Remove Roles
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "users": {
      "12345678": [
        "TEAM_MANAGER"
      ]
    }
  },
  "remove": {
    "users": {
      "87654321": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Add and Remove Roles
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"add\": {\n    \"users\": {\n      \"12345678\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"87654321\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add and Remove Roles
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "add": ["users": ["12345678": ["TEAM_MANAGER"]]],
  "remove": ["users": ["87654321": ["TEAM_DEVELOPER"]]]
] as [String : Any]

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

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

### Add and Remove Roles with SCIM IDs



**Request**

```json
{
  "add": {
    "users": {
      "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": [
        "TEAM_MANAGER"
      ]
    }
  },
  "remove": {
    "users": {
      "7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640": [
        "TEAM_DEVELOPER"
      ]
    },
    "groups": {
      "gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}
```

**Response**

```json
{
  "result": [
    {
      "entityType": "user",
      "entityId": "3c83d7cddf8470c6e5fb1cb52586a98d0d4200781107c535",
      "role": "TEAM_MANAGER",
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    },
    {
      "entityType": "group",
      "entityId": "gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87",
      "role": null,
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    },
    {
      "entityType": "user",
      "entityId": "7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640",
      "role": null,
      "previousRole": "TEAM_DEVELOPER",
      "status": "Accepted"
    }
  ]
}
```

**SDK Code**

```python Add and Remove Roles with SCIM IDs
import requests

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

payload = {
    "add": { "users": { "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": ["TEAM_MANAGER"] } },
    "remove": {
        "users": { "7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640": ["TEAM_DEVELOPER"] },
        "groups": { "gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87": ["TEAM_DEVELOPER"] }
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Add and Remove Roles with SCIM IDs
const url = 'https://api.getpostman.com/teams/123/bulk-members';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"add":{"users":{"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86":["TEAM_MANAGER"]}},"remove":{"users":{"7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640":["TEAM_DEVELOPER"]},"groups":{"gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87":["TEAM_DEVELOPER"]}}}'
};

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

```go Add and Remove Roles with SCIM IDs
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"add\": {\n    \"users\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    },\n    \"groups\": {\n      \"gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")

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

	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 Add and Remove Roles with SCIM IDs
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"add\": {\n    \"users\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    },\n    \"groups\": {\n      \"gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}"

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

```java Add and Remove Roles with SCIM IDs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/teams/123/bulk-members")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"add\": {\n    \"users\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    },\n    \"groups\": {\n      \"gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}")
  .asString();
```

```php Add and Remove Roles with SCIM IDs
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/teams/123/bulk-members', [
  'body' => '{
  "add": {
    "users": {
      "f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": [
        "TEAM_MANAGER"
      ]
    }
  },
  "remove": {
    "users": {
      "7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640": [
        "TEAM_DEVELOPER"
      ]
    },
    "groups": {
      "gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87": [
        "TEAM_DEVELOPER"
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Add and Remove Roles with SCIM IDs
using RestSharp;

var client = new RestClient("https://api.getpostman.com/teams/123/bulk-members");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"add\": {\n    \"users\": {\n      \"f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86\": [\n        \"TEAM_MANAGER\"\n      ]\n    }\n  },\n  \"remove\": {\n    \"users\": {\n      \"7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    },\n    \"groups\": {\n      \"gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87\": [\n        \"TEAM_DEVELOPER\"\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add and Remove Roles with SCIM IDs
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "add": ["users": ["f10ba7a8dac248e8fd9769163dc63aef920f3897c7ea2c86": ["TEAM_MANAGER"]]],
  "remove": [
    "users": ["7db6e2fba7e98f9db428a1735a71bbb4e4fbbaa37db37640": ["TEAM_DEVELOPER"]],
    "groups": ["gecb77b6c45c98602d6ae4458b46d4f30e3c423719636d87": ["TEAM_DEVELOPER"]]
  ]
] as [String : Any]

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

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