# Regions ## List DLS regions for an account `client.dls.regions.list(RegionListParamsparams, RequestOptionsoptions?): CursorPagination` **get** `/accounts/{account_id}/dls/regions` List the DLS regions (managed and custom) available to an account. ### Parameters - `params: RegionListParams` - `account_id: string` Path param: Identifier of a Cloudflare account. - `cursor?: string` Query param: Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page. - `per_page?: number` Query param - `type?: "managed" | "custom"` Query param: Filter regions by type. Omit to return all regions. - `"managed"` - `"custom"` ### Returns - `RegionListResponse` - `id: string` - `created_on: string` - `modified_on: string` - `name: string` - `region_key: string` - `version: number` - `version_created_on: string` ### Example ```typescript 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 regionListResponse of client.dls.regions.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(regionListResponse.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "error_chain": [ {} ] } ], "messages": [ { "code": 1000, "message": "message", "error_chain": [ {} ] } ], "result": [ { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "region_key": "x", "version": 0, "version_created_on": "2019-12-27T18:11:19.117Z" } ], "result_info": { "count": 0, "cursor": "cursor", "per_page": 0 }, "success": true } ``` ## Get a DLS region `client.dls.regions.get(stringregionID, RegionGetParamsparams, RequestOptionsoptions?): RegionGetResponse` **get** `/accounts/{account_id}/dls/regions/{region_id}` Retrieve a single DLS region (managed or custom) by ID or region key. ### Parameters - `regionID: string` UUID of the region (custom or managed) or region_key of a managed region. - `params: RegionGetParams` - `account_id: string` Identifier of a Cloudflare account. ### Returns - `RegionGetResponse` - `id: string` - `created_on: string` - `modified_on: string` - `name: string` - `region_key: string` - `version: number` - `version_created_on: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const region = await client.dls.regions.get('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(region.id); ``` #### Response ```json { "messages": [ { "code": 1000, "message": "message", "error_chain": [ {} ] } ], "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "region_key": "x", "version": 0, "version_created_on": "2019-12-27T18:11:19.117Z" }, "success": true, "errors": [ { "code": 1000, "message": "message", "error_chain": [ {} ] } ] } ``` ## Domain Types ### Region List Response - `RegionListResponse` - `id: string` - `created_on: string` - `modified_on: string` - `name: string` - `region_key: string` - `version: number` - `version_created_on: string` ### Region Get Response - `RegionGetResponse` - `id: string` - `created_on: string` - `modified_on: string` - `name: string` - `region_key: string` - `version: number` - `version_created_on: string`