Skip to content
Start here

Add a zone membership to an Address Map

client.addressing.addressMaps.zones.update(stringaddressMapId, ZoneUpdateParams { zone_id, account_id, body } params, RequestOptionsoptions?): ZoneUpdateResponse { errors, messages, success, result_info }
PUT/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}

Add a zone as a member of a particular address map.

Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
addressMapId: string

Identifier of an Address Map.

maxLength32
params: ZoneUpdateParams { zone_id, account_id, body }
zone_id: string

Path param: Identifier of a zone.

maxLength32
account_id: string

Path param: Identifier of a Cloudflare account.

maxLength32
body: unknown

Body param

ReturnsExpand Collapse
ZoneUpdateResponse { errors, messages, success, result_info }
errors: Array<Error>
code: number
minimum1000
message: string
documentation_url?: string
source?: Source { pointer }
pointer?: string
messages: Array<Message>
code: number
minimum1000
message: string
documentation_url?: string
source?: Source { pointer }
pointer?: string
success: true

Whether the API call was successful.

result_info?: ResultInfo { count, page, per_page, 2 more }
count?: number

Total number of results for the requested service.

page?: number

Current page within paginated list of results.

per_page?: number

Number of results per page of results.

total_count?: number

Total results available without any search parameters.

total_pages?: number

The number of total pages in the entire result set.

Add a zone membership to an Address Map

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

const zone = await client.addressing.addressMaps.zones.update('055817b111884e0227e1be16a0be6ee0', {
  zone_id: '8ac8489932db6327334c9b6d58544cfe',
  account_id: '258def64c72dae45f3e4c8516e2111f2',
  body: {},
});

console.log(zone.errors);
{
  "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_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
Returns Examples
{
  "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_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}