Files
netbird-docs/src/pages/ipa/resources/peers.mdx
Zoltan Papp b5ce088750 Remote debug (#564)
* Extend the trouble shooting with remote debug
2026-01-22 11:01:21 +01:00

2405 lines
49 KiB
Plaintext

export const title = 'Peers'
## List all Peers {{ tag: 'GET' , label: '/api/peers' }}
<Row>
<Col>
Returns a list of all peers
### Query Parameters
<Properties>
<Property name="name" type="string" required={false}>
Filter peers by name
</Property>
<Property name="ip" type="string" required={false}>
Filter peers by IP address
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/api/peers">
```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: '/api/peers',
headers: {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers"
headers = {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers")
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"created_at": "2023-05-05T09:00:35.477782Z",
"ip": "10.64.0.1",
"connection_ip": "35.64.0.1",
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z",
"os": "Darwin 13.2.1",
"kernel_version": "23.2.0",
"geoname_id": 2643743,
"version": "0.14.0",
"groups": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"resources_count": 5,
"issued": "api"
}
],
"ssh_enabled": true,
"user_id": "google-oauth2|277474792786460067937",
"hostname": "stage-host-1",
"ui_version": "0.14.0",
"dns_label": "stage-host-1.netbird.cloud",
"login_expiration_enabled": false,
"login_expired": false,
"last_login": "2023-05-05T09:00:35.477782Z",
"inactivity_expiration_enabled": false,
"approval_required": true,
"disapproval_reason": {
"description": "(Cloud only) Reason why the peer requires approval",
"type": "string"
},
"country_code": "DE",
"city_name": "Berlin",
"serial_number": "C02XJ0J0JGH7",
"extra_dns_labels": [
"stage-host-1"
],
"ephemeral": false,
"local_flags": {
"rosenpass_enabled": true,
"rosenpass_permissive": false,
"server_ssh_allowed": true,
"disable_client_routes": false,
"disable_server_routes": false,
"disable_dns": false,
"disable_firewall": false,
"block_lan_access": false,
"block_inbound": false,
"lazy_connection_enabled": false
},
"accessible_peers_count": 5
}
]
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"name": "string",
"created_at": "string",
"ip": "string",
"connection_ip": "string",
"connected": "boolean",
"last_seen": "string",
"os": "string",
"kernel_version": "string",
"geoname_id": "integer",
"version": "string",
"groups": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"resources_count": "integer",
"issued": "string"
}
],
"ssh_enabled": "boolean",
"user_id": "string",
"hostname": "string",
"ui_version": "string",
"dns_label": "string",
"login_expiration_enabled": "boolean",
"login_expired": "boolean",
"last_login": "string",
"inactivity_expiration_enabled": "boolean",
"approval_required": "boolean",
"disapproval_reason": "string",
"country_code": "string",
"city_name": "string",
"serial_number": "string",
"extra_dns_labels": [
"string"
],
"ephemeral": "boolean",
"local_flags": {
"rosenpass_enabled": "boolean",
"rosenpass_permissive": "boolean",
"server_ssh_allowed": "boolean",
"disable_client_routes": "boolean",
"disable_server_routes": "boolean",
"disable_dns": "boolean",
"disable_firewall": "boolean",
"block_lan_access": "boolean",
"block_inbound": "boolean",
"lazy_connection_enabled": "boolean"
},
"accessible_peers_count": "integer"
}
]
```
</CodeGroup>
</Col>
</Row>
---
## Retrieve a Peer {{ tag: 'GET' , label: '/api/peers/{peerId}' }}
<Row>
<Col>
Get information about a peer
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/api/peers/{peerId}">
```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers/{peerId} \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}',
headers: {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}"
headers = {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"created_at": "2023-05-05T09:00:35.477782Z",
"ip": "10.64.0.1",
"connection_ip": "35.64.0.1",
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z",
"os": "Darwin 13.2.1",
"kernel_version": "23.2.0",
"geoname_id": 2643743,
"version": "0.14.0",
"groups": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"resources_count": 5,
"issued": "api"
}
],
"ssh_enabled": true,
"user_id": "google-oauth2|277474792786460067937",
"hostname": "stage-host-1",
"ui_version": "0.14.0",
"dns_label": "stage-host-1.netbird.cloud",
"login_expiration_enabled": false,
"login_expired": false,
"last_login": "2023-05-05T09:00:35.477782Z",
"inactivity_expiration_enabled": false,
"approval_required": true,
"disapproval_reason": {
"description": "(Cloud only) Reason why the peer requires approval",
"type": "string"
},
"country_code": "DE",
"city_name": "Berlin",
"serial_number": "C02XJ0J0JGH7",
"extra_dns_labels": [
"stage-host-1"
],
"ephemeral": false,
"local_flags": {
"rosenpass_enabled": true,
"rosenpass_permissive": false,
"server_ssh_allowed": true,
"disable_client_routes": false,
"disable_server_routes": false,
"disable_dns": false,
"disable_firewall": false,
"block_lan_access": false,
"block_inbound": false,
"lazy_connection_enabled": false
}
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"created_at": "string",
"ip": "string",
"connection_ip": "string",
"connected": "boolean",
"last_seen": "string",
"os": "string",
"kernel_version": "string",
"geoname_id": "integer",
"version": "string",
"groups": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"resources_count": "integer",
"issued": "string"
}
],
"ssh_enabled": "boolean",
"user_id": "string",
"hostname": "string",
"ui_version": "string",
"dns_label": "string",
"login_expiration_enabled": "boolean",
"login_expired": "boolean",
"last_login": "string",
"inactivity_expiration_enabled": "boolean",
"approval_required": "boolean",
"disapproval_reason": "string",
"country_code": "string",
"city_name": "string",
"serial_number": "string",
"extra_dns_labels": [
"string"
],
"ephemeral": "boolean",
"local_flags": {
"rosenpass_enabled": "boolean",
"rosenpass_permissive": "boolean",
"server_ssh_allowed": "boolean",
"disable_client_routes": "boolean",
"disable_server_routes": "boolean",
"disable_dns": "boolean",
"disable_firewall": "boolean",
"block_lan_access": "boolean",
"block_inbound": "boolean",
"lazy_connection_enabled": "boolean"
}
}
```
</CodeGroup>
</Col>
</Row>
---
## Update a Peer {{ tag: 'PUT' , label: '/api/peers/{peerId}' }}
<Row>
<Col>
Update information about a peer
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
</Property>
<Property name="ssh_enabled" type="boolean" required={true}>
</Property>
<Property name="login_expiration_enabled" type="boolean" required={true}>
</Property>
<Property name="inactivity_expiration_enabled" type="boolean" required={true}>
</Property>
<Property name="approval_required" type="boolean" required={false}>
(Cloud only) Indicates whether peer needs approval
</Property>
<Property name="ip" type="string" required={false}>
Peer's IP address
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/peers/{peerId}">
```bash {{ title: 'cURL' }}
curl -X PUT https://api.netbird.io/api/peers/{peerId} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
});
let config = {
method: 'put',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Token <TOKEN>'
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}"
payload = json.dumps({
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}"
method := "PUT"
payload := strings.NewReader(`{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
})
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
.method("PUT", body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"inactivity_expiration_enabled": false,
"approval_required": true,
"ip": "100.64.0.15"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"created_at": "2023-05-05T09:00:35.477782Z",
"ip": "10.64.0.1",
"connection_ip": "35.64.0.1",
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z",
"os": "Darwin 13.2.1",
"kernel_version": "23.2.0",
"geoname_id": 2643743,
"version": "0.14.0",
"groups": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"resources_count": 5,
"issued": "api"
}
],
"ssh_enabled": true,
"user_id": "google-oauth2|277474792786460067937",
"hostname": "stage-host-1",
"ui_version": "0.14.0",
"dns_label": "stage-host-1.netbird.cloud",
"login_expiration_enabled": false,
"login_expired": false,
"last_login": "2023-05-05T09:00:35.477782Z",
"inactivity_expiration_enabled": false,
"approval_required": true,
"disapproval_reason": {
"description": "(Cloud only) Reason why the peer requires approval",
"type": "string"
},
"country_code": "DE",
"city_name": "Berlin",
"serial_number": "C02XJ0J0JGH7",
"extra_dns_labels": [
"stage-host-1"
],
"ephemeral": false,
"local_flags": {
"rosenpass_enabled": true,
"rosenpass_permissive": false,
"server_ssh_allowed": true,
"disable_client_routes": false,
"disable_server_routes": false,
"disable_dns": false,
"disable_firewall": false,
"block_lan_access": false,
"block_inbound": false,
"lazy_connection_enabled": false
}
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"created_at": "string",
"ip": "string",
"connection_ip": "string",
"connected": "boolean",
"last_seen": "string",
"os": "string",
"kernel_version": "string",
"geoname_id": "integer",
"version": "string",
"groups": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"resources_count": "integer",
"issued": "string"
}
],
"ssh_enabled": "boolean",
"user_id": "string",
"hostname": "string",
"ui_version": "string",
"dns_label": "string",
"login_expiration_enabled": "boolean",
"login_expired": "boolean",
"last_login": "string",
"inactivity_expiration_enabled": "boolean",
"approval_required": "boolean",
"disapproval_reason": "string",
"country_code": "string",
"city_name": "string",
"serial_number": "string",
"extra_dns_labels": [
"string"
],
"ephemeral": "boolean",
"local_flags": {
"rosenpass_enabled": "boolean",
"rosenpass_permissive": "boolean",
"server_ssh_allowed": "boolean",
"disable_client_routes": "boolean",
"disable_server_routes": "boolean",
"disable_dns": "boolean",
"disable_firewall": "boolean",
"block_lan_access": "boolean",
"block_inbound": "boolean",
"lazy_connection_enabled": "boolean"
}
}
```
</CodeGroup>
</Col>
</Row>
---
## Delete a Peer {{ tag: 'DELETE' , label: '/api/peers/{peerId}' }}
<Row>
<Col>
Delete a peer
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="DELETE" label="/api/peers/{peerId}">
```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/peers/{peerId} \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'delete',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}',
headers: {
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}"
headers = {
'Authorization': 'Token <TOKEN>'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}"
method := "DELETE"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
</Col>
</Row>
---
## List accessible Peers {{ tag: 'GET' , label: '/api/peers/{peerId}/accessible-peers' }}
<Row>
<Col>
Returns a list of peers that the specified peer can connect to within the network.
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/api/peers/{peerId}/accessible-peers">
```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers/{peerId}/accessible-peers \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}/accessible-peers',
headers: {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}/accessible-peers"
headers = {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}/accessible-peers"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}/accessible-peers")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}/accessible-peers")
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}/accessible-peers',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"ip": "10.64.0.1",
"dns_label": "stage-host-1.netbird.cloud",
"user_id": "google-oauth2|277474792786460067937",
"os": "linux",
"country_code": "DE",
"city_name": "Berlin",
"geoname_id": 2643743,
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z"
}
]
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"name": "string",
"ip": "string",
"dns_label": "string",
"user_id": "string",
"os": "string",
"country_code": "string",
"city_name": "string",
"geoname_id": "integer",
"connected": "boolean",
"last_seen": "string"
}
]
```
</CodeGroup>
</Col>
</Row>
---
## Create a Temporary Access Peer {{ tag: 'POST' , label: '/api/peers/{peerId}/temporary-access' }}
<Row>
<Col>
Creates a temporary access peer that can be used to access this peer and this peer only. The temporary access peer and its access policies will be automatically deleted after it disconnects.
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Peer's hostname
</Property>
<Property name="wg_pub_key" type="string" required={true}>
Peer's WireGuard public key
</Property>
<Property name="rules" type="string[]" required={true}>
List of temporary access rules
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/peers/{peerId}/temporary-access">
```bash {{ title: 'cURL' }}
curl -X POST https://api.netbird.io/api/peers/{peerId}/temporary-access \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}/temporary-access',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Token <TOKEN>'
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}/temporary-access"
payload = json.dumps({
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}/temporary-access"
method := "POST"
payload := strings.NewReader(`{
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}/temporary-access")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
})
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}/temporary-access")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}/temporary-access',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name": "temp-host-1",
"wg_pub_key": "n0r3pL4c3h0ld3rK3y==",
"rules": [
"tcp/80"
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"name": "temp-host-1",
"id": "chacbco6lnnbn6cg5s90",
"rules": [
"tcp/80"
]
}
```
```json {{ title: 'Schema' }}
{
"name": "string",
"id": "string",
"rules": [
"string"
]
}
```
</CodeGroup>
</Col>
</Row>
---
## Create Peer Debug Bundle Job {{ tag: 'POST' , label: '/api/peers/{peerId}/jobs' }}
<Row>
<Col>
Triggers a remote debug bundle generation on the specified peer. The peer must be online and connected to receive
the job. Once generated, the bundle is automatically uploaded to the configured storage location.
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
### Request-Body Parameters
<Properties><Property name="workload" type="object" required={true}>
The job workload configuration
</Property>
</Properties>
#### Workload Object
<Properties>
<Property name="type" type="string" required={true}>
Job type. Use "bundle" for debug bundle generation
</Property>
<Property name="parameters" type="object" required={false}>
Job-specific parameters
</Property>
</Properties>
#### Parameters Object (for debug bundle)
<Properties>
<Property name="anonymize" type="boolean" required={false}>
Anonymize IP addresses and non-netbird.io domains in logs and status output (default: false)
</Property>
<Property name="bundle_for" type="boolean" required={false}>
Enable time-based log collection before generating bundle (default: false)
</Property>
<Property name="bundle_for_time" type="number" required={false}>
Duration in minutes for log collection (1-5 minutes). Only used if bundle_for is true
</Property>
<Property name="log_file_count" type="number" required={false}>
Number of log files to include (1-1000, default: 10)
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/peers/{peerId}/jobs">
```bash {{ title: 'cURL' }}
curl -X POST https://api.netbird.io/api/peers/{peerId}/jobs \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}/jobs',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Token <TOKEN>'
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}/jobs"
payload = json.dumps({
"workload": {
"type": "bundle",
"parameters": {
"anonymize": True,
"bundle_for": True,
"bundle_for_time": 2,
"log_file_count": 10
}
}
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}/jobs"
method := "POST"
payload := strings.NewReader(`{
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}/jobs")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
})
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}/jobs")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}/jobs',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacbco6lnnbn6cg5s91",
"peer_id": "chacbco6lnnbn6cg5s90",
"status": "pending",
"created_at": "2026-01-21T10:30:00.000Z",
"updated_at": "2026-01-21T10:30:00.000Z",
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
}
}
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"peer_id": "string",
"status": "string",
"created_at": "string",
"updated_at": "string",
"workload": {
"type": "string",
"parameters": {
"anonymize": "boolean",
"bundle_for": "boolean",
"bundle_for_time": "number",
"log_file_count": "number"
},
"result": {
"upload_key": "string"
}
}
}
```
</CodeGroup>
</Col>
</Row>
---
## List Peer Jobs {{ tag: 'GET' , label: '/api/peers/{peerId}/jobs' }}
<Row>
<Col>
Returns a list of all jobs for the specified peer, including debug bundle generation jobs.
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/api/peers/{peerId}/jobs">
```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers/{peerId}/jobs \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}/jobs',
headers: {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}/jobs"
headers = {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}/jobs"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}/jobs")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}/jobs")
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}/jobs',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "chacbco6lnnbn6cg5s91",
"peer_id": "chacbco6lnnbn6cg5s90",
"status": "succeeded",
"created_at": "2026-01-21T10:30:00.000Z",
"updated_at": "2026-01-21T10:31:15.000Z",
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
},
"result": {
"upload_key": "1234567890ab27fb37c88b3b4be7011e22aa2e5ca6f38ffa9c4481884941f726/12345678-90ab-cdef-1234-567890abcdef"
}
}
},
{
"id": "chacbco6lnnbn6cg5s92",
"peer_id": "chacbco6lnnbn6cg5s90",
"status": "pending",
"created_at": "2026-01-21T11:00:00.000Z",
"updated_at": "2026-01-21T11:00:00.000Z",
"workload": {
"type": "bundle",
"parameters": {
"anonymize": false,
"log_file_count": 10
}
}
}
]
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"peer_id": "string",
"status": "string",
"created_at": "string",
"updated_at": "string",
"workload": {
"type": "string",
"parameters": {
"anonymize": "boolean",
"bundle_for": "boolean",
"bundle_for_time": "number",
"log_file_count": "number"
},
"result": {
"upload_key": "string"
}
}
}
]
```
</CodeGroup>
</Col>
</Row>
---
## Get Peer Job {{ tag: 'GET' , label: '/api/peers/{peerId}/jobs/{jobId}' }}
<Row>
<Col>
Returns details of a specific job for the peer, including the upload key if the debug bundle generation is complete.
### Path Parameters
<Properties>
<Property name="peerId" type="string" required={true}>
The unique identifier of a peer
</Property>
<Property name="jobId" type="string" required={true}>
The unique identifier of a job
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/api/peers/{peerId}/jobs/{jobId}">
```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers/{peerId}/jobs/{jobId} \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: '/api/peers/{peerId}/jobs/{jobId}',
headers: {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/peers/{peerId}/jobs/{jobId}"
headers = {
'Accept': 'application/json',
'Authorization': 'Token <TOKEN>'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/peers/{peerId}/jobs/{jobId}"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/peers/{peerId}/jobs/{jobId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}/jobs/{jobId}")
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/peers/{peerId}/jobs/{jobId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacbco6lnnbn6cg5s91",
"peer_id": "chacbco6lnnbn6cg5s90",
"status": "succeeded",
"created_at": "2026-01-21T10:30:00.000Z",
"updated_at": "2026-01-21T10:31:15.000Z",
"workload": {
"type": "bundle",
"parameters": {
"anonymize": true,
"bundle_for": true,
"bundle_for_time": 2,
"log_file_count": 10
},
"result": {
"upload_key": "1234567890ab27fb37c88b3b4be7011e22aa2e5ca6f38ffa9c4481884941f726/12345678-90ab-cdef-1234-567890abcdef"
}
}
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"peer_id": "string",
"status": "string",
"created_at": "string",
"updated_at": "string",
"workload": {
"type": "string",
"parameters": {
"anonymize": "boolean",
"bundle_for": "boolean",
"bundle_for_time": "number",
"log_file_count": "number"
},
"result": {
"upload_key": "string"
}
}
}
```
</CodeGroup>
</Col>
</Row>
---