

# Destination Lists

The Cisco Secure Access Destination Lists API enables you to create and manage lists of network destinations. Use a destination list to block or allow a group of destinations on the internet access rules in the Access policy. You can find the Destination Lists API endpoints under the `policies` scope in the Secure Access API.

## Overview

* [About Destination Lists](#destination-lists)
* [About Destinations](#destinations)
* [Types of Destination](#types-destinations)
* [Walkthrough: Secure Access Destination Lists API](#walkthrough-destination-lists-api)
* [Rate Limits for Destination Lists and Destinations](#rate-limits-destination-lists)
* [Request Headers](#request-headers-dl)
* [Maximum Number of Destinations in Destination Lists for an Organization](#maximum-destinations-supported-in-organization)
* [POST Requests and Destination Lists](#post-requests)
* [Delete Destinations and Destination Limits](#delete-destinations)
* [Total Pages in Destination Lists API Collections](#total-pages-destination-lists)
* [Destination Lists API Endpoints](#destination-lists-endpoints)

<a name="destination-lists"></a>

## About Destination Lists

* Create a destination list and add a list of destinations
* Get, update, and delete a destination list
* Find the destination lists

<a name="destinations"></a>

## About Destinations

* Add destinations to a destination list
* Find the destinations in a destination list
* Delete the destinations in a destination list

<a name="types-destinations"></a>

## Types of Destination

A destination represents the following types of network location identifier:

* Domain name
* URL
* IPv4 or IPv6 address

You can create destination lists and add the various types of destination to a destination list.

{% note info %}<b>Note: </b>A domain name that you add to a destination list must not exceed 253 characters.
{% endnote %}

<a name="walkthrough-destination-lists-api"></a>

## Walkthrough: Secure Access Destination Lists API

<iframe width="560" height="315" src="https://www.youtube.com/embed/S9rGEjOmHUg?si=rCHmhZr_H8U670Vv" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

<a name="rate-limits-destination-lists"></a>

## Rate Limits for Destination Lists and Destinations

Secure Access enables rate limits on the Destination Lists and Destination API endpoints. For more information, see [Rate Limits > Destination Lists and Destinations](https://developer.cisco.com/docs/cloud-security/secure-access-api-rate-limits.md#policies).

<a name="request-headers-dl"></a>

## Request Headers

Unless specified, the Secure Access API endpoints use JSON for all requests and responses.

{% note info %}<b>Note: </b>For POST, PUT, and PATCH operations, set the HTTP <code>Content-Type</code> header to <code>application/json</code> in your API request.
{% endnote %}

<a name="maximum-destinations-supported-in-organization"></a>

## Maximum Number of Destinations in Destination Lists for an Organization

{% note info %}<b>Note: </b>Secure Access supports a maximum of 250,000 destinations spread across all destination lists in an organization.
{% endnote %}

The total number of destinations in all destination lists includes the destination lists for the Cisco Secure Access Security Feeds. For more information, see [Security Feeds API](https://developer.cisco.com/docs/cloud-security/secure-access-api-reference-security-feeds-overview.md).

If you make an API request that adds more destinations and the organization has 250,000 destinations in the destination lists, Secure Access returns an `HTTP 400` error response.

<!--For more information, see [Create Destination List](#!create-destination-list) and [Add Destinations to Destination List](#!add-destinations-to-destination-list). -->

### Sample Error Response

```json
{
    "error": "invalid_request",
    "message": "Max Destinations 250000 Limit Reached",
    "code": 400,
    "code_text": "Bad Request"
}
```

<a name="post-requests"></a>

## POST Requests and Destination Limits

The Destination Lists API `POST` endpoints accept no more than 500 Destination objects in the body of the request.

<!-- Note about thirdparty_block -->

**Note:** You cannot use the Destination Lists API to create a destination list with the `access` type of `thirdparty_block`. Secure Access creates destination lists with the `thirdparty_block` access type for the integration of the third-party and custom security vendors with threat feeds.

* POST `https://api.sse.cisco.com/policies/v2/destinationlists`
* POST `https://api.sse.cisco.com/policies/v2/destinationlists/{destinationListId}/destinations`

{% note info%}<b>Note: </b>If you make an API request to create a Destination List with more than 500 Destination objects, Secure Access returns an HTTP <code>400</code> error response.
{% endnote %}

### Error Conditions When Adding URLs on High-Volume Domains to Destination Lists

If you make a Destination Lists API request that adds a URL on a high-volume domain to a destination list, the operation may succeed (<code>HTTP/200 OK</code>). However, the server returns an error message (<code>HTTP/400 Bad Request</code>) that indicates that the destination is on a high-volume domain.

{% note info%}<b>Note: </b>Secure Access does not add URLs on high-volume domains to destination lists. Instead, we recommend that you add the domain only.
{% endnote %}

For more information about the error conditions that may occur when you add destinations to destination lists, see [Secure Access Help: Troubleshooting Destination Lists](https://docs.sse.cisco.com/sse-user-guide/docs/troubleshoot-dns-destination-lists).

### Global Access Lists

Secure Access does not support global destination lists. When you create a destination list, set the `isGlobal` field to `false`.

### Bundle Types

* When you create a destination list, set the `bundleTypeId` field to `2`. Secure Access supports the value of `2` (Web profile) for the bundle type (`bundleTypeId`).
* Secure Access creates destination lists with the `thirdparty_block` access type and the `bundleTypeId` of `1`.

### Access Type

Secure Access does not support an access type on destination lists. When you create a destination list, set the `access` field to `none`.

<a name="delete-destinations"></a>
## Delete Destinations and Destination Limits

The Destination Lists API `DELETE` operation, that removes a list of destinations from a destination list, accepts no more than 500 destination IDs in the body of the API request.

* DELETE `https://api.sse.cisco.com/policies/v2/destinationlists/{destinationListId}/destinations/remove`

{% note info%}<b>Note: </b>If you make an API request to remove more than 500 destinations from a destination list, Secure Access returns an HTTP <code>400</code> error response.
{% endnote %}

<a name="total-pages-destination-lists"></a>
## Total Pages in Destination Lists API Collections

You can use the value of the `total` field from the `meta` object in the API response to calculate the total number of pages in a collection of destination lists or destinations.

{% note info%}<b>Note: </b>For the Destination Lists API endpoints that return a collection, the default value for the <code>page</code> query parameter is <code>1</code>. The default value for the <code>limit</code> query parameter is <code>100</code>.
{% endnote %}

Destination Lists API endpoints that accept the `limit` and `query` parameters:

* GET `https://api.sse.cisco.com/policies/v2/destinationlists`
* GET `https://api.sse.cisco.com/policies/v2/destinationlists/{destinationListId}/destinations`

### Query Destination Lists Collection for Total Records

Create a `GET` request to the Destination Lists API collection, and set the `page` parameter to a number that you estimate is larger than the number of pages in the collection.

Example Request:

```shell
curl -L --location-trusted --request GET --url 'https://api.sse.cisco.com/policies/v2/destinationlists?page=50&limit=1' \
-H 'Authorization: Bearer %YourAccessToken%' \
-H 'Content-Type: application/json'
```

Example Response:

```json
{
    "status": {
        "code": 200,
        "text": "OK"
    },
    "meta": {
        "page": 50,
        "limit": 1,
        "total": 2
    },
    "data": []
}
```

### Calculate Total Pages in Collection

After getting the **total number of records** in the collection, calculate the number of pages in the collection. For a collection with more than the default number of records in a page (`100`), divide the **total number of records** by the default number of records in a page. If the total number of records in the collection is less than the default number of records in a page, the number of pages in the collection is `1`.

<a name="destination-lists-endpoints"></a>
## Destination Lists API Endpoints

* [Get Destination Lists](https://developer.cisco.com/docs/cloud-security/get-destination-lists.md)
* [Create Destination List](https://developer.cisco.com/docs/cloud-security/create-destination-list.md)
* [Update Destination List](https://developer.cisco.com/docs/cloud-security/update-destination-list.md)
* [Delete Destination List](https://developer.cisco.com/docs/cloud-security/delete-destination-list.md)
* [Get Destination List](https://developer.cisco.com/docs/cloud-security/get-destination-list.md)
* [Get Destinations in Destination List](https://developer.cisco.com/docs/cloud-security/get-destinations-in-destination-list.md)
* [Add Destinations to Destination List](https://developer.cisco.com/docs/cloud-security/add-destinations-to-destination-list.md)
* [Delete Destinations from Destination List](https://developer.cisco.com/docs/cloud-security/delete-destinations-from-destination-list.md)


## API information

- Version: 2.0.4
- Contact: Cloud Security Developer Community
- [Download OpenAPI Document](https://pubhub.devnetcloud.com/media/cloud-security-apis-in-eft/docs/secure-access/reference/policies/cisco_secure_access_destination_lists_api_2_0_4.yaml)
