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

# Update a resource group

PATCH https://api.usepassport.ai/public/v1/resource-groups/{resourceGroupId}
Content-Type: application/json

Update a resource group. Admin only.

Reference: https://docs.usepassport.ai/api-reference/resource-groups/update-resource-group

## Authentication

- `Authorization` header (bearer token, required) — WorkOS API key (Authorization: Bearer sk_...). Scope comes from the key's permissions: a key carrying `passport:admin` has admin scope (full catalog CRUD), any other key has member scope (reads + access requests). Organization-owned keys are admin by ownership and carry no associated user; keys minted for a user carry theirs, which is what access requests and `createdBy` are attributed to.

## Request

### Path parameters

- `resourceGroupId` (string, required)

### Body (application/json)

This endpoint expects a ResourceGroupUpdate.

- `name` (string, optional)
- `description` (string, optional, nullable)
- `source` (string, optional, nullable)
- `metadata` (map from string to any, optional, nullable) — Arbitrary JSON object, or null.

## Response

### 200

OK

- `data` (ResourceGroup, required)

## Errors

### 400 Bad Request Error

The request body or query is invalid.

- `error` (ErrorError, required)

### 401 Unauthorized Error

Missing or invalid API key. Unlike every other response, this one carries no `RateLimit-*` headers: the request is rejected before a key is resolved, so there is no per-key window to report. Rejection happens at the gateway, which renders this same schema (and negotiates `application/problem+json` identically).

- `error` (ErrorError, required)

### 403 Forbidden Error

Authenticated but lacking required role (e.g. member key on a catalog mutation).

- `error` (ErrorError, required)

### 404 Not Found Error

Resource group not found.

- `error` (ErrorError, required)

### 429 Too Many Requests Error

Rate limit exceeded.

- `error` (ErrorError, required)

### 500 Internal Server Error

Unexpected server error.

- `error` (ErrorError, required)

### 503 Service Unavailable Error

Temporary unavailability (auth dependency down, encryption-config resolution failure, or discovery document unloadable).

- `error` (ErrorError, required)

## Types

### ResourceGroup

- `id` (string, optional)
- `namespaceId` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `source` (string, optional, nullable)
- `metadata` (map from string to any, optional, nullable) — Arbitrary JSON object, or null.

### ErrorError

- `code` (enum, required) — The machine-readable failure reason. Treat a value not listed here as a generic failure of the class implied by the HTTP status, and do not assume retry behaviour for it — new codes may be added.
  - Allowed values: `VALIDATION_ERROR`, `MALFORMED_JSON`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `CONFLICT`, `UNPROCESSABLE_ENTITY`, `PAYLOAD_TOO_LARGE`, `RATE_LIMITED`, `INTERNAL_ERROR`, `SERVICE_UNAVAILABLE`
- `message` (string, required)
- `details` (list of FieldError, optional)

### FieldError

- `field` (string, optional)
- `message` (string, optional)

## Examples

**Request**

```json
{
  "name": "Payments APIs (v2)",
  "description": "Renamed group"
}
```

**Response**

```json
{
  "data": {
    "id": "a1b2c3d4-1111-2222-3333-444455556666",
    "namespaceId": "3f7c2b6e-1c2d-4a5b-9e8f-0a1b2c3d4e5f",
    "name": "Payments",
    "description": "Updated",
    "createdAt": "2026-01-15T12:00:00.000Z",
    "updatedAt": "2026-01-16T09:00:00.000Z"
  }
}
```

**SDK Code**

```python default
import requests

url = "https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId"

payload = {
    "name": "Payments APIs (v2)",
    "description": "Renamed group"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript default
const url = 'https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Payments APIs (v2)","description":"Renamed group"}'
};

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

```go default
package main

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

func main() {

	url := "https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId"

	payload := strings.NewReader("{\n  \"name\": \"Payments APIs (v2)\",\n  \"description\": \"Renamed group\"\n}")

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

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

url = URI("https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Payments APIs (v2)\",\n  \"description\": \"Renamed group\"\n}"

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

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Payments APIs (v2)\",\n  \"description\": \"Renamed group\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId', [
  'body' => '{
  "name": "Payments APIs (v2)",
  "description": "Renamed group"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp default
using RestSharp;

var client = new RestClient("https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Payments APIs (v2)\",\n  \"description\": \"Renamed group\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Payments APIs (v2)",
  "description": "Renamed group"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.usepassport.ai/public/v1/resource-groups/resourceGroupId")! 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()
```