Skip to main content

Devices

This endpoint allows an administrator to manage Devices.

API Documentation

GET /v0/devices

Example

$ curl -i \
-X GET "https://{firezone_host}/v0/devices" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {api_token}' \

HTTP/1.1 200
Content-Type: application/json; charset=utf-8

{
"data": [
{
"allowed_ips": "0.0.0.0/0,::/0",
"description": "factory description",
"dns": "1.1.1.1,1.0.0.1",
"endpoint": "localhost:51820",
"id": "9fc9b189-b740-4676-a7c2-c135b97d951d",
"inserted_at": "2023-01-13T06:30:47.092141Z",
"ipv4": "100.99.95.137",
"ipv6": "fd00::2a:3f6d",
"latest_handshake": null,
"mtu": 1280,
"name": "factory 3175",
"persistent_keepalive": 25,
"preshared_key": "Fj2iQKy5R5lLi8GIMI96FIfgWs/8saEYj4q6mLtgpg8=",
"public_key": "cVAdAno+PbyPBg5ubwxPe86QahSZ3AwhsKHfkFNw0nc=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.092141Z",
"use_default_allowed_ips": true,
"use_default_dns": true,
"use_default_endpoint": true,
"use_default_mtu": true,
"use_default_persistent_keepalive": true,
"user_id": "4b195eb9-d675-4143-8de0-64e68c5a6d86"
},
{
"allowed_ips": "0.0.0.0/0,::/0",
"description": "factory description",
"dns": "1.1.1.1,1.0.0.1",
"endpoint": "localhost:51820",
"id": "85243eb4-8c30-4bce-bb40-b4b9650e7ffa",
"inserted_at": "2023-01-13T06:30:47.101527Z",
"ipv4": "100.106.156.151",
"ipv6": "fd00::3e:876d",
"latest_handshake": null,
"mtu": 1280,
"name": "factory 2820",
"persistent_keepalive": 25,
"preshared_key": "NXiX1/xSyDfEl+S3O7VaaVTJKUu2kZo91pCycuZG3mk=",
"public_key": "e8e8+NBCAyHPycu2VJIRK9NQCR5Bz5Oo6aFbuOmUMhc=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.101527Z",
"use_default_allowed_ips": true,
"use_default_dns": true,
"use_default_endpoint": true,
"use_default_mtu": true,
"use_default_persistent_keepalive": true,
"user_id": "1949803a-bb74-429c-ac99-fae4ce09ca08"
},
{
"allowed_ips": "0.0.0.0/0,::/0",
"description": "factory description",
"dns": "1.1.1.1,1.0.0.1",
"endpoint": "localhost:51820",
"id": "7898b569-7c59-4596-b002-e1717c6fe5df",
"inserted_at": "2023-01-13T06:30:47.108829Z",
"ipv4": "100.120.62.86",
"ipv6": "fd00::38:7ee5",
"latest_handshake": null,
"mtu": 1280,
"name": "factory 2978",
"persistent_keepalive": 25,
"preshared_key": "i6kyqjysbWGEWMO9FNUDMxE1OhrYJsgjuIfgnJNApyE=",
"public_key": "ulryM87WfDob8foWZtIiaW+cH+ugh4t/31vSO2YNRtA=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.108829Z",
"use_default_allowed_ips": true,
"use_default_dns": true,
"use_default_endpoint": true,
"use_default_mtu": true,
"use_default_persistent_keepalive": true,
"user_id": "a1ebe3b2-3843-47ee-baf4-077740bfcd35"
},
{
"allowed_ips": "0.0.0.0/0,::/0",
"description": "factory description",
"dns": "1.1.1.1,1.0.0.1",
"endpoint": "localhost:51820",
"id": "3113df9e-29a4-4062-8a7d-7bf67612c61c",
"inserted_at": "2023-01-13T06:30:47.115812Z",
"ipv4": "100.64.196.12",
"ipv6": "fd00::1e:b441",
"latest_handshake": null,
"mtu": 1280,
"name": "factory 1577",
"persistent_keepalive": 25,
"preshared_key": "oZsi27RP/myoPFDTdxv29KVAxb2D1PTN+ojhUHsuM9I=",
"public_key": "ZZrmY3JKOLJc9JZO+JTBJ9toM+x3hZBikcEAAxhdnWY=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.115812Z",
"use_default_allowed_ips": true,
"use_default_dns": true,
"use_default_endpoint": true,
"use_default_mtu": true,
"use_default_persistent_keepalive": true,
"user_id": "634c7a8b-95c3-4c2f-9566-78be4d768cde"
},
{
"allowed_ips": "0.0.0.0/0,::/0",
"description": "factory description",
"dns": "1.1.1.1,1.0.0.1",
"endpoint": "localhost:51820",
"id": "44c8dd33-ad63-47cf-93ae-ff5ffcb16f52",
"inserted_at": "2023-01-13T06:30:47.123039Z",
"ipv4": "100.93.227.124",
"ipv6": "fd00::3:b1dd",
"latest_handshake": null,
"mtu": 1280,
"name": "factory 1673",
"persistent_keepalive": 25,
"preshared_key": "G0XAE7HCOArcB+RH09g/HIsDJM3SfYk9WKa1WYo6hv4=",
"public_key": "RBr9GYzFGuoltoIt2iTeqSb0CHaiPAcwxxxxSYlX4tg=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.123039Z",
"use_default_allowed_ips": true,
"use_default_dns": true,
"use_default_endpoint": true,
"use_default_mtu": true,
"use_default_persistent_keepalive": true,
"user_id": "b61a4d7a-34a6-4d37-9871-a024fb97fe60"
}
]
}

POST /v0/devices

Example

$ curl -i \
-X POST "https://{firezone_host}/v0/devices" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {api_token}' \
--data-binary @- << EOF
{
"device": {
"allowed_ips": "0.0.0.0/0, ::/0, 1.1.1.1",
"description": "create-description",
"dns": "9.9.9.8",
"endpoint": "9.9.9.9",
"ipv4": "100.64.0.2",
"ipv6": "fd00::2",
"mtu": 999,
"name": "create-name",
"persistent_keepalive": 9,
"preshared_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"public_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"use_default_allowed_ips": false,
"use_default_dns": false,
"use_default_endpoint": false,
"use_default_mtu": false,
"use_default_persistent_keepalive": false,
"user_id": "57afecab-c92c-45b8-8764-017a7cb5276b"
}
}'
EOF

HTTP/1.1 201
Content-Type: application/json; charset=utf-8
Location: /v0/devices/0f71030e-b872-494f-af2b-c31730f119e0

{
"data": {
"allowed_ips": "0.0.0.0/0, ::/0, 1.1.1.1",
"description": "create-description",
"dns": "9.9.9.8",
"endpoint": "9.9.9.9",
"id": "0f71030e-b872-494f-af2b-c31730f119e0",
"inserted_at": "2023-01-13T06:30:47.204640Z",
"ipv4": "100.64.0.2",
"ipv6": "fd00::2",
"latest_handshake": null,
"mtu": 999,
"name": "create-name",
"persistent_keepalive": 9,
"preshared_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"public_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.204640Z",
"use_default_allowed_ips": false,
"use_default_dns": false,
"use_default_endpoint": false,
"use_default_mtu": false,
"use_default_persistent_keepalive": false,
"user_id": "57afecab-c92c-45b8-8764-017a7cb5276b"
}
}

GET /v0/devices/{id}

Example

URI Parameters:

  • id: 904fbe05-86a5-4edb-afb2-6b728755a210
$ curl -i \
-X GET "https://{firezone_host}/v0/devices/{id}" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {api_token}' \

HTTP/1.1 200
Content-Type: application/json; charset=utf-8

{
"data": {
"allowed_ips": "0.0.0.0/0,::/0",
"description": "factory description",
"dns": "1.1.1.1,1.0.0.1",
"endpoint": "localhost:51820",
"id": "904fbe05-86a5-4edb-afb2-6b728755a210",
"inserted_at": "2023-01-13T06:30:47.048145Z",
"ipv4": "100.74.213.26",
"ipv6": "fd00::5:110a",
"latest_handshake": null,
"mtu": 1280,
"name": "factory 2403",
"persistent_keepalive": 25,
"preshared_key": "fue0i7cIahPPlWr6UCSerJNu3NRDrETv3YW+Xjc3qU4=",
"public_key": "6KYOCkP8off66kidQOXpwQlwKix8ELfXm/kR5cwsnug=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.048145Z",
"use_default_allowed_ips": true,
"use_default_dns": true,
"use_default_endpoint": true,
"use_default_mtu": true,
"use_default_persistent_keepalive": true,
"user_id": "bc22e5c4-853c-4e0d-bf93-85111707e66f"
}
}

PATCH /v0/devices/{id}

Example

URI Parameters:

  • id: ef1da923-caf4-47f3-ab6a-7ab0908d7f0e
$ curl -i \
-X PUT "https://{firezone_host}/v0/devices/{id}" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {api_token}' \
--data-binary @- << EOF
{
"device": {
"allowed_ips": "0.0.0.0/0, ::/0, 1.1.1.1",
"description": "create-description",
"dns": "9.9.9.8",
"endpoint": "9.9.9.9",
"ipv4": "100.64.0.2",
"ipv6": "fd00::2",
"mtu": 999,
"name": "create-name",
"persistent_keepalive": 9,
"preshared_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"public_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"use_default_allowed_ips": false,
"use_default_dns": false,
"use_default_endpoint": false,
"use_default_mtu": false,
"use_default_persistent_keepalive": false
}
}'
EOF

HTTP/1.1 200
Content-Type: application/json; charset=utf-8

{
"data": {
"allowed_ips": "0.0.0.0/0, ::/0, 1.1.1.1",
"description": "create-description",
"dns": "9.9.9.8",
"endpoint": "9.9.9.9",
"id": "ef1da923-caf4-47f3-ab6a-7ab0908d7f0e",
"inserted_at": "2023-01-13T06:30:47.264719Z",
"ipv4": "100.64.0.2",
"ipv6": "fd00::2",
"latest_handshake": null,
"mtu": 999,
"name": "create-name",
"persistent_keepalive": 9,
"preshared_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"public_key": "CHqFuS+iL3FTog5F4Ceumqlk0CU4Cl/dyUP/9F9NDnI=",
"remote_ip": null,
"rx_bytes": null,
"server_public_key": "is+0ov0/SZ9I+qyDD+adVoH9LreWHa85QQgpt6RUtA4=",
"tx_bytes": null,
"updated_at": "2023-01-13T06:30:47.279141Z",
"use_default_allowed_ips": false,
"use_default_dns": false,
"use_default_endpoint": false,
"use_default_mtu": false,
"use_default_persistent_keepalive": false,
"user_id": "ae05e328-3a67-4101-9d6b-48dcd9cdddf8"
}
}

DELETE /v0/devices/{id}

Example

URI Parameters:

  • id: 5b8cf677-ae60-4eca-b038-9abcd410904f
$ curl -i \
-X DELETE "https://{firezone_host}/v0/devices/{id}" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {api_token}' \

HTTP/1.1 204