Skip to main content

ZeroTierOne Service API (0.1.0)

Download OpenAPI specification:Download

License: Apache 2.0

This API controls the ZeroTier service that runs in the background on your computer. This is how zerotier-cli, and the macOS and Windows apps control the service.

API requests must be authenticated via an authentication token. ZeroTier One saves this token in the authtoken.secret file in its working directory. This token may be supplied via the X-ZT1-Auth HTTP request header.

For example: curl -H "X-ZT1-Auth: $TOKEN" http://localhost:9993/status

The token can be found in:

  • Mac :: ~/Library/Application Support/ZeroTier/authtoken.secret
  • Windows :: \ProgramData\ZeroTier\One
  • Linux :: /var/lib/zerotier-one

You can get the OpenAPI spec here as well: https://docs.zerotier.com/openapi/servicev1.json

status

status

Node status and addressing info.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "address": "0deadbeef1",
  • "clock": 1618948931097,
  • "config": {
    },
  • "online": true,
  • "planetWorldId": 149604618,
  • "planetWorldTimestamp": 1618339625163,
  • "publicIdentity": "33c799cb58:0:690b44091ec50a44eb7f7769354b49abb47ac8747d99d547a1ec8c4d47623c5a6e3927f29b8d8443aebebc9ba4d4a812bd8902d71318db34b89d00186e8f4e4e",
  • "tcpFallbackActive": true,
  • "version": "1.6.4",
  • "versionBuild": 0,
  • "versionMajor": 1,
  • "versionMinor": 6,
  • "versionRev": 4
}

network

settings and status of a joined network

Get all network memberships.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a joined Network membership configuration by Network ID.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string

ID of the network to get.

Responses

Response samples

Content type
application/json
{
  • "allowDNS": true,
  • "allowDefault": true,
  • "allowGlobal": true,
  • "allowManaged": true,
  • "assignedAddresses": [
    ],
  • "bridge": true,
  • "broadcastEnabled": true,
  • "dns": {
    },
  • "id": "565799d8f620c5c5",
  • "mac": "e6:d2:2b:e6:68:73",
  • "mtu": 2800,
  • "multicastSubscriptions": [
    ],
  • "name": "clever_krum",
  • "netconfRevision": 123,
  • "portDeviceName": "ztnnhrtimp",
  • "portError": 0,
  • "routes": [
    ],
  • "status": "OK",
  • "type": "PRIVATE"
}

Join a network or update its configuration by Network ID.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string

ID of the network to change.

Request Body schema: application/json

Network membership object

allowDNS
boolean

Let ZeroTier modify the system's DNS settings.

allowDefault
boolean

Let ZeroTier modify the system's default route.

allowGlobal
boolean

Let ZeroTier manage IP addresses and route assignments that aren't in private ranges (rfc1918).

allowManaged
boolean

Let ZeroTier manage IP addresses and Route assignments.

assignedAddresses
Array of strings
bridge
boolean
broadcastEnabled
boolean
object
id
string
mac
string

MAC address for this network's interface.

mtu
integer
Array of objects
name
string
netconfRevision
integer
portDeviceName
string
portError
integer
Array of objects
status
string
type
string

Responses

Request samples

Content type
application/json
{
  • "allowDNS": true,
  • "allowDefault": true,
  • "allowGlobal": true,
  • "allowManaged": true,
  • "assignedAddresses": [
    ],
  • "bridge": true,
  • "broadcastEnabled": true,
  • "dns": {
    },
  • "id": "565799d8f620c5c5",
  • "mac": "e6:d2:2b:e6:68:73",
  • "mtu": 2800,
  • "multicastSubscriptions": [
    ],
  • "name": "clever_krum",
  • "netconfRevision": 123,
  • "portDeviceName": "ztnnhrtimp",
  • "portError": 0,
  • "routes": [
    ],
  • "status": "OK",
  • "type": "PRIVATE"
}

Response samples

Content type
application/json
{
  • "allowDNS": true,
  • "allowDefault": true,
  • "allowGlobal": true,
  • "allowManaged": true,
  • "assignedAddresses": [
    ],
  • "bridge": true,
  • "broadcastEnabled": true,
  • "dns": {
    },
  • "id": "565799d8f620c5c5",
  • "mac": "e6:d2:2b:e6:68:73",
  • "mtu": 2800,
  • "multicastSubscriptions": [
    ],
  • "name": "clever_krum",
  • "netconfRevision": 123,
  • "portDeviceName": "ztnnhrtimp",
  • "portError": 0,
  • "routes": [
    ],
  • "status": "OK",
  • "type": "PRIVATE"
}

Leave a network.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string

ID of the network

Responses

peer

peer status

Get all peers.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get information about a specific peer by Node ID.

Authorizations:
ApiKeyAuth
path Parameters
address
required
string

ZeroTier address of the peer to get

Responses

Response samples

Content type
application/json
{
  • "address": "992fcf1db7",
  • "isBonded": false,
  • "latency": 40,
  • "paths": [
    ],
  • "role": "LEAF",
  • "version": "1.6.4",
  • "versionMajor": 1,
  • "versionMinor": 6,
  • "versionRev": 4
}

controller

Get Controller Status.

Check for controller function and return controller status.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "controller": true,
  • "apiVersion": 3,
  • "clock": 1623101592
}

List Networks.

List IDs of all networks hosted by this controller.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
[
  • "3e245e31af7a726a"
]

Get Network by ID.

Get details of a network by its ID.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string
Example: 3e245e31af7a726a

ID of the network.

Responses

Response samples

Content type
application/json
{
  • "id": "3e245e31af000001",
  • "nwid": "3e245e31af000001",
  • "objtype": "network",
  • "name": "my-cool-network",
  • "creationTime": 1623101592,
  • "private": true,
  • "enableBroadcast": true,
  • "v4AssignMode": {
    },
  • "v6AssignMode": {
    },
  • "mtu": 2800,
  • "multicastLimit": 32,
  • "revision": 1,
  • "routes": [
    ],
  • "ipAssignmentPools": [
    ],
  • "rules": [
    ],
  • "capabilities": [
    ],
  • "tags": [
    ],
  • "remoteTraceTarget": "7f5d90eb87",
  • "remoteTraceLevel": 0
}

Create or Update a Network.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string
Example: 3e245e31af7a726a

ID of the network.

Request Body schema: application/json

Network object JSON.

name
string
private
boolean
enableBroadcast
boolean
object
object
mtu
integer
multicastLimit
integer
Array of objects
Array of objects
rules
Array of objects
capabilities
Array of objects
tags
Array of objects
remoteTraceTarget
string
remoteTraceLevel
integer

Responses

Request samples

Content type
application/json
{
  • "name": "my-cool-network",
  • "private": true,
  • "enableBroadcast": true,
  • "v4AssignMode": {
    },
  • "v6AssignMode": {
    },
  • "mtu": 2800,
  • "multicastLimit": 32,
  • "routes": [
    ],
  • "ipAssignmentPools": [
    ],
  • "rules": [
    ],
  • "capabilities": [
    ],
  • "tags": [
    ],
  • "remoteTraceTarget": "7f5d90eb87",
  • "remoteTraceLevel": 0
}

Response samples

Content type
application/json
{
  • "id": "3e245e31af000001",
  • "nwid": "3e245e31af000001",
  • "objtype": "network",
  • "name": "my-cool-network",
  • "creationTime": 1623101592,
  • "private": true,
  • "enableBroadcast": true,
  • "v4AssignMode": {
    },
  • "v6AssignMode": {
    },
  • "mtu": 2800,
  • "multicastLimit": 32,
  • "revision": 1,
  • "routes": [
    ],
  • "ipAssignmentPools": [
    ],
  • "rules": [
    ],
  • "capabilities": [
    ],
  • "tags": [
    ],
  • "remoteTraceTarget": "7f5d90eb87",
  • "remoteTraceLevel": 0
}

Generate Random Network ID.

Create a new network with a random ID.

Authorizations:
ApiKeyAuth
path Parameters
controllerID
required
string

Node ID of the controller.

Request Body schema: application/json

Network object JSON.

name
string
private
boolean
enableBroadcast
boolean
object
object
mtu
integer
multicastLimit
integer
Array of objects
Array of objects
rules
Array of objects
capabilities
Array of objects
tags
Array of objects
remoteTraceTarget
string
remoteTraceLevel
integer

Responses

Request samples

Content type
application/json
{
  • "name": "my-cool-network",
  • "private": true,
  • "enableBroadcast": true,
  • "v4AssignMode": {
    },
  • "v6AssignMode": {
    },
  • "mtu": 2800,
  • "multicastLimit": 32,
  • "routes": [
    ],
  • "ipAssignmentPools": [
    ],
  • "rules": [
    ],
  • "capabilities": [
    ],
  • "tags": [
    ],
  • "remoteTraceTarget": "7f5d90eb87",
  • "remoteTraceLevel": 0
}

Response samples

Content type
application/json
{
  • "id": "3e245e31af000001",
  • "nwid": "3e245e31af000001",
  • "objtype": "network",
  • "name": "my-cool-network",
  • "creationTime": 1623101592,
  • "private": true,
  • "enableBroadcast": true,
  • "v4AssignMode": {
    },
  • "v6AssignMode": {
    },
  • "mtu": 2800,
  • "multicastLimit": 32,
  • "revision": 1,
  • "routes": [
    ],
  • "ipAssignmentPools": [
    ],
  • "rules": [
    ],
  • "capabilities": [
    ],
  • "tags": [
    ],
  • "remoteTraceTarget": "7f5d90eb87",
  • "remoteTraceLevel": 0
}

List Network Members.

JSON object containing all member IDs as keys and their memberRevisionCounter values as values.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string

ID of the network.

Responses

Response samples

Content type
application/json
{
  • "03d516a9df": 5,
  • "b9d5ad8e13": 1
}

Get Network Member Details by ID.

Authorizations:
ApiKeyAuth
path Parameters
networkID
required
string

ID of the network.

nodeID
required
string

ID of the member node.

Responses

Response samples

Content type
application/json
{
  • "id": "eb8d45c5c9",
  • "address": "eb8d45c5c9",
  • "nwid": "3e245e31af000001",
  • "authorized": true,
  • "activeBridge": true,
  • "identity": "eb8d45c5c9:0:0279558f1a731cb2f628b3adc9f8915d7c2f3752e07d75f2d75fde08274b9c3a43d8b04115fd30f37043f61758ac874b844cc184fdf51e1022e988c1d093a50d:91a840bcd3fbac910afc56be4222973f675204a0ca9625218352e1c82debaa758b915d948c5fe4bd3c38cf1255904804a5b937f5edaef182ba8d5f3d8a243329",
  • "ipAssignments": [
    ],
  • "revision": 1,
  • "vMajor": 1,
  • "vMinor": 6,
  • "vRev": 5,
  • "vProto": 5
}