Skip to content
Start here

Edit Connector to update specific properties or Re-provision License Key

client.magicTransit.connectors.edit(stringconnectorId, ConnectorEditParams { account_id, activated, interrupt_window_days_of_week, 6 more } params, RequestOptionsoptions?): ConnectorEditResponse { id, activated, interrupt_window_days_of_week, 10 more }
PATCH/accounts/{account_id}/magic/connectors/{connector_id}

Edit Connector to update specific properties or Re-provision License Key

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
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)
Magic WAN Write
ParametersExpand Collapse
connectorId: string
params: ConnectorEditParams { account_id, activated, interrupt_window_days_of_week, 6 more }
account_id: string

Path param: Account identifier

maxLength32
activated?: boolean

Body param

interrupt_window_days_of_week?: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>

Body param: Allowed days of the week for upgrades. Default is all days.

One of the following:
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
interrupt_window_duration_hours?: number

Body param

maximum24
minimum1
interrupt_window_embargo_dates?: Array<string>

Body param: List of dates (YYYY-MM-DD) when upgrades are blocked.

interrupt_window_hour_of_day?: number

Body param

notes?: string

Body param

provision_license?: boolean

Body param: When true, regenerate license key for the connector.

timezone?: string

Body param

ReturnsExpand Collapse
ConnectorEditResponse { id, activated, interrupt_window_days_of_week, 10 more }
id: string
activated: boolean
interrupt_window_days_of_week: Array<"Sunday" | "Monday" | "Tuesday" | 4 more>

Allowed days of the week for upgrades. Default is all days.

One of the following:
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
interrupt_window_duration_hours: number
maximum24
minimum1
interrupt_window_embargo_dates: Array<string>

List of dates (YYYY-MM-DD) when upgrades are blocked.

interrupt_window_hour_of_day: number
last_updated: string
notes: string
timezone: string
device?: Device { id, serial_number }
id: string
serial_number?: string
last_heartbeat?: string
last_seen_version?: string
license_key?: string

Edit Connector to update specific properties or Re-provision License Key

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.magicTransit.connectors.edit('connector_id', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(response.id);
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "id": "id",
    "activated": true,
    "interrupt_window_days_of_week": [
      "Sunday"
    ],
    "interrupt_window_duration_hours": 1,
    "interrupt_window_embargo_dates": [
      "string"
    ],
    "interrupt_window_hour_of_day": 0,
    "last_updated": "last_updated",
    "notes": "notes",
    "timezone": "timezone",
    "device": {
      "id": "id",
      "serial_number": "serial_number"
    },
    "last_heartbeat": "last_heartbeat",
    "last_seen_version": "last_seen_version",
    "license_key": "license_key"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "id": "id",
    "activated": true,
    "interrupt_window_days_of_week": [
      "Sunday"
    ],
    "interrupt_window_duration_hours": 1,
    "interrupt_window_embargo_dates": [
      "string"
    ],
    "interrupt_window_hour_of_day": 0,
    "last_updated": "last_updated",
    "notes": "notes",
    "timezone": "timezone",
    "device": {
      "id": "id",
      "serial_number": "serial_number"
    },
    "last_heartbeat": "last_heartbeat",
    "last_seen_version": "last_seen_version",
    "license_key": "license_key"
  },
  "success": true
}