# Create Destination List

```http
POST /destinationlists
```

API: Cisco Secure Access Destination Lists API (version 2.0.4)

Operation ID: createDestinationList

Tags: Destination Lists, Secure Access

## Description

Create a destination list in your organization.

## Servers

```json
[
  {
    "url": "https://api.sse.cisco.com/{basePath}",
    "variables": {
      "basePath": {
        "default": "policies/v2"
      }
    }
  }
]
```

## Authentication

Satisfy any one of the following alternatives. Within each alternative, all listed schemes are required. An empty object allows anonymous access.

```json
[
  {
    "oauthFlow": [
      "policies.destinationLists:write"
    ]
  }
]
```

### Security schemes

```json
{
  "oauthFlow": {
    "type": "oauth2",
    "description": "client credential flow",
    "flows": {
      "clientCredentials": {
        "tokenUrl": "https://api.sse.cisco.com/auth/v2/token",
        "scopes": {
          "policies.destinationLists:write": "Write policies destination lists",
          "policies.destinationLists:read": "Read policies destination lists",
          "policies.destinations:write": "Write policies destinations",
          "policies.destinations:read": "Read policies destinations"
        }
      }
    }
  }
}
```

## Request body

Required: yes

```json
{
  "description": "Provide destination information and an optional array of destination objects.\n* Each API request accepts no more than 500 destination objects in the destination list.\n* Secure Access supports a maximum of 250,000 destinations spread across all destination lists in an organization.\n* Secure Access does not support global destination lists. Set the `isGlobal` field to `false`.\n* You cannot use the Destination Lists API to create a destination list with the `access` type of `thirdparty_block`.\n* You must set the `bundleTypeId` to `2`. Web profiles are applied on your access rules.\n* A domain name that you add to a destination list must not exceed 253 characters.\n\nIf you make an API request on the POST operation that adds a URL on a high-volume domain to a destination list,\nthe operation may succeed (`HTTP/200 OK`).\nHowever, the server returns an error message (`HTTP/400 Bad Request`) that indicates that the destination is on a high-volume domain.\n**Note:** Secure Access does not add URLs that are on high-volume domains to destination lists. Instead, we recommend that you add the domain only.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "access",
          "isGlobal",
          "name"
        ],
        "description": "The properties of the destination list.",
        "properties": {
          "access": {
            "type": "string",
            "example": "none",
            "description": "Configure your access rules to block or allow certain destination lists.\nNo support for the access type on destination lists.\nValid values are: `allow`, `block`, `url_proxy`, `no_decrypt`, `warn`, `none`, or `third_party_block`.",
            "enum": [
              "allow",
              "block",
              "url_proxy",
              "no_decrypt",
              "warn",
              "none",
              "thirdparty_block"
            ],
            "$$ref": "#/components/schemas/access"
          },
          "isGlobal": {
            "type": "boolean",
            "example": false,
            "description": "Specifies whether the destination list is a global destination list.\nThere is only one default `allow` destination list and one default `block` destination list for an organization.\n**Note:** No support for global destination lists. When you creat a destination list, set the `isGlobal` field to `false`.",
            "$$ref": "#/components/schemas/isGlobal"
          },
          "name": {
            "type": "string",
            "example": "Global Allow list",
            "description": "The name of the destination list.",
            "$$ref": "#/components/schemas/name"
          },
          "bundleTypeId": {
            "type": "integer",
            "enum": [
              2
            ],
            "example": 2,
            "description": "The type of the destination list.\nIn your policy rules, the system applies security controls to your destination lists.\n**Note:** When you create a destination list, set the `bundleTypeId` to `2`.",
            "$$ref": "#/components/schemas/bundleTypeIdCreate"
          },
          "destinations": {
            "type": "array",
            "description": "The list of destinations.",
            "maxItems": 500,
            "items": {
              "type": "object",
              "description": "The properties of the destination.",
              "properties": {
                "destination": {
                  "type": "string",
                  "example": "cisco.com",
                  "description": "A domain, URL, or IP.\nA domain name must contain no more than 253 characters.",
                  "$$ref": "#/components/schemas/destination"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "domain",
                    "url",
                    "ipv4"
                  ],
                  "example": "domain",
                  "description": "The type of the destination.",
                  "$$ref": "#/components/schemas/type"
                },
                "comment": {
                  "type": "string",
                  "description": "The comment about the destination.",
                  "example": "Add new destination list",
                  "$$ref": "#/components/schemas/comment"
                }
              }
            }
          }
        },
        "example": {
          "access": "none",
          "isGlobal": false,
          "name": "The name of the destination list."
        },
        "$$ref": "#/components/schemas/DestinationListCreate"
      },
      "example": {
        "access": "none",
        "isGlobal": false,
        "name": "New Destination List"
      }
    }
  },
  "required": true
}
```

## Responses

### 200

OK

```json
{
  "description": "OK",
  "headers": {
    "Content-Type": {
      "schema": {
        "type": "string"
      },
      "description": "The MIME content type of the response body.",
      "example": "application/json",
      "$$ref": "#/components/headers/Content-Type"
    },
    "Date": {
      "schema": {
        "type": "string",
        "pattern": "^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"
      },
      "description": "The timestamp of the response.",
      "example": "2023-03-14T18:34:25Z",
      "$$ref": "#/components/headers/Date"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "description": "The status and properties of the destination lists.",
        "required": [
          "status",
          "data"
        ],
        "properties": {
          "status": {
            "type": "object",
            "required": [
              "code",
              "text"
            ],
            "description": "The status information for the response.",
            "properties": {
              "code": {
                "type": "integer",
                "description": "The HTTP status code of the response.",
                "example": 200
              },
              "text": {
                "type": "string",
                "description": "The HTTP message that describes the response.",
                "example": "OK"
              }
            },
            "example": {
              "code": 200,
              "text": "OK"
            },
            "$$ref": "#/components/schemas/status"
          },
          "data": {
            "type": "object",
            "required": [
              "id",
              "organizationId",
              "access",
              "isGlobal",
              "name",
              "thirdpartyCategoryId",
              "createdAt",
              "modifiedAt",
              "isMspDefault",
              "markedForDeletion"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "example": 1234567,
                "description": "The unique ID of the destination list.",
                "$$ref": "#/components/schemas/id"
              },
              "organizationId": {
                "type": "integer",
                "example": 2345678,
                "description": "The organization ID.",
                "$$ref": "#/components/schemas/organizationId"
              },
              "access": {
                "type": "string",
                "example": "none",
                "description": "Configure your access rules to block or allow certain destination lists.\nNo support for the access type on destination lists.\nValid values are: `allow`, `block`, `url_proxy`, `no_decrypt`, `warn`, `none`, or `third_party_block`.",
                "enum": [
                  "allow",
                  "block",
                  "url_proxy",
                  "no_decrypt",
                  "warn",
                  "none",
                  "thirdparty_block"
                ],
                "$$ref": "#/components/schemas/access"
              },
              "isGlobal": {
                "type": "boolean",
                "example": false,
                "description": "Specifies whether the destination list is a global destination list.\nThere is only one default `allow` destination list and one default `block` destination list for an organization.\n**Note:** No support for global destination lists. When you creat a destination list, set the `isGlobal` field to `false`.",
                "$$ref": "#/components/schemas/isGlobal"
              },
              "name": {
                "type": "string",
                "example": "Global Allow list",
                "description": "The name of the destination list.",
                "$$ref": "#/components/schemas/name"
              },
              "thirdpartyCategoryId": {
                "type": "integer",
                "example": 1,
                "description": "The third-party category ID of the destination list."
              },
              "createdAt": {
                "type": "integer",
                "example": 1490206249,
                "description": "The date and time when the system created the destination list."
              },
              "modifiedAt": {
                "type": "integer",
                "example": 1520476127,
                "description": "The date and time when the system modified the destination list."
              },
              "isMspDefault": {
                "type": "boolean",
                "description": "Specifies whether MSP is the default.",
                "example": false
              },
              "markedForDeletion": {
                "type": "boolean",
                "example": false,
                "description": "Specifies whether the system marks the destination list for deletion."
              },
              "bundleTypeId": {
                "type": "integer",
                "enum": [
                  2
                ],
                "example": 2,
                "description": "The type of the destination list.\nIn your policy rules, the system applies security controls to your destination lists.",
                "$$ref": "#/components/schemas/bundleTypeIdCreateResponse"
              },
              "meta": {
                "type": "object",
                "description": "The total number of each type of destination in the destination list. The fields in the `meta` object are optional.",
                "properties": {
                  "destinationCount": {
                    "type": "integer",
                    "example": 5,
                    "description": "The total number of destinations in a destination list."
                  },
                  "domainCount": {
                    "type": "integer",
                    "example": 5,
                    "description": "The total number of domains in a destination list.\nDomains are part of the total number of destinations in a destination list."
                  },
                  "urlCount": {
                    "type": "integer",
                    "example": 0,
                    "description": "The total number of URLs in a destination list.\nUrls are part of the total number of destinations in a destination list."
                  },
                  "ipv4Count": {
                    "type": "integer",
                    "example": 0,
                    "description": "The total number of IPv4 addresses in a destination list.\nIPv4 addresses are part of the total number of destinations in a destination list."
                  },
                  "ipv6Count": {
                    "type": "integer",
                    "example": 0,
                    "description": "The total number of IPv6 addresses in a destination list.\nIPv6 addresses are part of the total number of destinations in a destination list."
                  },
                  "applicationCount": {
                    "type": "integer",
                    "example": 0,
                    "description": "The total number of applications in a destination list.\nApplications are part of the total number of destinations in a destination list."
                  }
                },
                "example": {
                  "domainCount": 1,
                  "urlCount": 0,
                  "ipv4Count": 1,
                  "ipv6Count": 0,
                  "destinationCount": 2,
                  "applicationCount": 0
                }
              }
            },
            "example": {
              "id": 1234567,
              "organizationId": 2345678,
              "access": "none",
              "isGlobal": false,
              "name": "Global Allow List",
              "thirdpartyCategoryId": 0,
              "createdAt": 1490206249,
              "modifiedAt": 1520476127,
              "isMspDefault": false,
              "markedForDeletion": false,
              "bundleTypeId": 2,
              "meta": {
                "destinationCount": 5,
                "domainCount": 5,
                "urlCount": 0,
                "ipv4Count": 0,
                "ipv6Count": 0,
                "applicationCount": 0
              }
            },
            "$$ref": "#/components/schemas/DestinationListCreateObject"
          }
        },
        "$$ref": "#/components/schemas/DestinationListCreateResponse"
      },
      "example": {
        "status": {
          "code": 200,
          "text": "OK"
        },
        "data": {
          "id": 2477857,
          "organizationId": 22429759,
          "access": "none",
          "isGlobal": false,
          "name": "New Destination List",
          "thirdpartyCategoryId": 0,
          "createdAt": 1532628019,
          "modifiedAt": 1532628019,
          "isMspDefault": false,
          "markedForDeletion": false,
          "bundleTypeId": 2,
          "meta": {
            "destinationCount": 1
          }
        }
      }
    }
  }
}
```

### 400

Bad Request

```json
{
  "description": "Bad Request",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "description": "Bad Request",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 400,
            "description": "HTTP status code"
          },
          "error": {
            "type": "string",
            "example": "Bad Request",
            "description": "A brief description of the error"
          },
          "message": {
            "type": "string",
            "example": "Validation Error"
          },
          "txId": {
            "type": "string",
            "example": "d479k9i2b723"
          }
        },
        "$$ref": "#/components/schemas/BadRequestError"
      },
      "examples": {
        "example_bad_request": {
          "summary": "Bad Request Example Response",
          "value": {
            "statusCode": 400,
            "error": "Bad Request",
            "message": "Validation Error",
            "txId": "d479k9i2b723-abdj1-672635-45362"
          },
          "$$ref": "#/components/examples/400BadRequestExample"
        }
      }
    }
  },
  "$$ref": "#/components/responses/BadRequest"
}
```

### 401

Unauthorized

```json
{
  "description": "Unauthorized",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "description": "Unauthorized",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 401,
            "description": "HTTP status code"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized",
            "description": "The authorization header is missing or the token is unauthorized."
          },
          "txId": {
            "type": "string",
            "example": "a478k9i2b723"
          }
        },
        "$$ref": "#/components/schemas/UnauthorizedError"
      }
    }
  },
  "$$ref": "#/components/responses/Unauthorized"
}
```

### 403

Forbidden

```json
{
  "description": "Forbidden",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "description": "Forbidden",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 403,
            "description": "HTTP status code"
          },
          "error": {
            "type": "string",
            "example": "Forbidden",
            "description": "The token is invalid."
          },
          "txId": {
            "type": "string",
            "example": "a478k9i2b723"
          }
        },
        "$$ref": "#/components/schemas/ForbiddenError"
      }
    }
  },
  "$$ref": "#/components/responses/Forbidden"
}
```

### 404

Not Found

```json
{
  "description": "Not Found",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "description": "Not Found",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 404,
            "description": "HTTP status code"
          },
          "error": {
            "type": "string",
            "example": "Not Found",
            "description": "A resource specified in the URL was not found."
          },
          "txId": {
            "type": "string",
            "example": "a478k9i2b723"
          }
        },
        "$$ref": "#/components/schemas/NotFoundError"
      }
    }
  },
  "$$ref": "#/components/responses/NotFound"
}
```

### 500

Internal Server Error

```json
{
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "description": "Internal Server Error",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 500,
            "description": "HTTP status code"
          },
          "error": {
            "type": "string",
            "example": "Internal Server Error",
            "description": "The server can not process the request."
          },
          "message": {
            "type": "string",
            "example": "An internal server error occurred"
          },
          "txId": {
            "type": "string",
            "example": "l477k9i2b893"
          }
        },
        "$$ref": "#/components/schemas/ServerError"
      }
    }
  },
  "$$ref": "#/components/responses/ServerErr"
}
```

## Additional OpenAPI fields

```json
{
  "__originalOperationId": "createDestinationList"
}
```
