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

# Transfer workspace to a team

PATCH https://api.getpostman.com/workspaces/{workspaceId}/transfers
Content-Type: application/json

Transfers a workspace from one team (`source`) to another team (`destination`).

**Note:**

- These endpoints are only available with [Postman **Enterprise** plans](https://www.postman.com/pricing/) with [Postman Organizations](https://learning.postman.com/docs/administration/onboarding-checklist) enabled.
- Team user roles are modified when workspaces are transferred. For example, if a user has the Admin role in the `source` team but not the `destination` team, then their role is removed from the workspace after it's transferred to the `destination` team.


Reference: https://learning.postman.com/api-docs/api-reference/workspaces/transfer-workspace-to-team

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /workspaces/{workspaceId}/transfers:
    patch:
      operationId: transferWorkspaceToTeam
      summary: Transfer workspace to a team
      description: >
        Transfers a workspace from one team (`source`) to another team
        (`destination`).


        **Note:**


        - These endpoints are only available with [Postman **Enterprise**
        plans](https://www.postman.com/pricing/) with [Postman
        Organizations](https://learning.postman.com/docs/administration/onboarding-checklist)
        enabled.

        - Team user roles are modified when workspaces are transferred. For
        example, if a user has the Admin role in the `source` team but not the
        `destination` team, then their role is removed from the workspace after
        it's transferred to the `destination` team.
      tags:
        - workspaces
      parameters:
        - name: workspaceId
          in: path
          description: The workspace's ID.
          required: true
          schema:
            $ref: '#/components/schemas/workspaceId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transferWorkspaceToTeamResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/transferWorkspaceToTeam'
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:
    workspaceId:
      type: string
      title: workspaceId
    transferWorkspaceToTeam:
      type: object
      properties:
        destination:
          type: string
          description: The ID of the team to transfer the workspace to.
        source:
          type: string
          description: The ID of the team to transfer the workspace from.
      required:
        - destination
        - source
      title: transferWorkspaceToTeam
    transferWorkspaceToTeamResponseObject:
      type: object
      properties:
        id:
          type: string
          description: The ID of the transferred workspace.
        source:
          type: string
          description: The ID of the team the workspace was transferred away from.
        destination:
          type: string
          description: The ID of the team that the workspace was transferred to.
      description: Information about the workspace transfer.
      title: transferWorkspaceToTeamResponseObject
    TransferWorkspaceToTeamResponseWorkspace:
      type: object
      properties:
        transfer:
          $ref: '#/components/schemas/transferWorkspaceToTeamResponseObject'
      title: TransferWorkspaceToTeamResponseWorkspace
    transferWorkspaceToTeamResponse:
      type: object
      properties:
        workspace:
          $ref: '#/components/schemas/TransferWorkspaceToTeamResponseWorkspace'
      title: transferWorkspaceToTeamResponse
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
  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

### Successful Response



**Request**

```json
undefined
```

**Response**

```json
{
  "workspace": {
    "transfer": {
      "id": "8b6ea58b-fd33-4678-bdab-67734b3ed6b0",
      "source": "d56bc95f-57c5-47cc-bd99-75c4ad96a6dd",
      "destination": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
    }
  }
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Successful Response
package main

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

func main() {

	url := "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers"

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

	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 Successful Response
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

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

```java Successful Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Transfer Workspace to Team



**Request**

```json
{
  "destination": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
  "source": "d56bc95f-57c5-47cc-bd99-75c4ad96a6dd"
}
```

**Response**

```json
{
  "workspace": {
    "transfer": {
      "id": "8b6ea58b-fd33-4678-bdab-67734b3ed6b0",
      "source": "d56bc95f-57c5-47cc-bd99-75c4ad96a6dd",
      "destination": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
    }
  }
}
```

**SDK Code**

```python Transfer Workspace to Team
import requests

url = "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers"

payload = {
    "destination": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
    "source": "d56bc95f-57c5-47cc-bd99-75c4ad96a6dd"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Transfer Workspace to Team
const url = 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"destination":"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9","source":"d56bc95f-57c5-47cc-bd99-75c4ad96a6dd"}'
};

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

```go Transfer Workspace to Team
package main

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

func main() {

	url := "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers"

	payload := strings.NewReader("{\n  \"destination\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\",\n  \"source\": \"d56bc95f-57c5-47cc-bd99-75c4ad96a6dd\"\n}")

	req, _ := http.NewRequest("PATCH", 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 Transfer Workspace to Team
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"destination\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\",\n  \"source\": \"d56bc95f-57c5-47cc-bd99-75c4ad96a6dd\"\n}"

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

```java Transfer Workspace to Team
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"destination\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\",\n  \"source\": \"d56bc95f-57c5-47cc-bd99-75c4ad96a6dd\"\n}")
  .asString();
```

```php Transfer Workspace to Team
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers', [
  'body' => '{
  "destination": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
  "source": "d56bc95f-57c5-47cc-bd99-75c4ad96a6dd"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Transfer Workspace to Team
using RestSharp;

var client = new RestClient("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"destination\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\",\n  \"source\": \"d56bc95f-57c5-47cc-bd99-75c4ad96a6dd\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Transfer Workspace to Team
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "destination": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
  "source": "d56bc95f-57c5-47cc-bd99-75c4ad96a6dd"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9/transfers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```