# List API access policies (/docs/apis/management/resources/GetAllApiAccessPolicies)

`GET /resources/api_resources/{api_id}/policies`

Retrieves a paginated list of API access policies (both basic and advanced) for the specified API resource. Optional query parameters allow sorting of the results.

Base URL: `https://{tenant}.{region}.monocloud.com/api`, where `{tenant}`, `{region}` (one of us, eu, in) come from your tenant. Authentication: send your Management API key in the `X-API-KEY` header.

## Parameters

- `api_id` (path) (string, required) The unique identifier of the API resource.
- `page` (query) (integer, int32, default 1) The page number to retrieve.
- `size` (query) (integer, int32, default 10) The number of API access policies to return per page.
- `sort` (query) (string) Sort expression in the format `field:direction`, where direction is `1` for ascending or `-1` for descending. Supported fields include - `name`, `type`, `is_permitted`, `creation_time` and `last_updated`

## Response body

`200`, JSON. The API access policies were retrieved successfully

Returns `ApiAccessPolicy[]`. Each item has these fields:

- `id` (string, required) The unique identifier of the policy.
- `enabled` (boolean, required) Indicates whether the policy is enabled.
- `name` (string, required) Human-readable name for the policy.
- `description` (string) Description that explains the purpose of the policy.
- `type` (string, required) The policy authoring mode. Basic policies are authored using structured conditions; advanced policies are authored using Cedar policy source. One of: `basic`, `advanced`.
- `is_permitted` (boolean, required) Indicates whether the policy grants access when matched.
- `creation_time` (integer, required, date-time) Specifies the creation time of the policy (in Epoch).
- `last_updated` (integer, required, date-time) Specifies the last update time of the policy (in Epoch).
- `revision` (integer, required, int32) Specifies the current version of the policy. Incremented on every update.
- `client_id` (string) The unique identifier of the client this policy applies to. Returned for basic policies; `null` for advanced policies.

## Errors

- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
- `422` Unprocessable Entity
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
  - `errors` (Record<string, string[]>, required) A key-value map of validation errors, where each key represents a request field and the value contains one or more messages describing why the request could not be processed.

## Example (MonoCloud .NET SDK)

```csharp
using MonoCloud.Management;
using MonoCloud.Management.Core.Base;

var apiClient = new MonoCloudManagementClient(new MonoCloudConfig("<your-domain>", "[[API-Key]]"));


var apiId = "EF12vwe266fUHM6dh5Gup";

var page = 1;

var size = 10;

var sort = "priority:1";


var result = await apiClient.Resources.GetAllApiAccessPoliciesAsync(apiId, page, size, sort);
```

## Example (MonoCloud Javascript SDK)

```javascript
import { MonoCloudManagementClient } from '@monocloud/management';

const apiClient = MonoCloudManagementClient.init({ domain: '<your-domain>', apiKey: '[[API-Key]]' });

const apiId = 'EF12vwe266fUHM6dh5Gup';

const page = 1;

const size = 10;

const sort = 'priority:1';

const result = apiClient.resources.getAllApiAccessPolicies(apiId, page, size, sort);
```