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

# Update a team

PATCH https://api.postman.com/teams/{teamId}
Content-Type: application/merge-patch+json

Updates a Postman team's name in your organization.

**Note:**

You can only update the team's `name`. The name must be unique in the organization. This endpoint is only available to organizations that have teams enabled.

This endpoint requires the `application/merge-patch+json` Content-Type header.


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

## 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/merge-patch+json)

This endpoint expects an updateTeam.

- `name` (string, required) — The team's new name. Accepts only alphanumeric characters and spaces, and must be unique in the organization.

## Response

### 200

Successful Response

- `team` (CreateGetTeamResponseTeam, optional) — Information about the team.

## Errors

### 400 Bad Request Error

Bad Request

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

### 404 Not Found Error

Not Found

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

### CreateGetTeamResponseTeam

Information about the team.

- `createdAt` (datetime, optional) — The date and time at which the team was created.
- `updatedAt` (datetime, optional) — The date and time at which the team was last updated.
- `id` (integer, optional) — The team's ID.
- `name` (string, optional) — The team's name.
- `handle` (string, optional) — The team's handle.
- `description` (string, optional) — A description about the team.
- `organizationId` (integer, optional) — The team's organization ID.
- `createdBy` (CreateGetTeamResponseTeamCreatedBy, optional) — The user ID of the user who created the team.
- `enabled` (boolean, optional) — If true, the team is active.

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

### CreateGetTeamResponseTeamCreatedBy

The user ID of the user who created the team.

- 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

### Successful Response

**Response**

```json
{
  "team": {
    "createdAt": "2025-02-26T08:17:42.000Z",
    "updatedAt": "2025-02-26T08:17:42.000Z",
    "id": 123,
    "name": "Testing Team",
    "handle": "testing-team",
    "description": "API testing team.",
    "organizationId": 1,
    "createdBy": 12345678,
    "enabled": true
  }
}
```

**SDK Code**

```python Successful Response
import requests

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

headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>"
}

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.postman.com/teams/123';
const options = {method: 'PATCH', headers: {identifierType: 'scim', 'x-api-key': '<apiKey>'}};

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.postman.com/teams/123"

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")

	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.postman.com/teams/123")

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

request = Net::HTTP::Patch.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'

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.postman.com/teams/123")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.postman.com/teams/123', [
  'headers' => [
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123");
var request = new RestRequest(Method.PATCH);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = [
  "identifierType": "scim",
  "x-api-key": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123")! 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()
```

### Update a Team

**Request**

```json
{
  "name": "Testing Team"
}
```

**Response**

```json
{
  "team": {
    "createdAt": "2025-02-26T08:17:42.000Z",
    "updatedAt": "2025-02-26T08:17:42.000Z",
    "id": 123,
    "name": "Testing Team",
    "handle": "testing-team",
    "description": "API testing team.",
    "organizationId": 1,
    "createdBy": 12345678,
    "enabled": true
  }
}
```

**SDK Code**

```python Update a Team
import requests

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

payload = "{\n  \"name\": \"Testing Team\"\n}"
headers = {
    "identifierType": "scim",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/merge-patch+json"
}

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

print(response.json())
```

```javascript Update a Team
const url = 'https://api.postman.com/teams/123';
const options = {
  method: 'PATCH',
  headers: {
    identifierType: 'scim',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/merge-patch+json'
  },
  body: '{\n  "name": "Testing Team"\n}'
};

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

```go Update a Team
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"Testing Team\"\n}")

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

	req.Header.Add("identifierType", "scim")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/merge-patch+json")

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

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

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

}
```

```ruby Update a Team
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Patch.new(url)
request["identifierType"] = 'scim'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/merge-patch+json'
request.body = "{\n  \"name\": \"Testing Team\"\n}"

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

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

HttpResponse<String> response = Unirest.patch("https://api.postman.com/teams/123")
  .header("identifierType", "scim")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/merge-patch+json")
  .body("{\n  \"name\": \"Testing Team\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.postman.com/teams/123', [
  'body' => '{
  "name": "Testing Team"
}',
  'headers' => [
    'Content-Type' => 'application/merge-patch+json',
    'identifierType' => 'scim',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update a Team
using RestSharp;

var client = new RestClient("https://api.postman.com/teams/123");
var request = new RestRequest(Method.PATCH);
request.AddHeader("identifierType", "scim");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/merge-patch+json");
request.AddParameter("application/merge-patch+json", "{\n  \"name\": \"Testing Team\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update a Team
import Foundation

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

let postData = NSData(data: "{
  "name": "Testing Team"
}".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/teams/123")! 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()
```