> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# List DNC entries for the organization

GET https://api.smallest.ai/atoms/v1/dnc

Lists Do-Not-Call entries for the caller's organization with pagination, search,
and sort. Optionally scope to a single agent via `agentId`.

Each entry records a phone number that was flagged (via call outcome or manual
upload) as not-to-be-called for either the org or a specific agent.


Reference: https://docs.smallest.ai/api-reference/voice-agents/dnc/list

## Authentication

- `Authorization` header (bearer token, required) — API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

## Request

### Query parameters

- `agentId` (string, optional) — Optional 24-character hex agent ID. When present, restricts results to entries for this agent. Returns 400/404 if the ID isn't valid or doesn't belong to the caller's org.
- `search` (string, optional) — Free-text search across phone numbers.
- `sortField` (enum, optional, default: createdAt)
  - Allowed values: `createdAt`, `phoneNumber`
- `sortOrder` (enum, optional, default: desc)
  - Allowed values: `asc`, `desc`
- `page` (string, optional, default: 1) — Page number (string-encoded positive integer, ≥ 1).
- `offset` (string, optional, default: 50) — Page size (string-encoded; server clamps to 1–500).

## Response

### 200

Paginated DNC entries.

- `status` (boolean, optional)
- `data` (DncGetResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Bad request — validation failed or required field missing.

- `status` (boolean, optional)
- `errors` (list of string, optional)

### 401 Unauthorized Error

Unauthorized access

- `status` (boolean, optional)
- `errors` (list of string, optional)

### 404 Not Found Error

Resource not found. The referenced ID does not exist or does not belong to the caller's organization.

- `status` (boolean, optional)
- `errors` (list of string, optional)

### 500 Internal Server Error

Internal server error

- `status` (boolean, optional)
- `errors` (list of string, optional)

## Types

### DncGetResponsesContentApplicationJsonSchemaData

- `entries` (list of DncGetResponsesContentApplicationJsonSchemaDataEntriesItems, optional)
- `pagination` (DncGetResponsesContentApplicationJsonSchemaDataPagination, optional)

### DncGetResponsesContentApplicationJsonSchemaDataEntriesItems

- `id` (string, optional)
- `agentId` (string, optional)
- `orgId` (string, optional)
- `phoneNumber` (string, optional)
- `source` (string, optional)
- `detectedInCallId` (string, optional, nullable)
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)

### DncGetResponsesContentApplicationJsonSchemaDataPagination

- `page` (integer, optional)
- `offset` (integer, optional)
- `total` (integer, optional)
- `totalPages` (integer, optional)
- `hasMore` (boolean, optional)

## Examples

**Response**

```json
{
  "status": true,
  "data": {
    "entries": [
      {
        "id": "string",
        "agentId": "string",
        "orgId": "string",
        "phoneNumber": "string",
        "source": "string",
        "detectedInCallId": "string",
        "createdAt": "2024-01-15T09:30:00Z",
        "updatedAt": "2024-01-15T09:30:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "offset": 1,
      "total": 1,
      "totalPages": 1,
      "hasMore": true
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.smallest.ai/atoms/v1/dnc"

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

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

print(response.json())
```

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

	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.smallest.ai/atoms/v1/dnc")

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.smallest.ai/atoms/v1/dnc")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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