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

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

# Get workload priorities.

GET http://localhost:8080/api/v1/workload-priorities

Retrieve the list of all workload priorities available in the system

Reference: https://docs.nvidia.com/run-ai/self-hosted/reference/rest-api/endpoints/workloads/workload-properties/get-workload-priorities

## Authentication

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

## Request

### Query parameters

- `sortOrder` (enum, optional, default: asc) — Sort results in descending or ascending order.
  - Allowed values: `asc`, `desc`
- `sortBy` (enum, optional) — Defines the field to sort the results by
  - Allowed values: `name`, `source`, `value`
- `filterBy` (list of string, optional) — 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 >=

## Response

### 200

Request completed successfully.

- `priorities` (list of WorkloadPriority, required)

## Errors

### 400 Bad Request Error

Bad request.

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

### 401 Unauthorized Error

Unauthorized

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

### 403 Forbidden Error

Forbidden

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

### 500 Internal Server Error

unexpected error

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

### 503 Service Unavailable Error

unexpected error

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

## Types

### WorkloadPriority

- `id` (string, required) — The unique identifier of the workload priority
- `name` (string, required) — The name of the workload priority (e.g., low, medium, high)
- `value` (integer, required) — The scheduling value assigned to this priority
- `aggregatedPhase` (string, optional) — Combined status of the priority across all clusters
- `status` (list of PriorityStatus, optional) — Per-cluster status details
- `scopeType` (string, optional) — The type of scope the workload priority applies to.
- `scopeId` (string, optional) — The unique identifier of the scope the workload priority applies to.
- `source` (string, optional) — The source of the priority class. Indicates where the priority definition originated. Currently, the value is either Run:ai or empty.
- `createdAt` (datetime, optional) — The timestamp for when the priority was created
- `updatedAt` (datetime, optional) — The timestamp for when the priority was updated

### PriorityStatus

- `clusterId` (string, optional) — The unique identifier of the cluster
- `phase` (string, optional) — Current phase of the priority in the specified cluster

## Examples

**Response**

```json
{
  "priorities": [
    {
      "id": "d73a738f-fab3-430a-8fa3-5241493d7128",
      "name": "medium",
      "value": 50,
      "aggregatedPhase": "Ready",
      "status": [
        {
          "clusterId": "d73a738f-fab3-430a-8fa3-5241493d7128",
          "phase": "Ready"
        }
      ],
      "scopeType": "tenant",
      "scopeId": "1",
      "source": "Run:ai",
      "createdAt": "2022-01-01T03:49:52.531Z",
      "updatedAt": "2022-06-08T11:28:24.131Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/api/v1/workload-priorities"

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

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

print(response.json())
```

```javascript
const url = 'http://localhost:8080/api/v1/workload-priorities';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go
package main

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

func main() {

	url := "http://localhost:8080/api/v1/workload-priorities"

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

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

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

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

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

}
```

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

url = URI("http://localhost:8080/api/v1/workload-priorities")

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

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

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

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

HttpResponse<String> response = Unirest.get("http://localhost:8080/api/v1/workload-priorities")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:8080/api/v1/workload-priorities', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/workload-priorities");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/workload-priorities")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```