Skip to content
Start here

Sites

List Sites
client.magicTransit.sites.list(SiteListParams { account_id, connectorid } params, RequestOptionsoptions?): SinglePage<Site { id, connector_id, description, 4 more } >
GET/accounts/{account_id}/magic/sites
Site Details
client.magicTransit.sites.get(stringsiteId, SiteGetParams { account_id, xMagicNewHcTarget } params, RequestOptionsoptions?): Site { id, connector_id, description, 4 more }
GET/accounts/{account_id}/magic/sites/{site_id}
Create a new Site
client.magicTransit.sites.create(SiteCreateParams { account_id, name, connector_id, 4 more } params, RequestOptionsoptions?): Site { id, connector_id, description, 4 more }
POST/accounts/{account_id}/magic/sites
Update Site
client.magicTransit.sites.update(stringsiteId, SiteUpdateParams { account_id, connector_id, description, 3 more } params, RequestOptionsoptions?): Site { id, connector_id, description, 4 more }
PUT/accounts/{account_id}/magic/sites/{site_id}
Patch Site
client.magicTransit.sites.edit(stringsiteId, SiteEditParams { account_id, connector_id, description, 3 more } params, RequestOptionsoptions?): Site { id, connector_id, description, 4 more }
PATCH/accounts/{account_id}/magic/sites/{site_id}
Delete Site
client.magicTransit.sites.delete(stringsiteId, SiteDeleteParams { account_id } params, RequestOptionsoptions?): Site { id, connector_id, description, 4 more }
DELETE/accounts/{account_id}/magic/sites/{site_id}
ModelsExpand Collapse
Site { id, connector_id, description, 4 more }
id?: string

Identifier

maxLength32
connector_id?: string

Magic Connector identifier tag.

description?: string
ha_mode?: boolean

Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.

location?: SiteLocation { lat, lon }

Location of site in latitude and longitude.

name?: string

The name of the site.

secondary_connector_id?: string

Magic Connector identifier tag. Used when high availability mode is on.

SiteLocation { lat, lon }

Location of site in latitude and longitude.

lat?: string

Latitude

lon?: string

Longitude

SitesApp Configuration

SitesACLs

List Site ACLs
client.magicTransit.sites.acls.list(stringsiteId, ACLListParams { account_id } params, RequestOptionsoptions?): SinglePage<ACL { id, description, forward_locally, 5 more } >
GET/accounts/{account_id}/magic/sites/{site_id}/acls
Site ACL Details
client.magicTransit.sites.acls.get(stringsiteId, stringaclId, ACLGetParams { account_id } params, RequestOptionsoptions?): ACL { id, description, forward_locally, 5 more }
GET/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Create a new Site ACL
client.magicTransit.sites.acls.create(stringsiteId, ACLCreateParams { account_id, lan_1, lan_2, 5 more } params, RequestOptionsoptions?): ACL { id, description, forward_locally, 5 more }
POST/accounts/{account_id}/magic/sites/{site_id}/acls
Update Site ACL
client.magicTransit.sites.acls.update(stringsiteId, stringaclId, ACLUpdateParams { account_id, description, forward_locally, 5 more } params, RequestOptionsoptions?): ACL { id, description, forward_locally, 5 more }
PUT/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Patch Site ACL
client.magicTransit.sites.acls.edit(stringsiteId, stringaclId, ACLEditParams { account_id, description, forward_locally, 5 more } params, RequestOptionsoptions?): ACL { id, description, forward_locally, 5 more }
PATCH/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
Delete Site ACL
client.magicTransit.sites.acls.delete(stringsiteId, stringaclId, ACLDeleteParams { account_id } params, RequestOptionsoptions?): ACL { id, description, forward_locally, 5 more }
DELETE/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}
ModelsExpand Collapse
ACL { id, description, forward_locally, 5 more }

Bidirectional ACL policy for network traffic within a site.

id?: string

Identifier

maxLength32
description?: string

Description for the ACL.

forward_locally?: boolean

The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.

lan_1?: ACLConfiguration { lan_id, lan_name, port_ranges, 2 more }
lan_2?: ACLConfiguration { lan_id, lan_name, port_ranges, 2 more }
name?: string

The name of the ACL.

protocols?: Array<AllowedProtocol>
One of the following:
"tcp"
"udp"
"icmp"
unidirectional?: boolean

The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.

ACLConfiguration { lan_id, lan_name, port_ranges, 2 more }
lan_id: string

The identifier for the LAN you want to create an ACL policy with.

lan_name?: string

The name of the LAN based on the provided lan_id.

port_ranges?: Array<string>

Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.

ports?: Array<number>

Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.

subnets?: Array<Subnet>

Array of subnet IPs within the LAN that will be included in the ACL. If no subnets are provided, communication on any subnets on this LAN are allowed.

AllowedProtocol = "tcp" | "udp" | "icmp"

Array of allowed communication protocols between configured LANs. If no protocols are provided, all protocols are allowed.

One of the following:
"tcp"
"udp"
"icmp"
Subnet = string

A valid IPv4 address.

SitesLANs

List Site LANs
client.magicTransit.sites.lans.list(stringsiteId, LANListParams { account_id } params, RequestOptionsoptions?): SinglePage<LAN { id, bond_id, ha_link, 9 more } >
GET/accounts/{account_id}/magic/sites/{site_id}/lans
Site LAN Details
client.magicTransit.sites.lans.get(stringsiteId, stringlanId, LANGetParams { account_id } params, RequestOptionsoptions?): LAN { id, bond_id, ha_link, 9 more }
GET/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Create a new Site LAN
client.magicTransit.sites.lans.create(stringsiteId, LANCreateParams { account_id, bond_id, ha_link, 8 more } params, RequestOptionsoptions?): SinglePage<LAN { id, bond_id, ha_link, 9 more } >
POST/accounts/{account_id}/magic/sites/{site_id}/lans
Update Site LAN
client.magicTransit.sites.lans.update(stringsiteId, stringlanId, LANUpdateParams { account_id, bond_id, is_breakout, 7 more } params, RequestOptionsoptions?): LAN { id, bond_id, ha_link, 9 more }
PUT/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Patch Site LAN
client.magicTransit.sites.lans.edit(stringsiteId, stringlanId, LANEditParams { account_id, bond_id, is_breakout, 7 more } params, RequestOptionsoptions?): LAN { id, bond_id, ha_link, 9 more }
PATCH/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
Delete Site LAN
client.magicTransit.sites.lans.delete(stringsiteId, stringlanId, LANDeleteParams { account_id } params, RequestOptionsoptions?): LAN { id, bond_id, ha_link, 9 more }
DELETE/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}
ModelsExpand Collapse
DHCPRelay { server_addresses }
server_addresses?: Array<string>

List of DHCP server IPs.

DHCPServer { dhcp_pool_end, dhcp_pool_start, dns_server, 2 more }
dhcp_pool_end?: string

A valid IPv4 address.

dhcp_pool_start?: string

A valid IPv4 address.

dns_server?: string

A valid IPv4 address.

dns_servers?: Array<string>
reservations?: Record<string, string>

Mapping of MAC addresses to IP addresses

LAN { id, bond_id, ha_link, 9 more }
id?: string

Identifier

maxLength32
bond_id?: number
is_breakout?: boolean

mark true to use this LAN for source-based breakout traffic

is_prioritized?: boolean

mark true to use this LAN for source-based prioritized traffic

name?: string
nat?: Nat { static_prefix }
physport?: number
routed_subnets?: Array<RoutedSubnet { next_hop, prefix, nat } >
next_hop: string

A valid IPv4 address.

prefix: string

A valid CIDR notation representing an IP range.

nat?: Nat { static_prefix }
site_id?: string

Identifier

maxLength32
static_addressing?: LANStaticAddressing { address, dhcp_relay, dhcp_server, 2 more }

If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address.

vlan_tag?: number

VLAN ID. Use zero for untagged.

LANStaticAddressing { address, dhcp_relay, dhcp_server, 2 more }

If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address.

address: string

A valid CIDR notation representing an IP range.

dhcp_relay?: DHCPRelay { server_addresses }
dhcp_server?: DHCPServer { dhcp_pool_end, dhcp_pool_start, dns_server, 2 more }
secondary_address?: string

A valid CIDR notation representing an IP range.

virtual_address?: string

A valid CIDR notation representing an IP range.

Nat { static_prefix }
static_prefix?: string

A valid CIDR notation representing an IP range.

RoutedSubnet { next_hop, prefix, nat }
next_hop: string

A valid IPv4 address.

prefix: string

A valid CIDR notation representing an IP range.

nat?: Nat { static_prefix }

SitesWANs

List Site WANs
client.magicTransit.sites.wans.list(stringsiteId, WANListParams { account_id } params, RequestOptionsoptions?): SinglePage<WAN { id, health_check_rate, name, 5 more } >
GET/accounts/{account_id}/magic/sites/{site_id}/wans
Site WAN Details
client.magicTransit.sites.wans.get(stringsiteId, stringwanId, WANGetParams { account_id } params, RequestOptionsoptions?): WAN { id, health_check_rate, name, 5 more }
GET/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Create a new Site WAN
client.magicTransit.sites.wans.create(stringsiteId, WANCreateParams { account_id, physport, name, 3 more } params, RequestOptionsoptions?): SinglePage<WAN { id, health_check_rate, name, 5 more } >
POST/accounts/{account_id}/magic/sites/{site_id}/wans
Update Site WAN
client.magicTransit.sites.wans.update(stringsiteId, stringwanId, WANUpdateParams { account_id, name, physport, 3 more } params, RequestOptionsoptions?): WAN { id, health_check_rate, name, 5 more }
PUT/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Patch Site WAN
client.magicTransit.sites.wans.edit(stringsiteId, stringwanId, WANEditParams { account_id, name, physport, 3 more } params, RequestOptionsoptions?): WAN { id, health_check_rate, name, 5 more }
PATCH/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
Delete Site WAN
client.magicTransit.sites.wans.delete(stringsiteId, stringwanId, WANDeleteParams { account_id } params, RequestOptionsoptions?): WAN { id, health_check_rate, name, 5 more }
DELETE/accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}
ModelsExpand Collapse
WAN { id, health_check_rate, name, 5 more }
id?: string

Identifier

maxLength32
health_check_rate?: "low" | "mid" | "high"

Magic WAN health check rate for tunnels created on this link. The default value is mid.

One of the following:
"low"
"mid"
"high"
name?: string
physport?: number
priority?: number

Priority of WAN for traffic loadbalancing.

site_id?: string

Identifier

maxLength32
static_addressing?: WANStaticAddressing { address, gateway_address, secondary_address }

(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode.

vlan_tag?: number

VLAN ID. Use zero for untagged.

WANStaticAddressing { address, gateway_address, secondary_address }

(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode.

address: string

A valid CIDR notation representing an IP range.

gateway_address: string

A valid IPv4 address.

secondary_address?: string

A valid CIDR notation representing an IP range.