---
title: "List resources using a policy"
method: GET
path: "/policies/{policyName}/usages"
tags: ["policies"]
---

# List resources using a policy

`GET /policies/{policyName}/usages`

## Request

- Base URL: `https://api.blaxel.ai/v0`
- URL: `https://api.blaxel.ai/v0/policies/{policyName}/usages`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/oauth/authorize`
    - Client credentials
    - Token URL: `/oauth/token` scopes: `policies:get`, `agents:list`, `functions:list`, `models:list`, `sandboxes:list`, `jobs:list`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/blaxel/apis/blaxel-control-plane/docs/policies/:policyName/usages/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns the names of every resource (agent, function, model, sandbox, job) currently referencing the given policy. Replaces the client-side fan-out the policies UI used to do over the listings.

## Path parameters

- `policyName` string, required

## Response `200`

successful operation

- PolicyUsages: Resources currently referencing a policy. Returned by GET /policies/{name}/usages so the policies UI can render attachments without fetching the agents/models/functions listings full.
  - `agents` object[]: Names of agents whose spec.policies contains this policy.
  - `functions` object[]: Names of functions whose spec.policies contains this policy.
  - `jobs` object[]: Names of jobs whose spec.policies contains this policy.
  - `models` object[]: Names of models whose spec.policies contains this policy.
  - `sandboxes` object[]: Names of sandboxes whose spec.policies contains this policy.

---

[API](https://skmtc.dev/blaxel/apis/blaxel-control-plane.md) - [All operations](https://skmtc.dev/blaxel/apis/blaxel-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/blaxel/apis/blaxel-control-plane/revisions/dfa264bc72ee?raw)
