---
title: Update Prefix Dynamic Advertisement Status
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Addressing](https://developers.cloudflare.com/api/typescript/resources/addressing)

[Prefixes](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes)

[Advertisement Status](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/advertisement_status)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Update Prefix Dynamic Advertisement Status

Deprecated

client.addressing.prefixes.advertisementStatus.edit(stringprefixID, AdvertisementStatusEditParams {account\_id, advertised } params, RequestOptionsoptions?): [AdvertisementStatusEditResponse](<https://developers.cloudflare.com/api/typescript/resources/addressing#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(model)%20advertisement_status_edit_response%20%3E%20(schema)>) {advertised, advertised\_modified\_at }

PATCH/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/status

Advertise or withdraw the BGP route for a prefix.

**Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Magic Transit Write``IP Prefixes: Write``IP Prefixes: BGP On Demand Write`

##### ParametersExpand Collapse

prefixID: string

Identifier of an IP Prefix.

maxLength32

[Link to this property](<#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20prefix_id%20%3E%20(schema)>)

<details>

<summary>

params: AdvertisementStatusEditParams {account\_id, advertised }

</summary>

account\_id: string

Path param: Identifier of a Cloudflare account.

maxLength32

<a href="#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

advertised: boolean

Body param: Advertisement status of the prefix. If <code>true</code>, the BGP route for the prefix is advertised to the Internet. If <code>false</code>, the BGP route is withdrawn.

<a href="#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20advertised">Link to this property</a>

</details>

[Link to this property](<#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(method)%20edit%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

AdvertisementStatusEditResponse {advertised, advertised\_modified\_at }

</summary>

advertised?: boolean

Advertisement status of the prefix. If <code>true</code>, the BGP route for the prefix is advertised to the Internet. If <code>false</code>, the BGP route is withdrawn.

<a href="#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(model)%20advertisement_status_edit_response%20%3E%20(schema)%20%3E%20(property)%20advertised">Link to this property</a>

advertised\_modified\_at?: string| null

Last time the advertisement status was changed. This field is only not ‘null’ if on demand is enabled.

formatdate-time

<a href="#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(model)%20advertisement_status_edit_response%20%3E%20(schema)%20%3E%20(property)%20advertised_modified_at">Link to this property</a>

</details>

[Link to this property](<#(resource)%20addressing.prefixes.advertisement_status%20%3E%20(model)%20advertisement_status_edit_response%20%3E%20(schema)>)

### Update Prefix Dynamic Advertisement Status

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

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

const response = await client.addressing.prefixes.advertisementStatus.edit(
  '2af39739cc4e3b5910c918468bb89828',
  { account_id: '258def64c72dae45f3e4c8516e2111f2', advertised: true },
);

console.log(response.advertised);
```

200 example

```
{
  "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": {
    "advertised": true,
    "advertised_modified_at": "2014-01-01T05:20:00.12345Z"
  }
}
```

##### Returns Examples

200 example

```
{
  "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": {
    "advertised": true,
    "advertised_modified_at": "2014-01-01T05:20:00.12345Z"
  }
}
```