# Lists ## List Zero Trust lists `client.zeroTrust.gateway.lists.list(ListListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/gateway/lists` Fetch all Zero Trust lists for an account. ### Parameters - `params: ListListParams` - `account_id: string` Path param - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Query param: Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` ### Returns - `GatewayList` - `id?: string` Identify the API resource with a UUID. - `count?: number` Indicate the number of items in the list. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const gatewayList of client.zeroTrust.gateway.lists.list({ account_id: '699d98642c564d2e855e9661899b7252', })) { console.log(gatewayList.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "count": 20, "created_at": "2014-01-01T05:20:00.12345Z", "description": "The serial numbers for administrators", "items": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "Austin office IP", "value": "8GE8721REF" } ], "name": "Admin Serial Numbers", "type": "SERIAL", "updated_at": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get Zero Trust list details `client.zeroTrust.gateway.lists.get(stringlistId, ListGetParamsparams, RequestOptionsoptions?): GatewayList` **get** `/accounts/{account_id}/gateway/lists/{list_id}` Fetch a single Zero Trust list. ### Parameters - `listId: string` Identify the API resource with a UUID. - `params: ListGetParams` - `account_id: string` ### Returns - `GatewayList` - `id?: string` Identify the API resource with a UUID. - `count?: number` Indicate the number of items in the list. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const gatewayList = await client.zeroTrust.gateway.lists.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(gatewayList.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "count": 20, "created_at": "2014-01-01T05:20:00.12345Z", "description": "The serial numbers for administrators", "items": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "Austin office IP", "value": "8GE8721REF" } ], "name": "Admin Serial Numbers", "type": "SERIAL", "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Create Zero Trust list `client.zeroTrust.gateway.lists.create(ListCreateParamsparams, RequestOptionsoptions?): ListCreateResponse` **post** `/accounts/{account_id}/gateway/lists` Creates a new Zero Trust list. ### Parameters - `params: ListCreateParams` - `account_id: string` Path param - `name: string` Body param: Specify the list name. - `type: "SERIAL" | "URL" | "DOMAIN" | 6 more` Body param: Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `description?: string` Body param: Provide the list description. - `items?: Array` Body param: Add items to the list. - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. ### Returns - `ListCreateResponse` - `id?: string` Identify the API resource with a UUID. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const list = await client.zeroTrust.gateway.lists.create({ account_id: '699d98642c564d2e855e9661899b7252', name: 'Admin Serial Numbers', type: 'SERIAL', }); console.log(list.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2014-01-01T05:20:00.12345Z", "description": "The serial numbers for administrators", "items": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "Austin office IP", "value": "8GE8721REF" } ], "name": "Admin Serial Numbers", "type": "SERIAL", "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Update Zero Trust list `client.zeroTrust.gateway.lists.update(stringlistId, ListUpdateParamsparams, RequestOptionsoptions?): GatewayList` **put** `/accounts/{account_id}/gateway/lists/{list_id}` Updates a configured Zero Trust list. Skips updating list items if not included in the payload. A non empty list items will overwrite the existing list. ### Parameters - `listId: string` Identify the API resource with a UUID. - `params: ListUpdateParams` - `account_id: string` Path param - `name: string` Body param: Specify the list name. - `description?: string` Body param: Provide the list description. - `items?: Array` Body param: Add items to the list. - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. ### Returns - `GatewayList` - `id?: string` Identify the API resource with a UUID. - `count?: number` Indicate the number of items in the list. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const gatewayList = await client.zeroTrust.gateway.lists.update( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252', name: 'Admin Serial Numbers' }, ); console.log(gatewayList.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "count": 20, "created_at": "2014-01-01T05:20:00.12345Z", "description": "The serial numbers for administrators", "items": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "Austin office IP", "value": "8GE8721REF" } ], "name": "Admin Serial Numbers", "type": "SERIAL", "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Patch Zero Trust list. `client.zeroTrust.gateway.lists.edit(stringlistId, ListEditParamsparams, RequestOptionsoptions?): GatewayList` **patch** `/accounts/{account_id}/gateway/lists/{list_id}` Appends or removes an item from a configured Zero Trust list. ### Parameters - `listId: string` Identify the API resource with a UUID. - `params: ListEditParams` - `account_id: string` Path param - `append?: Array` Body param: Add items to the list. - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `remove?: Array` Body param: Lists of item values you want to remove. ### Returns - `GatewayList` - `id?: string` Identify the API resource with a UUID. - `count?: number` Indicate the number of items in the list. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const gatewayList = await client.zeroTrust.gateway.lists.edit( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(gatewayList.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "count": 20, "created_at": "2014-01-01T05:20:00.12345Z", "description": "The serial numbers for administrators", "items": [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "Austin office IP", "value": "8GE8721REF" } ], "name": "Admin Serial Numbers", "type": "SERIAL", "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Delete Zero Trust list `client.zeroTrust.gateway.lists.delete(stringlistId, ListDeleteParamsparams, RequestOptionsoptions?): ListDeleteResponse` **delete** `/accounts/{account_id}/gateway/lists/{list_id}` Deletes a Zero Trust list. ### Parameters - `listId: string` Identify the API resource with a UUID. - `params: ListDeleteParams` - `account_id: string` ### Returns - `ListDeleteResponse = unknown` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const list = await client.zeroTrust.gateway.lists.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252', }); console.log(list); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": {} } ``` ## Domain Types ### Gateway Item - `GatewayItem` - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. ### Gateway List - `GatewayList` - `id?: string` Identify the API resource with a UUID. - `count?: number` Indicate the number of items in the list. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### List Create Response - `ListCreateResponse` - `id?: string` Identify the API resource with a UUID. - `created_at?: string` - `description?: string` Provide the list description. - `items?: Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. - `name?: string` Specify the list name. - `type?: "SERIAL" | "URL" | "DOMAIN" | 6 more` Specify the list type. - `"SERIAL"` - `"URL"` - `"DOMAIN"` - `"EMAIL"` - `"IP"` - `"CATEGORY"` - `"LOCATION"` - `"DEVICE"` - `"AAGUID"` - `updated_at?: string` ### List Delete Response - `ListDeleteResponse = unknown` # Items ## Get Zero Trust list items `client.zeroTrust.gateway.lists.items.list(stringlistId, ItemListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/gateway/lists/{list_id}/items` Fetch all items in a single Zero Trust list. ### Parameters - `listId: string` Identify the API resource with a UUID. - `params: ItemListParams` - `account_id: string` ### Returns - `ItemListResponse = Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const itemListResponse of client.zeroTrust.gateway.lists.items.list( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, )) { console.log(itemListResponse); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ [ { "created_at": "2014-01-01T05:20:00.12345Z", "description": "Austin office IP", "value": "8GE8721REF" } ] ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Item List Response - `ItemListResponse = Array` Provide the list items. - `created_at?: string` - `description?: string` Provide the list item description (optional). - `value?: string` Specify the item value.