---
title: Update team
description: Replace the team definition. Use GET to fetch current data if you intend to add fields without overwriting existing values.
product: general
token_estimate: 2677
---
# Update team

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Update team

**PATCH** `/console/v1/users/teams/{id}`

Full URL: `https://statsigapi.net/console/v1/users/teams/{id}`

Update team

Replace the team definition. Use GET to fetch current data if you intend to add fields without overwriting existing values.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id (path) | string | Yes | — | id |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | string | No | — | The name of the team. |
| description | string | No | — | Description of the team. |
| id | string | No | — | The ID of the team. |
| members | string[] | No | — | Array of member email addresses in the team. |
| admins | string[] | No | — | Array of admin email addresses in the team. |
| defaultGateMetrics | object[] | No | — | Default gate metrics for the team. |
| defaultGateMetrics.name | string | Yes | — | The name of the metric. |
| defaultGateMetrics.type | string | Yes | — | The type of the metric. |
| defaultExperimentPrimaryMetrics | object[] | No | — | Default primary metrics for experiments in the team. |
| defaultExperimentPrimaryMetrics.name | string | Yes | — | The name of the metric. |
| defaultExperimentPrimaryMetrics.type | string | Yes | — | The type of the metric. |
| defaultExperimentSecondaryMetrics | object[] | No | — | Default secondary metrics for experiments in the team. |
| defaultExperimentSecondaryMetrics.name | string | Yes | — | The name of the metric. |
| defaultExperimentSecondaryMetrics.type | string | Yes | — | The type of the metric. |
| defaultHoldoutMetrics | object[] | No | — | Default holdout metrics for the team. |
| defaultHoldoutMetrics.name | string | Yes | — | The name of the metric. |
| defaultHoldoutMetrics.type | string | Yes | — | The type of the metric. |
| changeTeamConfigs | string | No | — | Who can change team configurations: "anyone" or "team_only". Allowed values: anyone, team_only |
| reviewApproval | string | No | — | Who can review and approve changes: "anyone", "team_only", or "admin_only". Allowed values: anyone, team_only, admin_only |
| defaultTargetApplications | string[] | No | — | Default target applications for the team. |
| defaultHoldoutID | string | No | — | Default holdout ID for the team, if applicable. Constraints: nullable |
| requireReviews | boolean | No | — | Whether reviews are required for changes, if applicable. Constraints: nullable |
| requireGateTemplates | boolean | No | — | Whether gate templates are required for the team, if applicable. Constraints: nullable |
| requireExperimentTemplates | boolean | No | — | Whether experiment templates are required for the team, if applicable. Constraints: nullable |
| requireDynamicConfigTemplates | boolean | No | — | Whether dynamic config templates are required for the team, if applicable. Constraints: nullable |

## Response (application/json)

**200** — Update team response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.name | string | Yes | — | The name of the team. |
| data.description | string | No | — | Description of the team. |
| data.id | string | Yes | — | The ID of the team. |
| data.defaultGateMetrics | object[] | Yes | — | Default gate metrics for the team. |
| data.defaultGateMetrics.name | string | Yes | — | The name of the metric. |
| data.defaultGateMetrics.type | string | Yes | — | The type of the metric. |
| data.defaultExperimentPrimaryMetrics | object[] | Yes | — | Default primary metrics for experiments in the team. |
| data.defaultExperimentPrimaryMetrics.name | string | Yes | — | The name of the metric. |
| data.defaultExperimentPrimaryMetrics.type | string | Yes | — | The type of the metric. |
| data.defaultExperimentSecondaryMetrics | object[] | Yes | — | Default secondary metrics for experiments in the team. |
| data.defaultExperimentSecondaryMetrics.name | string | Yes | — | The name of the metric. |
| data.defaultExperimentSecondaryMetrics.type | string | Yes | — | The type of the metric. |
| data.defaultHoldoutMetrics | object[] | Yes | — | Default holdout metrics for the team. |
| data.defaultHoldoutMetrics.name | string | Yes | — | The name of the metric. |
| data.defaultHoldoutMetrics.type | string | Yes | — | The type of the metric. |
| data.changeTeamConfigs | string | Yes | — | Who can change team configurations: "anyone" or "team_only". Allowed values: anyone, team_only |
| data.reviewApproval | string | Yes | — | Who can review and approve changes: "anyone", "team_only", or "admin_only". Allowed values: anyone, team_only, admin_only |
| data.defaultTargetApplications | string[] | Yes | — | Default target applications for the team. |
| data.defaultHoldoutID | string | No | — | Default holdout ID for the team, if applicable. Constraints: nullable |
| data.requireReviews | boolean | No | — | Whether reviews are required for changes, if applicable. Constraints: nullable |
| data.requireGateTemplates | boolean | No | — | Whether gate templates are required for the team, if applicable. Constraints: nullable |
| data.requireExperimentTemplates | boolean | No | — | Whether experiment templates are required for the team, if applicable. Constraints: nullable |
| data.requireDynamicConfigTemplates | boolean | No | — | Whether dynamic config templates are required for the team, if applicable. Constraints: nullable |
| data.members | object[] | Yes | — | — |
| data.members.userID | string | Yes | — | The user's unique ID. |
| data.members.email | string | Yes | — | The email address of the user. Constraints: format: email |
| data.members.firstName | string | Yes | — | The user's first name. |
| data.members.lastName | string | Yes | — | The user's last name. |
| data.members.role | string | Yes | — | The user's role, which can be 'Admin', 'Read Only', 'Member', or any custom role name. |
| data.admins | object[] | Yes | — | — |
| data.admins.userID | string | Yes | — | The user's unique ID. |
| data.admins.email | string | Yes | — | The email address of the user. Constraints: format: email |
| data.admins.firstName | string | Yes | — | The user's first name. |
| data.admins.lastName | string | Yes | — | The user's last name. |
| data.admins.role | string | Yes | — | The user's role, which can be 'Admin', 'Read Only', 'Member', or any custom role name. |

```json
{
  "message": "Team updated successfully.",
  "data": {
    "name": "The Avengers",
    "members": [
      {
        "userID": "5sgBiiuoBX4fscrWdCXVma",
        "email": "test@statsig.com",
        "firstName": "test",
        "lastName": "user",
        "role": "admin"
      }
    ],
    "admins": [],
    "defaultGateMetrics": [
      {
        "name": "A metric for asd ",
        "type": "event_count_custom"
      }
    ],
    "defaultExperimentPrimaryMetrics": [
      {
        "name": "A metric for aaaa ",
        "type": "event_count_custom"
      }
    ],
    "defaultExperimentSecondaryMetrics": [],
    "defaultHoldoutMetrics": [],
    "changeTeamConfigs": "anyone",
    "reviewApproval": "anyone",
    "defaultTargetApplications": [
      "Android"
    ]
  }
}
```

**400** — Invalid request. Please check the request input and try again.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 400 |
| message | string | Yes | — | — |

```json
{
  "status": 400,
  "message": "Invalid request. Please check the request input and try again."
}
```

**401** — This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 401 |
| message | string | Yes | — | — |

```json
{
  "status": 401,
  "message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}
```

## Code samples

### cURL

```bash
curl -X PATCH "https://statsigapi.net/console/v1/users/teams/{id}" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.patch(
    "https://statsigapi.net/console/v1/users/teams/{id}",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/users/teams/{id}", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/users/teams/{id}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("PATCH", "https://statsigapi.net/console/v1/users/teams/{id}", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/users/teams/{id}"))
      .method("PATCH", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/users/teams/{id}")
request = Net::HTTP::Patch.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

