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

# List policies

GET https://api.getdial.ai/api/v1/policies

Every policy on the account, newest first. Each item carries `entryCount` and omits `entries`; fetch a single policy to read its callers.

Reference: https://docs.getdial.ai/api-reference/rest-api/policies/list-policies

## Authentication

- `Authorization` header (bearer token, required) — Your Dial API key, sent as `Authorization: Bearer sk_live_...`

## Response

### 200

The account's policies.

- `policies` (list of Policy, optional)

## Errors

### 401 Unauthorized Error

Missing or invalid API key.

- `error` (ErrorError, optional) — An error message, or a validation-error object for 400 responses.

## Types

### Policy

- `id` (string, optional)
- `name` (string, optional)
- `type` (enum, optional) — The kind of policy. `allow_list` is the only type today.
  - Allowed values: `allow_list`
- `appliesTo` (enum, optional) — What the policy screens. `inbound_calls` is the only value today: outbound calls and messages are never affected.
  - Allowed values: `inbound_calls`
- `scope` (enum, optional) — `account` covers every number on the account, including numbers added later, except numbers that have an enabled allow list of their own. `numbers` covers only `numberIds`, and on those numbers it replaces the account-wide list.
  - Allowed values: `account`, `numbers`
- `numberIds` (list of string, optional) — The phone numbers a `numbers`-scoped policy covers. Always empty for `account` scope. Only numbers that can take calls can be added. A number can be on at most one policy of its own.
- `enabled` (boolean, optional) — Whether the policy is screening calls. A disabled policy counts as if it weren't there: its numbers fall back to the account-wide list, if there is one.
- `entryCount` (integer, optional) — How many callers are on the list.
- `entries` (list of PolicyEntry, optional) — The callers allowed through. Present on Get, Create and Update responses and on the entry endpoints; omitted from List.
- `blockedCallsLast7Days` (integer, optional) — Inbound calls this policy declined in the last 7 days. Each one is a call record with `status.terminationType` `blocked` and `blockedByPolicyId` set to this policy's `id`.
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional) — Last change to the policy, including changes to its entries.

### ErrorError

An error message, or a validation-error object for 400 responses.

- string
- map from string to any

### PolicyEntry

- `number` (string, required) — A caller allowed through, in E.164. On input, a number without a leading `+` is accepted only as 10 digits (or `1` followed by 10 digits) and read as a US number; anything else is refused with `400`.
- `label` (string, optional, nullable) — Who this caller is, for your own reference.

## Examples

**Response**

```json
{
  "policies": [
    {
      "id": "string",
      "name": "Known customers",
      "type": "allow_list",
      "appliesTo": "inbound_calls",
      "scope": "account",
      "numberIds": [
        "string"
      ],
      "enabled": true,
      "entryCount": 42,
      "entries": [
        {
          "number": "+14155550123",
          "label": "Jordan Lee"
        }
      ],
      "blockedCallsLast7Days": 19,
      "createdAt": "2024-01-15T09:30:00Z",
      "updatedAt": "2024-01-15T09:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.getdial.ai/api/v1/policies"

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

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

print(response.json())
```

```javascript
const url = 'https://api.getdial.ai/api/v1/policies';
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 := "https://api.getdial.ai/api/v1/policies"

	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("https://api.getdial.ai/api/v1/policies")

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

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("https://api.getdial.ai/api/v1/policies")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getdial.ai/api/v1/policies', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.getdial.ai/api/v1/policies");
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: "https://api.getdial.ai/api/v1/policies")! 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()
```