# Departments

## Get departments

> list departments

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentsFilterBy":{"name":"filterBy","in":"query","required":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(name|clusterId|totalGpuQuota|gpuAllocated|createdAt|avgGpuAllocation24h|avgGpuUtilization24h|avgGpuMemoryUtilization24h|avgGpuAllocation7d|avgGpuUtilization7d|avgGpuMemoryUtilization7d|avgGpuAllocation30d|avgGpuUtilization30d|avgGpuMemoryUtilization30d)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false},"DepartmentsSortBy":{"name":"sortBy","in":"query","required":false,"description":"Sort results by a parameters.","schema":{"$ref":"#/components/schemas/DepartmentFilterSortFields"}},"DepartmentsVerbosity":{"name":"verbosity","in":"query","required":false,"description":"Departments verbosity. If it is set to \"verbose\", status will be returned. If it is not defined or set to \"brief\" only unit specific data will be returned.","schema":{"$ref":"#/components/schemas/Verbosity"}},"SortOrder":{"name":"sortOrder","in":"query","required":false,"description":"Sort results in descending or ascending order.","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},"Offset":{"name":"offset","in":"query","required":false,"description":"The offset of the first item returned in the collection.","schema":{"type":"integer","format":"int32"}},"Limit":{"name":"limit","in":"query","required":false,"description":"The maximum number of entries to return.","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":500}}},"schemas":{"DepartmentFilterSortFields":{"type":"string","enum":["name","clusterId","totalGpuQuota","gpuAllocated","createdAt","avgGpuAllocation24h","avgGpuUtilization24h","avgGpuMemoryUtilization24h","avgGpuAllocation7d","avgGpuUtilization7d","avgGpuMemoryUtilization7d","avgGpuAllocation30d","avgGpuUtilization30d","avgGpuMemoryUtilization30d"]},"Verbosity":{"type":"string","enum":["meta","brief","verbose"]},"DepartmentForList":{"allOf":[{"$ref":"#/components/schemas/DataDepartmentFields"},{"type":"object","required":["id","createdAt","updatedAt","totalResources"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"children":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/DepartmentProjectChild"}},"status":{"type":"object","nullable":true,"properties":{"quotaStatus":{"$ref":"#/components/schemas/QuotaStatus"}}},"totalResources":{"$ref":"#/components/schemas/TotalResources","nullable":true},"resources":{"type":"array","items":{"$ref":"#/components/schemas/Resources"},"description":"Resources assigned to this Organization per Node Pool"}}}]},"DataDepartmentFields":{"allOf":[{"$ref":"#/components/schemas/DataUpdatableDepartmentFields"},{"type":"object","required":["name","clusterId"],"properties":{"name":{"description":"The unique name of the department within the cluster. Must be a valid Kubernetes name (lowercase, alphanumeric, hyphens allowed).","type":"string"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"overtimeData":{"$ref":"#/components/schemas/OvertimeData"}}}]},"DataUpdatableDepartmentFields":{"type":"object","description":"Updatable fields","required":["resources"],"properties":{"description":{"type":"string","description":"The description of the department."},"schedulingRules":{"$ref":"#/components/schemas/SchedulingRules"},"defaultNodePools":{"description":"An ordered list of node pools that defines the default scheduling preference for workloads in this department. The Scheduler will attempt to schedule workloads on node pools in this order. This setting is enforced if no node pool list is defined in the workload policy.","type":"array","nullable":true,"items":{"type":"string"}},"nodeTypes":{"$ref":"#/components/schemas/NodeTypesPerWorkload"}}},"SchedulingRules":{"type":"object","nullable":true,"description":"Scheduling rules that define time limits and idle GPU timeouts for workloads in this org-unit. These rules help manage resource utilization by automatically terminating or preempting idle or long-running workloads.","properties":{"interactiveJobTimeLimitSeconds":{"type":"integer","description":"interactive job time limit in seconds","nullable":true,"minimum":1},"interactiveJobMaxIdleDurationSeconds":{"type":"integer","description":"interactive job max idle duration in seconds","nullable":true,"minimum":1},"interactiveJobPreemptIdleDurationSeconds":{"type":"integer","description":"interactive job preempt idle duration in seconds","nullable":true,"minimum":1},"trainingJobMaxIdleDurationSeconds":{"type":"integer","description":"training job max idle duration in seconds","nullable":true,"minimum":1},"trainingJobTimeLimitSeconds":{"type":"integer","description":"training job time limit in seconds","nullable":true,"minimum":1}}},"NodeTypesPerWorkload":{"description":"Node type configurations for different workload types (training, workspace). Specifies which node types are allowed for each workload type. Enforced when no node type is configured in the workload policy.","properties":{"training":{"type":"array","description":"ids of the node types for training workloads","items":{"type":"string"}},"workspace":{"type":"array","description":"ids of the node types for workspace workloads","items":{"type":"string"}},"names":{"nullable":true,"type":"object","additionalProperties":{"type":"string"},"description":"mapping of ids to names"}}},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"OvertimeData":{"type":"object","properties":{"range24hData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range7dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range30dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]}}},"OvertimeRangeData":{"type":"object","description":"Average data for the specified time range, or for the lifetime of the project/department if it exists for less than the time range.","properties":{"averageGpuAllocation":{"type":"number","format":"double","description":"The average gpu devices allocation of the project/department."},"averageGpuUtilization":{"type":"number","format":"double","description":"The average gpu utilization percentage of the project/department."},"averageGpuMemoryUtilization":{"type":"number","format":"double","description":"The average gpu memory utilization percentage of the project/department. Only available for cluster versions >= 2.22.","nullable":true},"updatedAt":{"type":"string","format":"date-time"}}},"DepartmentProjectChild":{"type":"object","description":"Department or project child","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentProjectChild"}}}},"QuotaStatus":{"type":"object","description":"Sum of all quota statuses of all the node pools","properties":{"allocated":{"$ref":"#/components/schemas/QuotaStatusResource"},"allocatedNonPreemptible":{"$ref":"#/components/schemas/QuotaStatusResource"},"requested":{"$ref":"#/components/schemas/QuotaStatusResource"}}},"QuotaStatusResource":{"type":"object","properties":{"gpu":{"type":"number","format":"double","description":"The number of GPUs (allocated/requested/...)."},"cpu":{"type":"number","format":"double","description":"CPU in Millicores (allocated/requested/...)."},"memory":{"type":"number","format":"double","description":"Memory in MB (allocated/requested/...)."}}},"TotalResources":{"type":"object","properties":{"gpuQuota":{"type":"number","format":"double","description":"Total gpu quota of the org unit","nullable":true},"cpuQuota":{"type":"number","format":"double","description":"Total cpu quota of the org unit in Millicores","nullable":true},"memoryQuota":{"type":"number","format":"double","description":"Total memory quota of the org unit in MB","nullable":true}}},"Resources":{"required":["gpu"],"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"required":["deserved"],"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"NonNullResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The GPU quota assigned to this org-unit.","default":0},"limit":{"type":"number","format":"double","description":"The maximum GPU device allocation the org-unit can get from this node pool, representing the maximum sum of assigned quota and over-quota GPUs. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments":{"get":{"summary":"Get departments","operationId":"get_departments","description":"list departments","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentsFilterBy"},{"$ref":"#/components/parameters/DepartmentsSortBy"},{"$ref":"#/components/parameters/DepartmentsVerbosity"},{"$ref":"#/components/parameters/SortOrder"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","required":["departments"],"properties":{"departments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentForList"}},"next":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Create department

> Create Department

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"DepartmentCreationRequest":{"allOf":[{"$ref":"#/components/schemas/DataDepartmentFields"},{"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourcesNullable"},"description":"An array of resource configurations for the department. Each entry defines GPU, CPU, and CPU memory assigned to a specific node pool."}}}]},"DataDepartmentFields":{"allOf":[{"$ref":"#/components/schemas/DataUpdatableDepartmentFields"},{"type":"object","required":["name","clusterId"],"properties":{"name":{"description":"The unique name of the department within the cluster. Must be a valid Kubernetes name (lowercase, alphanumeric, hyphens allowed).","type":"string"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"overtimeData":{"$ref":"#/components/schemas/OvertimeData"}}}]},"DataUpdatableDepartmentFields":{"type":"object","description":"Updatable fields","required":["resources"],"properties":{"description":{"type":"string","description":"The description of the department."},"schedulingRules":{"$ref":"#/components/schemas/SchedulingRules"},"defaultNodePools":{"description":"An ordered list of node pools that defines the default scheduling preference for workloads in this department. The Scheduler will attempt to schedule workloads on node pools in this order. This setting is enforced if no node pool list is defined in the workload policy.","type":"array","nullable":true,"items":{"type":"string"}},"nodeTypes":{"$ref":"#/components/schemas/NodeTypesPerWorkload"}}},"SchedulingRules":{"type":"object","nullable":true,"description":"Scheduling rules that define time limits and idle GPU timeouts for workloads in this org-unit. These rules help manage resource utilization by automatically terminating or preempting idle or long-running workloads.","properties":{"interactiveJobTimeLimitSeconds":{"type":"integer","description":"interactive job time limit in seconds","nullable":true,"minimum":1},"interactiveJobMaxIdleDurationSeconds":{"type":"integer","description":"interactive job max idle duration in seconds","nullable":true,"minimum":1},"interactiveJobPreemptIdleDurationSeconds":{"type":"integer","description":"interactive job preempt idle duration in seconds","nullable":true,"minimum":1},"trainingJobMaxIdleDurationSeconds":{"type":"integer","description":"training job max idle duration in seconds","nullable":true,"minimum":1},"trainingJobTimeLimitSeconds":{"type":"integer","description":"training job time limit in seconds","nullable":true,"minimum":1}}},"NodeTypesPerWorkload":{"description":"Node type configurations for different workload types (training, workspace). Specifies which node types are allowed for each workload type. Enforced when no node type is configured in the workload policy.","properties":{"training":{"type":"array","description":"ids of the node types for training workloads","items":{"type":"string"}},"workspace":{"type":"array","description":"ids of the node types for workspace workloads","items":{"type":"string"}},"names":{"nullable":true,"type":"object","additionalProperties":{"type":"string"},"description":"mapping of ids to names"}}},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"OvertimeData":{"type":"object","properties":{"range24hData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range7dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range30dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]}}},"OvertimeRangeData":{"type":"object","description":"Average data for the specified time range, or for the lifetime of the project/department if it exists for less than the time range.","properties":{"averageGpuAllocation":{"type":"number","format":"double","description":"The average gpu devices allocation of the project/department."},"averageGpuUtilization":{"type":"number","format":"double","description":"The average gpu utilization percentage of the project/department."},"averageGpuMemoryUtilization":{"type":"number","format":"double","description":"The average gpu memory utilization percentage of the project/department. Only available for cluster versions >= 2.22.","nullable":true},"updatedAt":{"type":"string","format":"date-time"}}},"ResourcesNullable":{"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"NonNullResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The GPU quota assigned to this org-unit.","default":0},"limit":{"type":"number","format":"double","description":"The maximum GPU device allocation the org-unit can get from this node pool, representing the maximum sum of assigned quota and over-quota GPUs. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"Department":{"allOf":[{"$ref":"#/components/schemas/DataDepartmentFields"},{"type":"object","required":["id","name","description","createdAt","updatedAt","totalResources"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"children":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/DepartmentProjectChild"}},"projectsAggregatedResources":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AggregatedResources"}},"status":{"type":"object","properties":{"nodePoolQuotaStatuses":{"type":"array","items":{"$ref":"#/components/schemas/QuotaStatusNodePool"}},"quotaStatus":{"$ref":"#/components/schemas/QuotaStatus"}}},"totalResources":{"$ref":"#/components/schemas/TotalResources"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/Resources"},"description":"Resources assigned to this Organization per Node Pool"}}}]},"DepartmentProjectChild":{"type":"object","description":"Department or project child","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentProjectChild"}}}},"AggregatedResources":{"type":"object","description":"Sum of all resources assigned to the projects under this department per Node Pool","required":["nodePool"],"properties":{"nodePool":{"type":"object","description":"the node pool which the resources refer to","required":["id","name"],"properties":{"id":{"type":"string","description":"node pool id"},"name":{"type":"string","description":"node pool name"}}},"gpu":{"$ref":"#/components/schemas/DeservedResource"},"cpu":{"$ref":"#/components/schemas/DeservedResource"},"memory":{"allOf":[{"$ref":"#/components/schemas/DeservedResource"},{"type":"object","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]}}},"DeservedResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The project resource allocation that it is deserved to get in case the cluster has those resources","nullable":true}}},"QuotaStatusNodePool":{"allOf":[{"$ref":"#/components/schemas/QuotaStatus"},{"type":"object","required":["nodePoolName","nodePoolId"],"properties":{"nodePoolName":{"type":"string","description":"The node pool name which the current quota status refers to"},"nodePoolId":{"type":"string","description":"The node pool id which the current quota status refers to"}}}]},"QuotaStatus":{"type":"object","description":"Sum of all quota statuses of all the node pools","properties":{"allocated":{"$ref":"#/components/schemas/QuotaStatusResource"},"allocatedNonPreemptible":{"$ref":"#/components/schemas/QuotaStatusResource"},"requested":{"$ref":"#/components/schemas/QuotaStatusResource"}}},"QuotaStatusResource":{"type":"object","properties":{"gpu":{"type":"number","format":"double","description":"The number of GPUs (allocated/requested/...)."},"cpu":{"type":"number","format":"double","description":"CPU in Millicores (allocated/requested/...)."},"memory":{"type":"number","format":"double","description":"Memory in MB (allocated/requested/...)."}}},"TotalResources":{"type":"object","properties":{"gpuQuota":{"type":"number","format":"double","description":"Total gpu quota of the org unit","nullable":true},"cpuQuota":{"type":"number","format":"double","description":"Total cpu quota of the org unit in Millicores","nullable":true},"memoryQuota":{"type":"number","format":"double","description":"Total memory quota of the org unit in MB","nullable":true}}},"Resources":{"required":["gpu"],"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"required":["deserved"],"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409Conflict":{"description":"The specified resource already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments":{"post":{"summary":"Create department","operationId":"create_department","description":"Create Department","tags":["Departments"],"requestBody":{"description":"Department to create.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentCreationRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Department"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"409":{"$ref":"#/components/responses/409Conflict"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get department

> Get department by Id

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}}},"schemas":{"Department":{"allOf":[{"$ref":"#/components/schemas/DataDepartmentFields"},{"type":"object","required":["id","name","description","createdAt","updatedAt","totalResources"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"children":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/DepartmentProjectChild"}},"projectsAggregatedResources":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AggregatedResources"}},"status":{"type":"object","properties":{"nodePoolQuotaStatuses":{"type":"array","items":{"$ref":"#/components/schemas/QuotaStatusNodePool"}},"quotaStatus":{"$ref":"#/components/schemas/QuotaStatus"}}},"totalResources":{"$ref":"#/components/schemas/TotalResources"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/Resources"},"description":"Resources assigned to this Organization per Node Pool"}}}]},"DataDepartmentFields":{"allOf":[{"$ref":"#/components/schemas/DataUpdatableDepartmentFields"},{"type":"object","required":["name","clusterId"],"properties":{"name":{"description":"The unique name of the department within the cluster. Must be a valid Kubernetes name (lowercase, alphanumeric, hyphens allowed).","type":"string"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"overtimeData":{"$ref":"#/components/schemas/OvertimeData"}}}]},"DataUpdatableDepartmentFields":{"type":"object","description":"Updatable fields","required":["resources"],"properties":{"description":{"type":"string","description":"The description of the department."},"schedulingRules":{"$ref":"#/components/schemas/SchedulingRules"},"defaultNodePools":{"description":"An ordered list of node pools that defines the default scheduling preference for workloads in this department. The Scheduler will attempt to schedule workloads on node pools in this order. This setting is enforced if no node pool list is defined in the workload policy.","type":"array","nullable":true,"items":{"type":"string"}},"nodeTypes":{"$ref":"#/components/schemas/NodeTypesPerWorkload"}}},"SchedulingRules":{"type":"object","nullable":true,"description":"Scheduling rules that define time limits and idle GPU timeouts for workloads in this org-unit. These rules help manage resource utilization by automatically terminating or preempting idle or long-running workloads.","properties":{"interactiveJobTimeLimitSeconds":{"type":"integer","description":"interactive job time limit in seconds","nullable":true,"minimum":1},"interactiveJobMaxIdleDurationSeconds":{"type":"integer","description":"interactive job max idle duration in seconds","nullable":true,"minimum":1},"interactiveJobPreemptIdleDurationSeconds":{"type":"integer","description":"interactive job preempt idle duration in seconds","nullable":true,"minimum":1},"trainingJobMaxIdleDurationSeconds":{"type":"integer","description":"training job max idle duration in seconds","nullable":true,"minimum":1},"trainingJobTimeLimitSeconds":{"type":"integer","description":"training job time limit in seconds","nullable":true,"minimum":1}}},"NodeTypesPerWorkload":{"description":"Node type configurations for different workload types (training, workspace). Specifies which node types are allowed for each workload type. Enforced when no node type is configured in the workload policy.","properties":{"training":{"type":"array","description":"ids of the node types for training workloads","items":{"type":"string"}},"workspace":{"type":"array","description":"ids of the node types for workspace workloads","items":{"type":"string"}},"names":{"nullable":true,"type":"object","additionalProperties":{"type":"string"},"description":"mapping of ids to names"}}},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"OvertimeData":{"type":"object","properties":{"range24hData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range7dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range30dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]}}},"OvertimeRangeData":{"type":"object","description":"Average data for the specified time range, or for the lifetime of the project/department if it exists for less than the time range.","properties":{"averageGpuAllocation":{"type":"number","format":"double","description":"The average gpu devices allocation of the project/department."},"averageGpuUtilization":{"type":"number","format":"double","description":"The average gpu utilization percentage of the project/department."},"averageGpuMemoryUtilization":{"type":"number","format":"double","description":"The average gpu memory utilization percentage of the project/department. Only available for cluster versions >= 2.22.","nullable":true},"updatedAt":{"type":"string","format":"date-time"}}},"DepartmentProjectChild":{"type":"object","description":"Department or project child","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentProjectChild"}}}},"AggregatedResources":{"type":"object","description":"Sum of all resources assigned to the projects under this department per Node Pool","required":["nodePool"],"properties":{"nodePool":{"type":"object","description":"the node pool which the resources refer to","required":["id","name"],"properties":{"id":{"type":"string","description":"node pool id"},"name":{"type":"string","description":"node pool name"}}},"gpu":{"$ref":"#/components/schemas/DeservedResource"},"cpu":{"$ref":"#/components/schemas/DeservedResource"},"memory":{"allOf":[{"$ref":"#/components/schemas/DeservedResource"},{"type":"object","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]}}},"DeservedResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The project resource allocation that it is deserved to get in case the cluster has those resources","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"QuotaStatusNodePool":{"allOf":[{"$ref":"#/components/schemas/QuotaStatus"},{"type":"object","required":["nodePoolName","nodePoolId"],"properties":{"nodePoolName":{"type":"string","description":"The node pool name which the current quota status refers to"},"nodePoolId":{"type":"string","description":"The node pool id which the current quota status refers to"}}}]},"QuotaStatus":{"type":"object","description":"Sum of all quota statuses of all the node pools","properties":{"allocated":{"$ref":"#/components/schemas/QuotaStatusResource"},"allocatedNonPreemptible":{"$ref":"#/components/schemas/QuotaStatusResource"},"requested":{"$ref":"#/components/schemas/QuotaStatusResource"}}},"QuotaStatusResource":{"type":"object","properties":{"gpu":{"type":"number","format":"double","description":"The number of GPUs (allocated/requested/...)."},"cpu":{"type":"number","format":"double","description":"CPU in Millicores (allocated/requested/...)."},"memory":{"type":"number","format":"double","description":"Memory in MB (allocated/requested/...)."}}},"TotalResources":{"type":"object","properties":{"gpuQuota":{"type":"number","format":"double","description":"Total gpu quota of the org unit","nullable":true},"cpuQuota":{"type":"number","format":"double","description":"Total cpu quota of the org unit in Millicores","nullable":true},"memoryQuota":{"type":"number","format":"double","description":"Total memory quota of the org unit in MB","nullable":true}}},"Resources":{"required":["gpu"],"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"required":["deserved"],"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"NonNullResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The GPU quota assigned to this org-unit.","default":0},"limit":{"type":"number","format":"double","description":"The maximum GPU device allocation the org-unit can get from this node pool, representing the maximum sum of assigned quota and over-quota GPUs. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/{departmentId}":{"get":{"summary":"Get department","operationId":"get_department","description":"Get department by Id","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentId"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Department"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Update department

> Update department by Id

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}}},"schemas":{"DepartmentUpdateRequest":{"allOf":[{"$ref":"#/components/schemas/DataUpdatableDepartmentFields"},{"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourcesNullable"},"description":"Resources assigned to this Organization per Node Pool"}}}]},"DataUpdatableDepartmentFields":{"type":"object","description":"Updatable fields","required":["resources"],"properties":{"description":{"type":"string","description":"The description of the department."},"schedulingRules":{"$ref":"#/components/schemas/SchedulingRules"},"defaultNodePools":{"description":"An ordered list of node pools that defines the default scheduling preference for workloads in this department. The Scheduler will attempt to schedule workloads on node pools in this order. This setting is enforced if no node pool list is defined in the workload policy.","type":"array","nullable":true,"items":{"type":"string"}},"nodeTypes":{"$ref":"#/components/schemas/NodeTypesPerWorkload"}}},"SchedulingRules":{"type":"object","nullable":true,"description":"Scheduling rules that define time limits and idle GPU timeouts for workloads in this org-unit. These rules help manage resource utilization by automatically terminating or preempting idle or long-running workloads.","properties":{"interactiveJobTimeLimitSeconds":{"type":"integer","description":"interactive job time limit in seconds","nullable":true,"minimum":1},"interactiveJobMaxIdleDurationSeconds":{"type":"integer","description":"interactive job max idle duration in seconds","nullable":true,"minimum":1},"interactiveJobPreemptIdleDurationSeconds":{"type":"integer","description":"interactive job preempt idle duration in seconds","nullable":true,"minimum":1},"trainingJobMaxIdleDurationSeconds":{"type":"integer","description":"training job max idle duration in seconds","nullable":true,"minimum":1},"trainingJobTimeLimitSeconds":{"type":"integer","description":"training job time limit in seconds","nullable":true,"minimum":1}}},"NodeTypesPerWorkload":{"description":"Node type configurations for different workload types (training, workspace). Specifies which node types are allowed for each workload type. Enforced when no node type is configured in the workload policy.","properties":{"training":{"type":"array","description":"ids of the node types for training workloads","items":{"type":"string"}},"workspace":{"type":"array","description":"ids of the node types for workspace workloads","items":{"type":"string"}},"names":{"nullable":true,"type":"object","additionalProperties":{"type":"string"},"description":"mapping of ids to names"}}},"ResourcesNullable":{"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"NonNullResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The GPU quota assigned to this org-unit.","default":0},"limit":{"type":"number","format":"double","description":"The maximum GPU device allocation the org-unit can get from this node pool, representing the maximum sum of assigned quota and over-quota GPUs. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"Department":{"allOf":[{"$ref":"#/components/schemas/DataDepartmentFields"},{"type":"object","required":["id","name","description","createdAt","updatedAt","totalResources"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"children":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/DepartmentProjectChild"}},"projectsAggregatedResources":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AggregatedResources"}},"status":{"type":"object","properties":{"nodePoolQuotaStatuses":{"type":"array","items":{"$ref":"#/components/schemas/QuotaStatusNodePool"}},"quotaStatus":{"$ref":"#/components/schemas/QuotaStatus"}}},"totalResources":{"$ref":"#/components/schemas/TotalResources"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/Resources"},"description":"Resources assigned to this Organization per Node Pool"}}}]},"DataDepartmentFields":{"allOf":[{"$ref":"#/components/schemas/DataUpdatableDepartmentFields"},{"type":"object","required":["name","clusterId"],"properties":{"name":{"description":"The unique name of the department within the cluster. Must be a valid Kubernetes name (lowercase, alphanumeric, hyphens allowed).","type":"string"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"overtimeData":{"$ref":"#/components/schemas/OvertimeData"}}}]},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"OvertimeData":{"type":"object","properties":{"range24hData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range7dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]},"range30dData":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/OvertimeRangeData"}]}}},"OvertimeRangeData":{"type":"object","description":"Average data for the specified time range, or for the lifetime of the project/department if it exists for less than the time range.","properties":{"averageGpuAllocation":{"type":"number","format":"double","description":"The average gpu devices allocation of the project/department."},"averageGpuUtilization":{"type":"number","format":"double","description":"The average gpu utilization percentage of the project/department."},"averageGpuMemoryUtilization":{"type":"number","format":"double","description":"The average gpu memory utilization percentage of the project/department. Only available for cluster versions >= 2.22.","nullable":true},"updatedAt":{"type":"string","format":"date-time"}}},"DepartmentProjectChild":{"type":"object","description":"Department or project child","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentProjectChild"}}}},"AggregatedResources":{"type":"object","description":"Sum of all resources assigned to the projects under this department per Node Pool","required":["nodePool"],"properties":{"nodePool":{"type":"object","description":"the node pool which the resources refer to","required":["id","name"],"properties":{"id":{"type":"string","description":"node pool id"},"name":{"type":"string","description":"node pool name"}}},"gpu":{"$ref":"#/components/schemas/DeservedResource"},"cpu":{"$ref":"#/components/schemas/DeservedResource"},"memory":{"allOf":[{"$ref":"#/components/schemas/DeservedResource"},{"type":"object","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]}}},"DeservedResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The project resource allocation that it is deserved to get in case the cluster has those resources","nullable":true}}},"QuotaStatusNodePool":{"allOf":[{"$ref":"#/components/schemas/QuotaStatus"},{"type":"object","required":["nodePoolName","nodePoolId"],"properties":{"nodePoolName":{"type":"string","description":"The node pool name which the current quota status refers to"},"nodePoolId":{"type":"string","description":"The node pool id which the current quota status refers to"}}}]},"QuotaStatus":{"type":"object","description":"Sum of all quota statuses of all the node pools","properties":{"allocated":{"$ref":"#/components/schemas/QuotaStatusResource"},"allocatedNonPreemptible":{"$ref":"#/components/schemas/QuotaStatusResource"},"requested":{"$ref":"#/components/schemas/QuotaStatusResource"}}},"QuotaStatusResource":{"type":"object","properties":{"gpu":{"type":"number","format":"double","description":"The number of GPUs (allocated/requested/...)."},"cpu":{"type":"number","format":"double","description":"CPU in Millicores (allocated/requested/...)."},"memory":{"type":"number","format":"double","description":"Memory in MB (allocated/requested/...)."}}},"TotalResources":{"type":"object","properties":{"gpuQuota":{"type":"number","format":"double","description":"Total gpu quota of the org unit","nullable":true},"cpuQuota":{"type":"number","format":"double","description":"Total cpu quota of the org unit in Millicores","nullable":true},"memoryQuota":{"type":"number","format":"double","description":"Total memory quota of the org unit in MB","nullable":true}}},"Resources":{"required":["gpu"],"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"required":["deserved"],"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/{departmentId}":{"put":{"summary":"Update department","operationId":"update_department","description":"Update department by Id","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentId"}],"requestBody":{"description":"Department to update.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentUpdateRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Department"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete department

> Delete department by Id

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/org-unit/departments/{departmentId}":{"delete":{"summary":"Delete department","operationId":"delete_department","description":"Delete department by Id","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentId"}],"responses":{"204":{"description":"Deleted"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Update department resources

> Update department resources by Id

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}}},"schemas":{"ResourcesUpdateRequest":{"type":"array","items":{"$ref":"#/components/schemas/ResourcesNullable"},"description":"Resources assigned to this Project per Node Pool"},"ResourcesNullable":{"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"NonNullResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The GPU quota assigned to this org-unit.","default":0},"limit":{"type":"number","format":"double","description":"The maximum GPU device allocation the org-unit can get from this node pool, representing the maximum sum of assigned quota and over-quota GPUs. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"Resources":{"required":["gpu"],"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"required":["deserved"],"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/{departmentId}/resources":{"put":{"summary":"Update department resources","operationId":"update_department_resources","description":"Update department resources by Id","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentId"}],"requestBody":{"description":"Department resources to update.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourcesUpdateRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Resources"}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Patch department resources

> Partial updates to specific items in the list. Should be used for update one or more attributes of an item without modifying the entire resource.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}}},"schemas":{"ResourcesUpdateRequest":{"type":"array","items":{"$ref":"#/components/schemas/ResourcesNullable"},"description":"Resources assigned to this Project per Node Pool"},"ResourcesNullable":{"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"NonNullResource":{"properties":{"deserved":{"type":"number","format":"double","description":"The GPU quota assigned to this org-unit.","default":0},"limit":{"type":"number","format":"double","description":"The maximum GPU device allocation the org-unit can get from this node pool, representing the maximum sum of assigned quota and over-quota GPUs. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"Resources":{"required":["gpu"],"properties":{"nodePool":{"required":["id"],"properties":{"id":{"type":"string","description":"The ID of the node pool."},"name":{"type":"string","description":"The name of the node pool."}},"description":"The node pool to which this resource configuration applies.","type":"object","nullable":true},"gpu":{"required":["deserved"],"allOf":[{"$ref":"#/components/schemas/NonNullResource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]},"rank":{"type":"string","nullable":true,"description":"The scheduling rank of this org-unit within the node pool. Determines the scheduling order of workloads between org-units. Workloads in higher-ranked org-units are scheduled before workloads in lower-ranked org-units. For example, all workloads in rank \"High\" will be scheduled before all workloads in rank \"Medium\".","default":"MediumLow"},"priority":{"deprecated":true,"description":"Deprecated. Use rank instead. The scheduling priority for workloads in this node pool.","type":"string","nullable":true}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/{departmentId}/resources":{"patch":{"summary":"Patch department resources","operationId":"patch_department_resources","description":"Partial updates to specific items in the list. Should be used for update one or more attributes of an item without modifying the entire resource.","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentId"}],"requestBody":{"description":"Department resources to update.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourcesUpdateRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Resources"}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get department metrics data.

> Retrieves department data metrics from the metrics database. Use in reporting and analysis tools.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}},"OrgUnitMetricTypes":{"name":"metricType","in":"query","required":true,"description":"Specify which data to request.","explode":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrgUnitMetricType"}}},"StartRequired":{"name":"start","in":"query","description":"Start date of time range to fetch data in ISO 8601 timestamp format.","required":true,"schema":{"type":"string","format":"date-time"}},"EndRequired":{"name":"end","in":"query","description":"End date of time range to fetch data in ISO 8601 timestamp format.","required":true,"schema":{"type":"string","format":"date-time"}},"NumberOfSamples":{"name":"numberOfSamples","in":"query","description":"The number of samples to take in the specified time range.","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"default":20}},"FilterByNodepoolName":{"name":"nodepoolName","in":"query","description":"Filter using the nodepool.","required":false,"schema":{"type":"string"}}},"schemas":{"OrgUnitMetricType":{"type":"string","description":"Specify which metric data to request.","enum":["GPU_QUOTA","CPU_QUOTA_MILLICORES","CPU_MEMORY_QUOTA_MB","GPU_ALLOCATION","CPU_ALLOCATION_MILLICORES","CPU_MEMORY_ALLOCATION_MB","GPU_MEMORY_UTILIZATION"]},"MetricsResponse":{"type":"object","required":["measurements"],"properties":{"measurements":{"type":"array","items":{"$ref":"#/components/schemas/MeasurementResponse"}}}},"MeasurementResponse":{"type":"object","required":["type","values"],"properties":{"type":{"type":"string","description":"specifies what data returned"},"labels":{"type":"object","nullable":true,"description":"labels of the metric measurement","additionalProperties":{"type":"string"}},"values":{"type":"array","nullable":true,"items":{"type":"object","required":["value","timestamp"],"properties":{"value":{"type":"string"},"timestamp":{"type":"string","format":"date-time","nullable":true}}}}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/{departmentId}/metrics":{"get":{"summary":"Get department metrics data.","operationId":"get_department_metrics","description":"Retrieves department data metrics from the metrics database. Use in reporting and analysis tools.","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentId"},{"$ref":"#/components/parameters/OrgUnitMetricTypes"},{"$ref":"#/components/parameters/StartRequired"},{"$ref":"#/components/parameters/EndRequired"},{"$ref":"#/components/parameters/NumberOfSamples"},{"$ref":"#/components/parameters/FilterByNodepoolName"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsResponse"}},"text/csv":{}}},"207":{"description":"Partial success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/org-unit/departments/telemetry

> Get departments telemetry

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"FilterByCluster":{"name":"clusterId","in":"query","description":"Filter using the Universally Unique Identifier (UUID) of the cluster.","required":false,"schema":{"type":"string","format":"uuid"}},"FilterByNodepoolName":{"name":"nodepoolName","in":"query","description":"Filter using the nodepool.","required":false,"schema":{"type":"string"}},"FilterByDepartment":{"name":"departmentId","in":"query","description":"Filter using the department id.","required":false,"schema":{"type":"string"}},"TelemetryGroupByDepartment":{"name":"groupBy","in":"query","description":"department fields to group the data by","explode":false,"required":false,"schema":{"type":"array","maxItems":2,"items":{"type":"string","enum":["CLUSTER_ID"]}}},"TelemetryType1":{"name":"telemetryType","in":"query","required":true,"description":"specifies what data to request","schema":{"$ref":"#/components/schemas/OrgUnitTelemetryType"}}},"schemas":{"OrgUnitTelemetryType":{"type":"string","description":"Select a telemetry type.","enum":["GPU_QUOTA","CPU_QUOTA","MEMORY_QUOTA","GPU_ALLOCATION","CPU_ALLOCATION","MEMORY_ALLOCATION","GPU_ALLOCATION_NON_PREEMPTIBLE","CPU_ALLOCATION_NON_PREEMPTIBLE","MEMORY_ALLOCATION_NON_PREEMPTIBLE"]},"TelemetryResponse":{"type":"object","required":["type","timestamp","values"],"properties":{"type":{"type":"string","description":"specifies what data returned"},"timestamp":{"type":"string","format":"date-time"},"values":{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string"},"groups":{"type":"array","description":"columns the data is grouped by","maxItems":2,"items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"},"name":{"type":"string"}}}}}}}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/telemetry":{"get":{"summary":"Get departments telemetry","operationId":"get_departments_telemetry","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/FilterByCluster"},{"$ref":"#/components/parameters/FilterByNodepoolName"},{"$ref":"#/components/parameters/FilterByDepartment"},{"$ref":"#/components/parameters/TelemetryGroupByDepartment"},{"$ref":"#/components/parameters/TelemetryType1"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Count departments

> count departments

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentsFilterBy":{"name":"filterBy","in":"query","required":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(name|clusterId|totalGpuQuota|gpuAllocated|createdAt|avgGpuAllocation24h|avgGpuUtilization24h|avgGpuMemoryUtilization24h|avgGpuAllocation7d|avgGpuUtilization7d|avgGpuMemoryUtilization7d|avgGpuAllocation30d|avgGpuUtilization30d|avgGpuMemoryUtilization30d)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false}},"schemas":{"CountResponse":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","format":"int64"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/count":{"get":{"summary":"Count departments","operationId":"count_departments","description":"count departments","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentsFilterBy"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get departments node pool resources

> List departments node pool resources

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentNodePoolResourcesFilterBy":{"name":"filterBy","in":"query","required":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(nodePoolName|nodePoolId|orgUnitId|orgUnitName|rank|clusterId)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false},"DepartmentNodePoolResourcesSortBy":{"name":"sortBy","in":"query","required":false,"description":"Sort results by a parameters.","schema":{"$ref":"#/components/schemas/DepartmentNodePoolResourcesFilterSortFields"}},"SortOrder":{"name":"sortOrder","in":"query","required":false,"description":"Sort results in descending or ascending order.","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},"Offset":{"name":"offset","in":"query","required":false,"description":"The offset of the first item returned in the collection.","schema":{"type":"integer","format":"int32"}},"Limit":{"name":"limit","in":"query","required":false,"description":"The maximum number of entries to return.","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":500}},"Search":{"name":"search","in":"query","required":false,"description":"Filter results by a free text search.","schema":{"type":"string"}}},"schemas":{"DepartmentNodePoolResourcesFilterSortFields":{"type":"string","enum":["nodePoolName","nodePoolId","orgUnitId","orgUnitName","clusterId","gpuDeserved","gpuOverQuotaWeight"]},"DepartmentNodePoolResources":{"type":"object","required":["id","orgUnitId","orgUnitName","nodePoolId","nodePoolName","rank","resources","clusterId"],"properties":{"id":{"description":"The unique ID of the resources.","type":"string"},"orgUnitId":{"description":"The project/department ID.","type":"string"},"orgUnitName":{"description":"The project/department name.","type":"string"},"clusterId":{"type":"string"},"nodePoolId":{"type":"string"},"nodePoolName":{"type":"string"},"rank":{"type":"string"},"resources":{"$ref":"#/components/schemas/ResourcesPerNodePool"}}},"ResourcesPerNodePool":{"type":"object","properties":{"gpu":{"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/node-pool-resources":{"get":{"summary":"Get departments node pool resources","operationId":"get_department_node_pool_resources","description":"List departments node pool resources","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentNodePoolResourcesFilterBy"},{"$ref":"#/components/parameters/DepartmentNodePoolResourcesSortBy"},{"$ref":"#/components/parameters/SortOrder"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Search"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","required":["nodePoolResources"],"properties":{"nodePoolResources":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentNodePoolResources"}},"next":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Count departments node pool resources

> Count departments node pool resources

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"DepartmentNodePoolResourcesFilterBy":{"name":"filterBy","in":"query","required":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(nodePoolName|nodePoolId|orgUnitId|orgUnitName|rank|clusterId)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false},"Search":{"name":"search","in":"query","required":false,"description":"Filter results by a free text search.","schema":{"type":"string"}}},"schemas":{"CountResponse":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","format":"int64"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/node-pool-resources/count":{"get":{"summary":"Count departments node pool resources","operationId":"count_department_node_pool_resources","description":"Count departments node pool resources","tags":["Departments"],"parameters":[{"$ref":"#/components/parameters/DepartmentNodePoolResourcesFilterBy"},{"$ref":"#/components/parameters/Search"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Patch multiple departments node pool resources in batch.

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

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"BatchPatchNodePoolResourcesRequest":{"type":"object","description":"Batch of node pool resources patch requests.","required":["patchRequests"],"properties":{"patchRequests":{"type":"array","minItems":1,"maxItems":100,"description":"Array of node pool resources patch requests.","items":{"$ref":"#/components/schemas/NodePoolResourcesPatchRequest"}}}},"NodePoolResourcesPatchRequest":{"type":"object","required":["orgUnitId","nodePoolId"],"properties":{"orgUnitId":{"description":"The project/department ID.","type":"string"},"nodePoolId":{"type":"string"},"rank":{"nullable":true,"type":"string"},"resources":{"$ref":"#/components/schemas/ResourcesPerNodePoolNullable"}}},"ResourcesPerNodePoolNullable":{"type":"object","nullable":true,"properties":{"gpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]}}},"Resource":{"properties":{"deserved":{"type":"number","format":"double","description":"The resource quota assigned to this org-unit.","nullable":true},"limit":{"type":"number","format":"double","description":"The maximum resource allocation for this org-unit. Set to null for unlimited.","nullable":true},"overQuotaWeight":{"type":"number","format":"double","description":"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](https://docshub.run.ai/guides/platform-management/aiinitiatives/organization/projects#gpu-over-quota) for more details.\n","nullable":true}}},"units":{"type":"string","description":"The unit of measurement for CPU memory values.","enum":["Mib","MB","GB"]},"BatchPatchDepartmentResourcesResponse":{"type":"object","required":["id","totalRequested","totalSuccessful","totalFailed"],"properties":{"id":{"type":"string","format":"uuid","description":"The unique ID of the batch operation."},"succeeded":{"type":"array","description":"Successfully patched department node pool resources results.","items":{"$ref":"#/components/schemas/DepartmentNodePoolResources"}},"failed":{"type":"array","description":"Failed patch operations with the original payload and error details.","items":{"$ref":"#/components/schemas/FailedNodePoolResourcesPatchRequest"}},"totalRequested":{"type":"integer","description":"Total number of items requested in the batch."},"totalSuccessful":{"type":"integer","description":"Number of items successfully processed."},"totalFailed":{"type":"integer","description":"Number of items that failed."}}},"DepartmentNodePoolResources":{"type":"object","required":["id","orgUnitId","orgUnitName","nodePoolId","nodePoolName","rank","resources","clusterId"],"properties":{"id":{"description":"The unique ID of the resources.","type":"string"},"orgUnitId":{"description":"The project/department ID.","type":"string"},"orgUnitName":{"description":"The project/department name.","type":"string"},"clusterId":{"type":"string"},"nodePoolId":{"type":"string"},"nodePoolName":{"type":"string"},"rank":{"type":"string"},"resources":{"$ref":"#/components/schemas/ResourcesPerNodePool"}}},"ResourcesPerNodePool":{"type":"object","properties":{"gpu":{"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the GPU quota assignment, maximum GPU device allocation, and weight assigned that determines the fairshare of over-quota resources."}]},"cpu":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"description":"Defines the CPU quota assignment in millicores (1000 millicores = 1 CPU core), maximum CPU allocation, and weight."}]},"memory":{"type":"object","nullable":true,"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","description":"Defines the CPU memory quota assignment, maximum allocation, and weight.","required":["units"],"properties":{"units":{"$ref":"#/components/schemas/units"}}}]}}},"FailedNodePoolResourcesPatchRequest":{"type":"object","properties":{"payload":{"$ref":"#/components/schemas/NodePoolResourcesPatchRequest"},"code":{"type":"integer","description":"HTTP error code."},"message":{"type":"string","description":"Error message."}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/departments/node-pool-resources/batch-patch":{"post":{"summary":"Patch multiple departments node pool resources in batch.","operationId":"batch_patch_department_node_pool_resources","description":"Partially updates node pool resource quotas for multiple departments in a single request.","tags":["Departments"],"requestBody":{"description":"Batch of department resources patch requests.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPatchNodePoolResourcesRequest"}}}},"responses":{"200":{"description":"Batch patch processed. Returns succeeded and failed items with totals and a batch id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPatchDepartmentResourcesResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get metrics for all departments.

> Get metrics for all departments in the cluster. Use a time range to return historical data (optional). \
> If you use a \`start\` date, an \`end\` date is required.<br>

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ClusterUuid":{"name":"clusterUuid","in":"path","required":true,"description":"The Universally Unique Identifier (UUID) of the cluster.","schema":{"type":"string","format":"uuid","minLength":1}},"Start":{"name":"start","in":"query","description":"Start of time range to fetch data from in UTC format.","required":false,"schema":{"type":"string","format":"date-time"}},"End":{"name":"end","in":"query","description":"End of time range to fetch data from in UTC format.","required":false,"schema":{"type":"string","format":"date-time"}},"NumberOfSamples":{"name":"numberOfSamples","in":"query","description":"The number of samples to take in the specified time range.","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"default":20}},"NodepoolName":{"in":"query","name":"nodepoolName","schema":{"type":"string"},"required":false,"description":"Filter by unique nodepool name."}},"schemas":{"departments":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Department1"},{"properties":{"timeRange":{}}}]}},"timeRange":{"$ref":"#/components/schemas/TimeRange"}}},"Department1":{"type":"object","required":["metadata","current"],"properties":{"metadata":{"type":"object","required":["departmentId","departmentName","clusterId","clusterName"],"properties":{"departmentId":{"$ref":"#/components/schemas/DepartmentId"},"departmentName":{"$ref":"#/components/schemas/DepartmentName"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"clusterName":{"$ref":"#/components/schemas/ClusterName"}}},"current":{"type":"object","description":"Current reported metrics data. resources holds data that is summed up to the department level and projectResources explains the division of it to projects","required":["resources","projectResources"],"properties":{"resources":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ResourcesData"},{"type":"object","required":["nodepoolName"],"properties":{"nodepoolName":{"$ref":"#/components/schemas/NodepoolName"}}}]}},"projectResources":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ResourcesData"},{"type":"object","required":["projectName","nodepoolName"],"properties":{"projectName":{"$ref":"#/components/schemas/ProjectName1"},"nodepoolName":{"$ref":"#/components/schemas/NodepoolName"}}}]}}}},"timeRange":{"$ref":"#/components/schemas/TimeRange"}}},"DepartmentId":{"description":"The id of the department","type":"integer","format":"int32","minimum":1},"DepartmentName":{"type":"string"},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"ClusterName":{"type":"string"},"ResourcesData":{"type":"object","required":["numberOfPendingWorkloads","gpu","cpu","memory"],"properties":{"numberOfPendingWorkloads":{"type":"integer"},"gpu":{"description":"GPU resources in fractions. 0.7 = 70% of a gpu","$ref":"#/components/schemas/ResourceData"},"cpu":{"description":"CPU resources in millicpus. 1000 = 1 cpu","$ref":"#/components/schemas/ResourceData"},"memory":{"description":"Memory resources in megabytes. 1 = 10^6  (1000*1000)","$ref":"#/components/schemas/ResourceData"}}},"ResourceData":{"type":"object","description":"quota equals to the given resources and allocated equal to the real count of used resources","required":["quota","allocated"],"properties":{"quota":{"type":"number"},"allocated":{"type":"number"},"utilization":{"type":"number"}}},"NodepoolName":{"type":"string"},"ProjectName1":{"type":"string"},"TimeRange":{"type":"object","description":"Overtime metrics data. Returned only if both start and end query parameters are set.","required":["resources"],"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourcesDataOvertime"}}}},"ResourcesDataOvertime":{"allOf":[{"$ref":"#/components/schemas/ResourcesData"},{"type":"object","required":["timestamp"],"properties":{"timestamp":{"type":"string","format":"date-time"}}}]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/k8s/clusters/{clusterUuid}/departments/metrics":{"get":{"tags":["Departments"],"deprecated":true,"summary":"Get metrics for all departments.","operationId":"getDepartmentsMetrics","description":"Get metrics for all departments in the cluster. Use a time range to return historical data (optional). \nIf you use a `start` date, an `end` date is required.\n","parameters":[{"$ref":"#/components/parameters/ClusterUuid"},{"$ref":"#/components/parameters/Start"},{"$ref":"#/components/parameters/End"},{"$ref":"#/components/parameters/NumberOfSamples"},{"$ref":"#/components/parameters/NodepoolName"}],"responses":{"200":{"description":"Successfully retrieved metrics for all departments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/departments"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get metrics for a specific department.

> Get metrics for a specific department in the cluster. \
> Use a time range to return historical data (optional). If you use a \`start\` date, an \`end\` date is required.<br>

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ClusterUuid":{"name":"clusterUuid","in":"path","required":true,"description":"The Universally Unique Identifier (UUID) of the cluster.","schema":{"type":"string","format":"uuid","minLength":1}},"DepartmentId":{"name":"departmentId","in":"path","required":true,"description":"The id of the department.","schema":{"type":"string","pattern":".*"}},"Start":{"name":"start","in":"query","description":"Start of time range to fetch data from in UTC format.","required":false,"schema":{"type":"string","format":"date-time"}},"End":{"name":"end","in":"query","description":"End of time range to fetch data from in UTC format.","required":false,"schema":{"type":"string","format":"date-time"}},"NumberOfSamples":{"name":"numberOfSamples","in":"query","description":"The number of samples to take in the specified time range.","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"default":20}},"NodepoolName":{"in":"query","name":"nodepoolName","schema":{"type":"string"},"required":false,"description":"Filter by unique nodepool name."}},"schemas":{"department":{"type":"object","required":["metadata","current"],"properties":{"metadata":{"type":"object","required":["departmentId","departmentName","clusterId","clusterName"],"properties":{"departmentId":{"$ref":"#/components/schemas/DepartmentId"},"departmentName":{"$ref":"#/components/schemas/DepartmentName"},"clusterId":{"$ref":"#/components/schemas/ClusterId"},"clusterName":{"$ref":"#/components/schemas/ClusterName"}}},"current":{"type":"object","description":"Current reported metrics data. resources holds data that is summed up to the department level and projectResources explains the division of it to projects","required":["resources","projectResources"],"properties":{"resources":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ResourcesData"},{"type":"object","required":["nodepoolName"],"properties":{"nodepoolName":{"$ref":"#/components/schemas/NodepoolName"}}}]}},"projectResources":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ResourcesData"},{"type":"object","required":["projectName","nodepoolName"],"properties":{"projectName":{"$ref":"#/components/schemas/ProjectName1"},"nodepoolName":{"$ref":"#/components/schemas/NodepoolName"}}}]}}}},"timeRange":{"$ref":"#/components/schemas/TimeRange"}}},"DepartmentId":{"description":"The id of the department","type":"integer","format":"int32","minimum":1},"DepartmentName":{"type":"string"},"ClusterId":{"description":"The id of the cluster.","type":"string","format":"uuid"},"ClusterName":{"type":"string"},"ResourcesData":{"type":"object","required":["numberOfPendingWorkloads","gpu","cpu","memory"],"properties":{"numberOfPendingWorkloads":{"type":"integer"},"gpu":{"description":"GPU resources in fractions. 0.7 = 70% of a gpu","$ref":"#/components/schemas/ResourceData"},"cpu":{"description":"CPU resources in millicpus. 1000 = 1 cpu","$ref":"#/components/schemas/ResourceData"},"memory":{"description":"Memory resources in megabytes. 1 = 10^6  (1000*1000)","$ref":"#/components/schemas/ResourceData"}}},"ResourceData":{"type":"object","description":"quota equals to the given resources and allocated equal to the real count of used resources","required":["quota","allocated"],"properties":{"quota":{"type":"number"},"allocated":{"type":"number"},"utilization":{"type":"number"}}},"NodepoolName":{"type":"string"},"ProjectName1":{"type":"string"},"TimeRange":{"type":"object","description":"Overtime metrics data. Returned only if both start and end query parameters are set.","required":["resources"],"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourcesDataOvertime"}}}},"ResourcesDataOvertime":{"allOf":[{"$ref":"#/components/schemas/ResourcesData"},{"type":"object","required":["timestamp"],"properties":{"timestamp":{"type":"string","format":"date-time"}}}]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/k8s/clusters/{clusterUuid}/departments/{departmentId}/metrics":{"get":{"tags":["Departments"],"deprecated":true,"summary":"Get metrics for a specific department.","operationId":"getDepartmentMetrics","description":"Get metrics for a specific department in the cluster. \nUse a time range to return historical data (optional). If you use a `start` date, an `end` date is required.\n","parameters":[{"$ref":"#/components/parameters/ClusterUuid"},{"$ref":"#/components/parameters/DepartmentId"},{"$ref":"#/components/parameters/Start"},{"$ref":"#/components/parameters/End"},{"$ref":"#/components/parameters/NumberOfSamples"},{"$ref":"#/components/parameters/NodepoolName"}],"responses":{"200":{"description":"Successfully retrieved metrics for the department.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/department"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## List all departments.

> List all the departments managed by the tenant on a specific cluster.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"Department2":{"allOf":[{"properties":{"nodePoolsResources":{"type":"array","items":{"$ref":"#/components/schemas/NodePoolAssignedResources"},"description":"Resources assigned to the Department per node pool."},"tenantId":{"type":"integer","description":"The tenant id this cluster belongs to."},"clusterUuid":{"type":"string","description":"The cluster UUID this department belongs to."},"createdAt":{"type":"string","description":"The creation date of the department.","format":"date-time"},"id":{"type":"integer","format":"int32","description":"The unique id identifying the department."},"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project2"},"description":"Projects under this department."},"projectsDeservedGpus":{"type":"string","description":"Deprecated. Instead, use 'nodePoolsResources' field. Total deserved GPUs of the projects under this department - as string.","deprecated":true},"departmentAdmins":{"type":"array","items":{"type":"string"},"description":"Id's of users with department admin role that are assigned to managed the department"}}},{"$ref":"#/components/schemas/DepartmentCommonFields"}]},"NodePoolAssignedResources":{"required":["id"],"allOf":[{"properties":{"id":{"description":"The id of the assigned resources. Required in PUT when updating the assigned resources.","type":"number"}}},{"$ref":"#/components/schemas/NodePoolAssignedResourcesCreate"}]},"NodePoolAssignedResourcesCreate":{"required":["nodePool"],"properties":{"nodePool":{"allOf":[{"$ref":"#/components/schemas/NodePoolResources"}],"description":"The node pool which the assigned resources refer to."},"gpu":{"allOf":[{"$ref":"#/components/schemas/Resource1"}],"description":"Number of GPUs assigned in the node pool."},"cpu":{"allOf":[{"$ref":"#/components/schemas/Resource1"}],"description":"Number of CPU Millicores assigned in the node pool. Supported only if the 'CPU Resources Quota' feature flag is enabled."},"memory":{"allOf":[{"$ref":"#/components/schemas/Resource1"}],"description":"Amount of CPU Memory Mib assigned in the node pool. Supported only if the 'CPU Resources Quota' feature flag is enabled."}}},"NodePoolResources":{"required":["id"],"properties":{"id":{"type":"number","description":"Node pool id."},"name":{"type":"string","description":"Node pool name."}}},"Resource1":{"properties":{"deserved":{"type":"number","description":"The amount of resources guaranteed to be allocated in case the cluster has those resources."},"maxAllowed":{"type":"number","description":"Maximum amount of resources that can be allocated. If equal to deserved, no over-quota will be allowed. Use \"-1\" for unlimited over quota."},"overQuotaWeight":{"type":"number","description":"The priority for over quota resources."}}},"Project2":{"allOf":[{"properties":{"name":{"type":"string","description":"Project name."},"nodePoolsResources":{"type":"array","items":{"$ref":"#/components/schemas/NodePoolAssignedResources"},"description":"Resources assigned to this Project per Node Pool."},"namespace":{"type":"string","description":"The name of an existing namespace to use for the project in the cluster. Supported only for cluster versions 2.12 or higher."},"id":{"type":"integer","format":"int32","description":"Project id.","readOnly":true},"departmentId":{"type":"integer","format":"int32","description":"ID of the department that owns the project."},"tenantId":{"type":"integer","format":"int32","description":"ID of the tenant where the project is located."},"clusterUuid":{"type":"string","format":"uuid","description":"ID of the cluster where the project is located."},"departmentName":{"type":"string","description":"Name of the department where the project is located."},"interactiveNodeAffinity":{"type":"string"},"trainNodeAffinity":{"type":"string"},"createdAt":{"type":"string","description":"Creation date of the project.","format":"date-time"},"status":{"$ref":"#/components/schemas/ProjectStatus1"},"phase":{"type":"string","description":"project's phase"}}},{"$ref":"#/components/schemas/ProjectCommonFields"}]},"ProjectStatus1":{"properties":{"namespace":{"type":"string","description":"The namespace of the project"},"message":{"type":"string","description":"Detailed phase message"},"quotaStatuses":{"$ref":"#/components/schemas/NodePoolsQuotaStatuses"}}},"NodePoolsQuotaStatuses":{"type":"array","items":{"$ref":"#/components/schemas/NodePoolQuotaStatus"},"description":"The current quota status for each node pool. Supported only for cluster versions 2.15+ or higher."},"NodePoolQuotaStatus":{"properties":{"nodePoolName":{"type":"string","description":"The node pool name which the current quota status refers to."},"allocated":{"$ref":"#/components/schemas/QuotaStatusResourceList"},"allocatedNonPreemptible":{"$ref":"#/components/schemas/QuotaStatusResourceList"},"requested":{"$ref":"#/components/schemas/QuotaStatusResourceList"}}},"QuotaStatusResourceList":{"properties":{"gpu":{"type":"number","description":"The number of GPUs (allocated/requested/...)."},"cpu":{"type":"number","description":"CPU in Millicores (allocated/requested/...)."},"memory":{"type":"number","description":"Memory in Mib (allocated/requested/...)."}}},"ProjectCommonFields":{"properties":{"deservedGpus":{"type":"number","description":"Deprecated. Use 'deserved' for the relevant resource type under `NodePoolResources`. The project's deserved GPU allocation in case the cluster has those resources.","deprecated":true},"maxAllowedGpus":{"type":"number","description":"Deprecated. Instead, use `maxAllowed` for the relevant resource type under `NodePoolResources`. An upper limit for the amount of GPUs the project can get (Even if over quota is allowed and resources are available).","deprecated":true},"gpuOverQuotaWeight":{"type":"number","description":"Deprecated. Instead, use `overQuotaWeight` for the relevant resource type under `NodePoolResources`. The priority the project gets for over quota resources.","maximum":3,"minimum":0,"deprecated":true},"defaultNodePools":{"type":"array","description":"Default node pools list for workload submission for this project if a workload doesn't specify a node pools list.","items":{"type":"string"}},"interactiveJobTimeLimitSecs":{"type":"number","description":"A limit (in seconds) for the duration of interactive jobs from this project."},"interactiveJobMaxIdleDurationSecs":{"type":"number","description":"Maximum duration (in seconds) that an interactive job can be idle before being terminated."},"interactivePreemptibleJobMaxIdleDurationSecs":{"type":"number","description":"Maximum duration (in seconds) that an interactive preemptible job can be idle before being terminated."},"trainingJobTimeLimitSecs":{"type":"number","description":"A limit (in seconds) for the duration of training jobs from this project. Available only from cluster version 2.12"},"trainingJobMaxIdleDurationSecs":{"type":"number","description":"Maximum duration (in seconds) that a training job can be idle before being terminated."},"nodeAffinity":{"allOf":[{"$ref":"#/components/schemas/JobsNodeAffinity"}],"description":"Node affinity configuration for jobs in the project."},"permissions":{"allOf":[{"$ref":"#/components/schemas/ResourcePermissions"}],"description":"Deprecated. Instead, use the `accessRules` API to add permissions to a specific subject in the project scope.","deprecated":true},"resources":{"allOf":[{"$ref":"#/components/schemas/AssignedResources"}],"deprecated":true,"description":"Deprecated. Instead, use `nodePoolsResources`. Total resources assigned to the Project. Can only be used in PUT/POST when there is a single Node Pool in the system. The resources returned in `GET` are the sum of all Node Pool Resources."}}},"JobsNodeAffinity":{"properties":{"train":{"allOf":[{"$ref":"#/components/schemas/NodeAffinity"}],"description":"Node affinity configuration for training jobs."},"interactive":{"allOf":[{"$ref":"#/components/schemas/NodeAffinity"}],"description":"Node affinity configuration for interactive jobs."}}},"NodeAffinity":{"properties":{"affinityType":{"type":"string","enum":["no_limit","only_selected"],"description":"The type of affinity of the jobs on the nodes."},"selectedTypes":{"type":"array","items":{"$ref":"#/components/schemas/NodeTypeForProject"}}}},"NodeTypeForProject":{"properties":{"id":{"type":"number"},"name":{"type":"string"}}},"ResourcePermissions":{"properties":{"users":{"type":"array","items":{"type":"string"},"description":"Names of users that have permissions to the project."},"groups":{"type":"array","items":{"type":"string"},"description":"Names of groups that have permissions to the project."},"applications":{"type":"array","items":{"type":"string"},"description":"Names of applications that have permissions to the project."}}},"AssignedResources":{"properties":{"id":{"type":"number"},"gpu":{"allOf":[{"$ref":"#/components/schemas/Resource1"}],"description":"GPU number assigned"},"cpu":{"allOf":[{"$ref":"#/components/schemas/Resource1"}],"description":"CPU Millicores assigned. Supported only if 'CPU Resources Quota' feature flag is enabled."},"memory":{"allOf":[{"$ref":"#/components/schemas/Resource1"}],"description":"CPU Memory Mib assigned. Supported only if 'CPU Resources Quota' feature flag is enabled."}}},"DepartmentCommonFields":{"properties":{"name":{"type":"string","description":"The name of the department."},"deservedGpus":{"type":"number","description":"Deprecated. Instead, use `deserved` for the relevant resource type under `NodePoolResources`. Deserved GPUs for the department.","deprecated":true},"allowOverQuota":{"type":"boolean","description":"Deprecated. Instead, use `maxAllowed` for the relevant resource type under `NodePoolResources`. Is over quota allowed for the department.","deprecated":true},"maxAllowedGpus":{"type":"number","description":"Deprecated. Instead, use `maxAllowed` for the relevant resource type under `NodePoolResources`. Max allowed GPUs for the department.","deprecated":true},"resources":{"allOf":[{"$ref":"#/components/schemas/AssignedResources"}],"deprecated":true,"description":"Deprecated. Instead, use 'nodePoolsResources'. Total resources assigned to the Department. Can only be used in PUT/POST when there is a single Node Pool in the system. The resources returned in GET are the sum of all Node Pool Resources."}}}}},"paths":{"/v1/k8s/clusters/{clusterId}/departments":{"get":{"tags":["Departments"],"deprecated":true,"summary":"List all departments.","description":"List all the departments managed by the tenant on a specific cluster.","operationId":"getDepartments","parameters":[{"in":"path","name":"clusterId","schema":{"type":"string"},"required":true,"description":"The Universally Unique Identifier (UUID) of the cluster."},{"in":"query","name":"excludePermissions","schema":{"type":"boolean"},"required":false,"description":"Backward compatibility of the `departmentAdmins` field. If `true`, the `departmentAdmins` field in the returned departments is not set. If `false`, the `departmentAdmins` is set in the returned departments."},{"in":"query","name":"memoryUnitMb","schema":{"type":"boolean"},"required":false,"description":"Memory returned in MB. When set to `false` (default) memory will be returned in MiB."}],"responses":{"200":{"description":"Successfully retrieved a list of Departments.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Department2"}}}}}}}}}}
```

## Set the department admins.

> Deprecated. Instead, use the accessrules API to add the department-admin permissions to a specific subject.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Departments","description":""}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"DepartmentAccessControl":{"properties":{"departmentId":{"type":"integer","format":"int32","description":"The unique id identifying the department."},"departmentAdmins":{"type":"array","items":{"type":"string"},"description":"Id's of users with department admin role that are assigned to managed the department"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/v1/k8s/clusters/{clusterId}/departments/{department-id}/access-control":{"put":{"tags":["Departments"],"summary":"Set the department admins.","description":"Deprecated. Instead, use the accessrules API to add the department-admin permissions to a specific subject.","operationId":"updateDepartmentAdmins","deprecated":true,"parameters":[{"in":"path","name":"clusterId","schema":{"type":"string"},"required":true,"description":"The unique uuid identifying the cluster."},{"in":"path","name":"department-id","schema":{"type":"integer"},"required":true,"description":"The unique id identifying the department."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentAccessControl"}}}},"responses":{"201":{"description":"Department admin set successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentAccessControl"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"}}}}}}
```
