> This page is for Self-Hosted, version v3.0 (default).
> For other versions, use one of these documentation indexes:
> - v3.0 (default): https://docs.nvidia.com/run-ai/self-hosted/v3.0/llms.txt
> - v2.26: https://docs.nvidia.com/run-ai/self-hosted/v2.26/llms.txt
> - v2.25: https://docs.nvidia.com/run-ai/self-hosted/v2.25/llms.txt
> - v2.24: https://docs.nvidia.com/run-ai/self-hosted/v2.24/llms.txt

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

# Patch multiple departments node pool resources in batch.

POST http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch
Content-Type: application/json

Partially updates node pool resource quotas for multiple departments in a single request.

Reference: https://docs.nvidia.com/run-ai/self-hosted/reference/rest-api/endpoints/organizations/departments/batch-patch-department-node-pool-resources

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication

## Request

### Body (application/json)

This endpoint expects a BatchPatchNodePoolResourcesRequest.

- `patchRequests` (list of NodePoolResourcesPatchRequest, required) — Array of node pool resources patch requests.

## Response

### 200

Batch patch processed. Returns succeeded and failed items with totals and a batch id.

- `id` (string, required) — The unique ID of the batch operation.
- `totalRequested` (integer, required) — Total number of items requested in the batch.
- `totalSuccessful` (integer, required) — Number of items successfully processed.
- `totalFailed` (integer, required) — Number of items that failed.
- `succeeded` (list of DepartmentNodePoolResources, optional) — Successfully patched department node pool resources results.
- `failed` (list of FailedNodePoolResourcesPatchRequest, optional) — Failed patch operations with the original payload and error details.

## Errors

### 400 Bad Request Error

Bad request.

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 403 Forbidden Error

Forbidden

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 500 Internal Server Error

unexpected error

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 503 Service Unavailable Error

unexpected error

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

## Types

### NodePoolResourcesPatchRequest

- `orgUnitId` (string, required) — The project/department ID.
- `nodePoolId` (string, required)
- `rank` (string, optional, nullable)
- `resources` (ResourcesPerNodePoolNullable, optional)

### DepartmentNodePoolResources

- `id` (string, required) — The unique ID of the resources.
- `orgUnitId` (string, required) — The project/department ID.
- `orgUnitName` (string, required) — The project/department name.
- `clusterId` (string, required)
- `nodePoolId` (string, required)
- `nodePoolName` (string, required)
- `rank` (string, required)
- `resources` (ResourcesPerNodePool, required)

### FailedNodePoolResourcesPatchRequest

- `payload` (NodePoolResourcesPatchRequest, optional)
- `code` (integer, optional) — HTTP error code.
- `message` (string, optional) — Error message.

### ResourcesPerNodePoolNullable

- `gpu` (ResourcesPerNodePoolNullableGpu, optional, nullable)
- `cpu` (ResourcesPerNodePoolNullableCpu, optional, nullable)
- `memory` (ResourcesPerNodePoolNullableMemory, optional, nullable)

### ResourcesPerNodePool

- `gpu` (ResourcesPerNodePoolGpu, optional) — Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources.
- `cpu` (ResourcesPerNodePoolCpu, optional, nullable)
- `memory` (ResourcesPerNodePoolMemory, optional, nullable)

### ResourcesPerNodePoolNullableGpu

- `deserved` (double, optional, nullable) — The resource quota assigned to this org-unit.
- `limit` (double, optional, nullable) — The maximum resource allocation for this org-unit. Set to null for unlimited.
- `overQuotaWeight` (double, optional, nullable) — The weight assigned to determine the org-unit's share of over-quota resources within its rank. When multiple org-units share the same rank in a node pool, resources are distributed proportionally based on their weights. Valid values: 1–20. Requires over-quota weight to be enabled. When enabled, the default is 2. See [GPU over quota](/run-ai/self-hosted/documentation/platform-management/manage-ai-initiatives/organization/projects) for more details.

### ResourcesPerNodePoolNullableCpu

- `deserved` (double, optional, nullable) — The resource quota assigned to this org-unit.
- `limit` (double, optional, nullable) — The maximum resource allocation for this org-unit. Set to null for unlimited.
- `overQuotaWeight` (double, optional, nullable) — The weight assigned to determine the org-unit's share of over-quota resources within its rank. When multiple org-units share the same rank in a node pool, resources are distributed proportionally based on their weights. Valid values: 1–20. Requires over-quota weight to be enabled. When enabled, the default is 2. See [GPU over quota](/run-ai/self-hosted/documentation/platform-management/manage-ai-initiatives/organization/projects) for more details.

### ResourcesPerNodePoolNullableMemory

- `units` (enum, required) — The unit of measurement for CPU memory values.
  - Allowed values: `Mib`, `MB`, `GB`
- `deserved` (double, optional, nullable) — The resource quota assigned to this org-unit.
- `limit` (double, optional, nullable) — The maximum resource allocation for this org-unit. Set to null for unlimited.
- `overQuotaWeight` (double, optional, nullable) — The weight assigned to determine the org-unit's share of over-quota resources within its rank. When multiple org-units share the same rank in a node pool, resources are distributed proportionally based on their weights. Valid values: 1–20. Requires over-quota weight to be enabled. When enabled, the default is 2. See [GPU over quota](/run-ai/self-hosted/documentation/platform-management/manage-ai-initiatives/organization/projects) for more details.

### ResourcesPerNodePoolGpu

Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources.

- `deserved` (double, optional, nullable) — The resource quota assigned to this org-unit.
- `limit` (double, optional, nullable) — The maximum resource allocation for this org-unit. Set to null for unlimited.
- `overQuotaWeight` (double, optional, nullable) — The weight assigned to determine the org-unit's share of over-quota resources within its rank. When multiple org-units share the same rank in a node pool, resources are distributed proportionally based on their weights. Valid values: 1–20. Requires over-quota weight to be enabled. When enabled, the default is 2. See [GPU over quota](/run-ai/self-hosted/documentation/platform-management/manage-ai-initiatives/organization/projects) for more details.

### ResourcesPerNodePoolCpu

- `deserved` (double, optional, nullable) — The resource quota assigned to this org-unit.
- `limit` (double, optional, nullable) — The maximum resource allocation for this org-unit. Set to null for unlimited.
- `overQuotaWeight` (double, optional, nullable) — The weight assigned to determine the org-unit's share of over-quota resources within its rank. When multiple org-units share the same rank in a node pool, resources are distributed proportionally based on their weights. Valid values: 1–20. Requires over-quota weight to be enabled. When enabled, the default is 2. See [GPU over quota](/run-ai/self-hosted/documentation/platform-management/manage-ai-initiatives/organization/projects) for more details.

### ResourcesPerNodePoolMemory

- `units` (enum, required) — The unit of measurement for CPU memory values.
  - Allowed values: `Mib`, `MB`, `GB`
- `deserved` (double, optional, nullable) — The resource quota assigned to this org-unit.
- `limit` (double, optional, nullable) — The maximum resource allocation for this org-unit. Set to null for unlimited.
- `overQuotaWeight` (double, optional, nullable) — The weight assigned to determine the org-unit's share of over-quota resources within its rank. When multiple org-units share the same rank in a node pool, resources are distributed proportionally based on their weights. Valid values: 1–20. Requires over-quota weight to be enabled. When enabled, the default is 2. See [GPU over quota](/run-ai/self-hosted/documentation/platform-management/manage-ai-initiatives/organization/projects) for more details.

## Examples

**Request**

```json
{
  "patchRequests": [
    {
      "orgUnitId": "3845",
      "nodePoolId": "22",
      "rank": "Low",
      "resources": {
        "gpu": {
          "deserved": 2,
          "limit": 2,
          "overQuotaWeight": 2
        }
      }
    },
    {
      "orgUnitId": "27552",
      "nodePoolId": "33",
      "resources": {
        "cpu": {
          "deserved": 20,
          "limit": 20,
          "overQuotaWeight": 20
        }
      }
    }
  ]
}
```

**Response**

```json
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "totalRequested": 2,
  "totalSuccessful": 1,
  "totalFailed": 1,
  "succeeded": [
    {
      "id": "string",
      "orgUnitId": "435",
      "orgUnitName": "proj1",
      "clusterId": "string",
      "nodePoolId": "12",
      "nodePoolName": "default",
      "rank": "string",
      "resources": {
        "0": {
          "gpu": {
            "deserved": 2,
            "limit": 2,
            "overQuotaWeight": 2
          }
        }
      }
    }
  ],
  "failed": [
    {
      "payload": {
        "orgUnitId": "577",
        "nodePoolId": "12",
        "resources": {
          "0": {
            "gpu": {
              "deserved": 2,
              "limit": 2,
              "overQuotaWeight": 2
            }
          }
        }
      },
      "code": 404,
      "message": "department not found"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch"

payload = { "patchRequests": [
        {
            "orgUnitId": "3845",
            "nodePoolId": "22",
            "rank": "Low",
            "resources": { "gpu": {
                    "deserved": 2,
                    "limit": 2,
                    "overQuotaWeight": 2
                } }
        },
        {
            "orgUnitId": "27552",
            "nodePoolId": "33",
            "resources": { "cpu": {
                    "deserved": 20,
                    "limit": 20,
                    "overQuotaWeight": 20
                } }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"patchRequests":[{"orgUnitId":"3845","nodePoolId":"22","rank":"Low","resources":{"gpu":{"deserved":2,"limit":2,"overQuotaWeight":2}}},{"orgUnitId":"27552","nodePoolId":"33","resources":{"cpu":{"deserved":20,"limit":20,"overQuotaWeight":20}}}]}'
};

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

```go
package main

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

func main() {

	url := "http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch"

	payload := strings.NewReader("{\n  \"patchRequests\": [\n    {\n      \"orgUnitId\": \"3845\",\n      \"nodePoolId\": \"22\",\n      \"rank\": \"Low\",\n      \"resources\": {\n        \"gpu\": {\n          \"deserved\": 2,\n          \"limit\": 2,\n          \"overQuotaWeight\": 2\n        }\n      }\n    },\n    {\n      \"orgUnitId\": \"27552\",\n      \"nodePoolId\": \"33\",\n      \"resources\": {\n        \"cpu\": {\n          \"deserved\": 20,\n          \"limit\": 20,\n          \"overQuotaWeight\": 20\n        }\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", 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
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"patchRequests\": [\n    {\n      \"orgUnitId\": \"3845\",\n      \"nodePoolId\": \"22\",\n      \"rank\": \"Low\",\n      \"resources\": {\n        \"gpu\": {\n          \"deserved\": 2,\n          \"limit\": 2,\n          \"overQuotaWeight\": 2\n        }\n      }\n    },\n    {\n      \"orgUnitId\": \"27552\",\n      \"nodePoolId\": \"33\",\n      \"resources\": {\n        \"cpu\": {\n          \"deserved\": 20,\n          \"limit\": 20,\n          \"overQuotaWeight\": 20\n        }\n      }\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"patchRequests\": [\n    {\n      \"orgUnitId\": \"3845\",\n      \"nodePoolId\": \"22\",\n      \"rank\": \"Low\",\n      \"resources\": {\n        \"gpu\": {\n          \"deserved\": 2,\n          \"limit\": 2,\n          \"overQuotaWeight\": 2\n        }\n      }\n    },\n    {\n      \"orgUnitId\": \"27552\",\n      \"nodePoolId\": \"33\",\n      \"resources\": {\n        \"cpu\": {\n          \"deserved\": 20,\n          \"limit\": 20,\n          \"overQuotaWeight\": 20\n        }\n      }\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch', [
  'body' => '{
  "patchRequests": [
    {
      "orgUnitId": "3845",
      "nodePoolId": "22",
      "rank": "Low",
      "resources": {
        "gpu": {
          "deserved": 2,
          "limit": 2,
          "overQuotaWeight": 2
        }
      }
    },
    {
      "orgUnitId": "27552",
      "nodePoolId": "33",
      "resources": {
        "cpu": {
          "deserved": 20,
          "limit": 20,
          "overQuotaWeight": 20
        }
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"patchRequests\": [\n    {\n      \"orgUnitId\": \"3845\",\n      \"nodePoolId\": \"22\",\n      \"rank\": \"Low\",\n      \"resources\": {\n        \"gpu\": {\n          \"deserved\": 2,\n          \"limit\": 2,\n          \"overQuotaWeight\": 2\n        }\n      }\n    },\n    {\n      \"orgUnitId\": \"27552\",\n      \"nodePoolId\": \"33\",\n      \"resources\": {\n        \"cpu\": {\n          \"deserved\": 20,\n          \"limit\": 20,\n          \"overQuotaWeight\": 20\n        }\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["patchRequests": [
    [
      "orgUnitId": "3845",
      "nodePoolId": "22",
      "rank": "Low",
      "resources": ["gpu": [
          "deserved": 2,
          "limit": 2,
          "overQuotaWeight": 2
        ]]
    ],
    [
      "orgUnitId": "27552",
      "nodePoolId": "33",
      "resources": ["cpu": [
          "deserved": 20,
          "limit": 20,
          "overQuotaWeight": 20
        ]]
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/org-unit/departments/node-pool-resources/batch-patch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```