# Workloads priorities

Manage workload scheduling priorities within a project. Priorities determine the order in which workloads are scheduled and whether they can be preempted. Higher-priority workloads in a project are scheduled first and may become non-preemptible, preventing interruption by lower-priority workloads. For more details, see [Workload Priority Control](https://run-ai-docs.nvidia.com/self-hosted/platform-management/runai-scheduler/scheduling/workload-priority-class-control).

## Get workload priorities.

> Retrieve the list of all workload priorities available in the system

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Workloads priorities","description":"Manage workload scheduling priorities within a project. Priorities determine the order in which workloads are scheduled and whether they can be preempted. Higher-priority workloads in a project are scheduled first and may become non-preemptible, preventing interruption by lower-priority workloads. For more details, see [Workload Priority Control](https://run-ai-docs.nvidia.com/self-hosted/platform-management/runai-scheduler/scheduling/workload-priority-class-control)."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"SortOrder":{"name":"sortOrder","in":"query","required":false,"description":"Sort results in descending or ascending order.","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},"WorkloadsPrioritiesSort":{"name":"sortBy","description":"Defines the field to sort the results by","in":"query","required":false,"schema":{"type":"string","enum":["name","source","value"]}},"WorkloadsPrioritiesFilter":{"name":"filterBy","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 >=","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^(name|source|value)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false}},"schemas":{"Priorities":{"type":"array","items":{"$ref":"#/components/schemas/WorkloadPriority"}},"WorkloadPriority":{"allOf":[{"type":"object"},{"properties":{"aggregatedPhase":{"type":"string","description":"Combined status of the priority across all clusters"},"status":{"type":"array","description":"Per-cluster status details","items":{"$ref":"#/components/schemas/PriorityStatus"}},"scopeType":{"description":"The type of scope the workload priority applies to.","type":"string"},"scopeId":{"description":"The unique identifier of the scope the workload priority applies to.","type":"string"}}},{"$ref":"#/components/schemas/BasePriority"}]},"PriorityStatus":{"type":"object","properties":{"clusterId":{"type":"string","description":"The unique identifier of the cluster"},"phase":{"type":"string","description":"Current phase of the priority in the specified cluster"}}},"BasePriority":{"type":"object","required":["id","name","value"],"properties":{"id":{"type":"string","description":"The unique identifier of the workload priority"},"source":{"description":"The source of the priority class. Indicates where the priority definition originated. Currently, the value is either Run:ai or empty.","type":"string"},"name":{"type":"string","description":"The name of the workload priority (e.g., low, medium, high)"},"value":{"type":"integer","minimum":0,"description":"The scheduling value assigned to this priority"},"createdAt":{"type":"string","format":"date-time","description":"The timestamp for when the priority was created"},"updatedAt":{"type":"string","format":"date-time","description":"The timestamp for when the priority was updated"}}},"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/workload-priorities":{"get":{"summary":"Get workload priorities.","description":"Retrieve the list of all workload priorities available in the system","operationId":"get_workload_priorities","tags":["Workloads priorities"],"parameters":[{"$ref":"#/components/parameters/SortOrder"},{"$ref":"#/components/parameters/WorkloadsPrioritiesSort"},{"$ref":"#/components/parameters/WorkloadsPrioritiesFilter"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"type":"object","required":["priorities"],"properties":{"priorities":{"$ref":"#/components/schemas/Priorities"}}}}}},"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"}}}}}}
```
