> 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.

# List policies

GET http://localhost:8080/api/v2/policy

Retrieve a list of all the applied policies.

Reference: https://docs.nvidia.com/run-ai/self-hosted/reference/rest-api/endpoints/policies/policy/list-policies

## Authentication

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

## Request

### Query parameters

- `workloadType` (enum, optional) — Policy for a specific workload type.
  - Allowed values: `Workspace`, `Training`, `Distributed`, `Inference`, `DistributedInference`
- `scope` (enum, optional) — filter by this scope.
  - Allowed values: `tenant`, `cluster`, `department`, `project`
- `departmentId` (string, optional) — Filter using the department id.
- `projectId` (string, optional) — project id to filter by
- `clusterId` (string, optional) — Filter using the Universally Unique Identifier (UUID) of the cluster.
- `includeFallbackPolicies` (boolean, optional) — whether to include fallback policies in the list. Default to false.

## Response

### 200

Request completed successfully.

- `policies` (list of PolicyListEntry, optional)

## Errors

### 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)

### 503 Service Unavailable Error

unexpected error

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

## Types

### PolicyListEntry

- `type` (enum, optional) — The type of policy which determines the kind of workloads it is affecting
  - Allowed values: `workspace`, `training`, `distributed`, `inference`, `distributedInference`, `nimService`, `fallback`
- `meta` (PolicyMeta, optional)
- `status` (PolicyListEntryStatus, optional)
- `availability` (PolicyStatus, optional, nullable) — Configuration issues detected by the server for the policy, along with its current phase.

### PolicyMeta

- `id` (string, required) — The unique id of the policy.
- `createdBy` (string, required) — The user who created the policy.
- `createdAt` (datetime, required) — The time at which the policy wes created
- `updatedBy` (string, required) — The user who updated the policy.
- `updatedAt` (datetime, required) — The time at which the policy has been updated
- `scope` (enum, required)
  - Allowed values: `system`, `tenant`, `cluster`, `department`, `project`
- `name` (string, required) — A chosen name for the policy.
- `tenantId` (integer, optional) — The id of the tenant.
- `clusterId` (string, optional) — The id of the cluster.
- `projectId` (integer, optional) — The id of the project.
- `departmentId` (string, optional) — The id of the department.

### PolicyListEntryStatus

- `clusters` (list of PolicySyncStatusOfCluster, optional)
- `validation` (PolicyListEntryStatusValidation, optional, nullable)

### PolicyStatus

Configuration issues detected by the server for the policy, along with its current phase.

- `phase` (enum, optional) — The current phase of the policy. Supported values include: - Ready: The policy is fully validated, and all rules are successfully applied to the workload. - PendingUpdate: Configuration components (e.g., specSelector, itemSelector) have changed. The policy is awaiting validation to ensure the full rule set remains functional; this validation occurs the next time the policy is applied. - Degraded: One or more policy rules cannot be applied due to recent configuration changes. While the policy remains active, some rules may be ignored during enforcement.
  - Allowed values: `Ready`, `PendingUpdate`, `Degraded`
- `issues` (list of string, optional) — The list of configuration issues detected for the policy.

### PolicySyncStatusOfCluster

- `clusterId` (string, required) — The id of the cluster.
- `status` (enum, required) — Policy sync status of the cluster
  - Allowed values: `Not ready`, `Applying`, `Failed`, `Ready`, `Pending deletion`, `Deleting`, `Deleted`, `Deletion failed`
- `errorMessage` (string, optional, nullable) — In case sync failed, holds the error message received from the cluster

### PolicyListEntryStatusValidation

- `errorMessage` (string, optional) — In case validation failed, holds the error message explaining the issue

## Examples

**Response**

```json
{
  "policies": [
    {
      "type": "workspace",
      "meta": {
        "id": "string",
        "createdBy": "string",
        "createdAt": "2024-01-15T09:30:00Z",
        "updatedBy": "string",
        "updatedAt": "2024-01-15T09:30:00Z",
        "scope": "system",
        "name": "my-policy",
        "tenantId": 1001,
        "clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
        "projectId": 1,
        "departmentId": "2"
      },
      "status": {
        "clusters": [
          {
            "clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
            "status": "Not ready",
            "errorMessage": "string"
          }
        ],
        "validation": {
          "errorMessage": "string"
        }
      },
      "availability": {
        "phase": "Ready",
        "issues": [
          "configuration-issue-1",
          "configuration-issue-2"
        ]
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/api/v2/policy"

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

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

print(response.json())
```

```javascript
const url = 'http://localhost:8080/api/v2/policy';
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/v2/policy"

	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/v2/policy")

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/v2/policy")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v2/policy");
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/v2/policy")! 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()
```