Skip to content
Start here

Add an IP to an Address Map

client.addressing.addressMaps.ips.update(stringaddressMapId, stringipAddress, IPUpdateParams { account_id, body } params, RequestOptionsoptions?): IPUpdateResponse { errors, messages, success, result_info }
PUT/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}

Add an IP from a prefix owned by the account to 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
Accepted Permissions (at least one required)
Address Maps Write
ParametersExpand Collapse
addressMapId: string

Identifier of an Address Map.

maxLength32
ipAddress: string

An IPv4 or IPv6 address.

params: IPUpdateParams { account_id, body }
account_id: string

Path param: Identifier of a Cloudflare account.

maxLength32
body: unknown

Body param

ReturnsExpand Collapse
IPUpdateResponse { 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 an IP 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 ip = await client.addressing.addressMaps.ips.update(
  '055817b111884e0227e1be16a0be6ee0',
  '192.0.2.1',
  {
    account_id: '258def64c72dae45f3e4c8516e2111f2',
    body: {},
  },
);

console.log(ip.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
  }
}