> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.vitablehealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.vitablehealth.com/_mcp/server.

# Update

PATCH https://api.vitablehealth.com/v1/groups/{group_id}
Content-Type: application/json

Partially updates a group's name or external reference ID. Returns 404 if the group does not belong to the authenticated organization.

Reference: https://developer.vitablehealth.com/api/groups/update

## Authentication

- `Authorization` header (bearer token, required) — API Key or Access Token authentication using Bearer token in Authorization header. API keys use the vit_apk_ prefix, access tokens use the vit_at_ prefix.

## Servers

- `https://api.vitablehealth.com` (Production, default)
- `https://api.uat.vitablehealth.com` (UAT)

## Request

### Path parameters

- `group_id` (string, required) — Unique group identifier (grp_*)

### Body (application/json)

This endpoint expects a PatchedUpdateGroupRequest.

- `name` (string, optional, nullable) — New display name for the group. Omit to leave unchanged.
- `external_reference_id` (string, optional, nullable) — New external reference ID for the group. Omit to leave unchanged.

## Response

### 200

- `data` (Group, required) — The group record.

## Errors

### 400 Bad Request Error

Bad Request - Invalid input or validation error

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 401 Unauthorized Error

Unauthorized - Invalid or missing API key

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 403 Forbidden Error

Forbidden - Insufficient permissions for this resource

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 404 Not Found Error

Not Found - The requested resource does not exist

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 409 Conflict Error

Conflict - Resource already exists or conflicts with current state

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 422 Unprocessable Entity Error

Unprocessable Entity - Business rule or domain invariant violated

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 429 Too Many Requests Error

Too Many Requests - Rate limit exceeded

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 500 Internal Server Error

Internal Server Error - An unexpected error occurred

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 502 Bad Gateway Error

Bad Gateway - External service error

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

## Types

### Group

- `id` (string, required) — Prefixed group identifier (`grp_<base64-encoded-uuid>`).
- `organization_id` (string, required) — Prefixed organization identifier (`org_<base64-encoded-uuid>`).
- `name` (string, required) — Human-readable group name.
- `external_reference_id` (string, required) — Stable identifier for this group in the integrator's own system.
- `created_at` (datetime, required, nullable) — Group creation timestamp (ISO 8601, UTC).
- `updated_at` (datetime, required, nullable) — Last-update timestamp (ISO 8601, UTC).

## Examples

### Updated Group

**Response**

```json
{
  "data": {
    "id": "grp_abc123def456",
    "organization_id": "org_abc123def456",
    "name": "Tier 1 (renamed)",
    "external_reference_id": "mol_seg_001_v2",
    "created_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-01-16T09:12:00Z"
  }
}
```

**SDK Code**

```python Updated Group
import requests

url = "https://api.vitablehealth.com/v1/groups/grp_abc123def456"

headers = {"Authorization": "Bearer <apiKey>"}

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

print(response.json())
```

```javascript Updated Group
const url = 'https://api.vitablehealth.com/v1/groups/grp_abc123def456';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <apiKey>'}};

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

```go Updated Group
package main

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

func main() {

	url := "https://api.vitablehealth.com/v1/groups/grp_abc123def456"

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

	req.Header.Add("Authorization", "Bearer <apiKey>")

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

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

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

}
```

```ruby Updated Group
require 'uri'
require 'net/http'

url = URI("https://api.vitablehealth.com/v1/groups/grp_abc123def456")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'

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

```java Updated Group
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.vitablehealth.com/v1/groups/grp_abc123def456")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php Updated Group
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.vitablehealth.com/v1/groups/grp_abc123def456', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

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

```csharp Updated Group
using RestSharp;

var client = new RestClient("https://api.vitablehealth.com/v1/groups/grp_abc123def456");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Updated Group
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vitablehealth.com/v1/groups/grp_abc123def456")! 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 Group Request

**Request**

```json
{
  "name": "Tier 1 (renamed)",
  "external_reference_id": "mol_seg_001_v2"
}
```

**Response**

```json
{
  "data": {
    "id": "grp_abc123def456",
    "organization_id": "org_abc123def456",
    "name": "Tier 1 (renamed)",
    "external_reference_id": "mol_seg_001_v2",
    "created_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-01-16T09:12:00Z"
  }
}
```

**SDK Code**

```python Update Group Request
import requests

url = "https://api.vitablehealth.com/v1/groups/grp_abc123def456"

payload = {
    "name": "Tier 1 (renamed)",
    "external_reference_id": "mol_seg_001_v2"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Group Request
const url = 'https://api.vitablehealth.com/v1/groups/grp_abc123def456';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Tier 1 (renamed)","external_reference_id":"mol_seg_001_v2"}'
};

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

```go Update Group Request
package main

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

func main() {

	url := "https://api.vitablehealth.com/v1/groups/grp_abc123def456"

	payload := strings.NewReader("{\n  \"name\": \"Tier 1 (renamed)\",\n  \"external_reference_id\": \"mol_seg_001_v2\"\n}")

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

	req.Header.Add("Authorization", "Bearer <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 Group Request
require 'uri'
require 'net/http'

url = URI("https://api.vitablehealth.com/v1/groups/grp_abc123def456")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Tier 1 (renamed)\",\n  \"external_reference_id\": \"mol_seg_001_v2\"\n}"

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

```java Update Group Request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.vitablehealth.com/v1/groups/grp_abc123def456")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Tier 1 (renamed)\",\n  \"external_reference_id\": \"mol_seg_001_v2\"\n}")
  .asString();
```

```php Update Group Request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.vitablehealth.com/v1/groups/grp_abc123def456', [
  'body' => '{
  "name": "Tier 1 (renamed)",
  "external_reference_id": "mol_seg_001_v2"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Update Group Request
using RestSharp;

var client = new RestClient("https://api.vitablehealth.com/v1/groups/grp_abc123def456");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Tier 1 (renamed)\",\n  \"external_reference_id\": \"mol_seg_001_v2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Group Request
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Tier 1 (renamed)",
  "external_reference_id": "mol_seg_001_v2"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vitablehealth.com/v1/groups/grp_abc123def456")! 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()
```