mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-15 23:16:36 +00:00
4426 lines
87 KiB
Plaintext
4426 lines
87 KiB
Plaintext
|
|
|
|
|
|
# Users
|
|
|
|
Interact with and view information about users.
|
|
|
|
---
|
|
|
|
|
|
|
|
## Retrieve Users {{ tag: 'GET' , label: '/api/users' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all users
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/users">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/users \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"email": "string",
|
|
"name": "string",
|
|
"role": "string",
|
|
"status": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"is_current": "boolean",
|
|
"is_service_user": "boolean"
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a User {{ tag: 'POST' , label: '/api/users' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a new service user or sends an invite to a regular user
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="email" type="string" required={false}
|
|
|
|
|
|
>
|
|
User's Email to send invite to
|
|
</Property>
|
|
|
|
<Property name="name" type="string" required={false}
|
|
|
|
|
|
>
|
|
User's full name
|
|
</Property>
|
|
|
|
<Property name="role" type="string" required={true}
|
|
|
|
|
|
>
|
|
User's NetBird account role
|
|
</Property>
|
|
|
|
<Property name="auto_groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Groups to auto-assign to peers registered by this user
|
|
</Property>
|
|
|
|
<Property name="is_service_user" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Is true if this user is a service user
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/users">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/users \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"email": "string",
|
|
"name": "string",
|
|
"role": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"is_service_user": "boolean"
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"email": "string",
|
|
"name": "string",
|
|
"role": "string",
|
|
"status": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"is_current": "boolean",
|
|
"is_service_user": "boolean"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a User {{ tag: 'PUT' , label: '/api/users/{userId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update information about a User
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="userId" type="string" required={true}>
|
|
The unique identifier of a user
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="role" type="string" required={true}
|
|
|
|
|
|
>
|
|
User's NetBird account role
|
|
</Property>
|
|
|
|
<Property name="auto_groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Groups to auto-assign to peers registered by this user
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/users/{userId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/users/{userId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"role": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"email": "string",
|
|
"name": "string",
|
|
"role": "string",
|
|
"status": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"is_current": "boolean",
|
|
"is_service_user": "boolean"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a User {{ tag: 'DELETE' , label: '/api/users/{userId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a User
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="userId" type="string" required={true}>
|
|
The unique identifier of a user
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/users/{userId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/users/{userId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## List all Tokens {{ tag: 'GET' , label: '/api/users/{userId}/tokens' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all tokens for a user
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="userId" type="string" required={true}>
|
|
The unique identifier of a user
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/users/{userId}/tokens">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/users/{userId}/tokens \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"expiration_date": "string",
|
|
"created_by": "string",
|
|
"created_at": "string",
|
|
"last_used": "string"
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Token {{ tag: 'POST' , label: '/api/users/{userId}/tokens' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Create a new token for a user
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="userId" type="string" required={true}>
|
|
The unique identifier of a user
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="name" type="string" required={true}
|
|
|
|
|
|
>
|
|
Name of the token
|
|
</Property>
|
|
|
|
<Property name="expires_in" type="integer" required={true}
|
|
|
|
|
|
min={1}
|
|
|
|
|
|
max={365}
|
|
>
|
|
Expiration in days
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/users/{userId}/tokens">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/users/{userId}/tokens \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"expires_in": "integer"
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"plain_token": "string",
|
|
"personal_access_token": {
|
|
"id": "string",
|
|
"name": "string",
|
|
"expiration_date": "string",
|
|
"created_by": "string",
|
|
"created_at": "string",
|
|
"last_used": "string"
|
|
}
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Token {{ tag: 'GET' , label: '/api/users/{userId}/tokens/{tokenId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a specific token for a user
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="userId" type="string" required={true}>
|
|
The unique identifier of a user
|
|
</Property>
|
|
|
|
<Property name="tokenId" type="string" required={true}>
|
|
The unique identifier of a token
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/users/{userId}/tokens/{tokenId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"expiration_date": "string",
|
|
"created_by": "string",
|
|
"created_at": "string",
|
|
"last_used": "string"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a Token {{ tag: 'DELETE' , label: '/api/users/{userId}/tokens/{tokenId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a token for a user
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="userId" type="string" required={true}>
|
|
The unique identifier of a user
|
|
</Property>
|
|
|
|
<Property name="tokenId" type="string" required={true}>
|
|
The unique identifier of a token
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/users/{userId}/tokens/{tokenId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Peers
|
|
|
|
Interact with and view information about peers.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Peers {{ tag: 'GET' , label: '/api/peers' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all peers
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/peers">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/peers \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"ip": "string",
|
|
"connected": "boolean",
|
|
"last_seen": "string",
|
|
"os": "string",
|
|
"version": "string",
|
|
"groups": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"ssh_enabled": "boolean",
|
|
"user_id": "string",
|
|
"hostname": "string",
|
|
"ui_version": "string",
|
|
"dns_label": "string",
|
|
"login_expiration_enabled": "boolean",
|
|
"login_expired": "boolean",
|
|
"last_login": "string"
|
|
}
|
|
]
|
|
```
|
|
</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 "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"ip": "string",
|
|
"connected": "boolean",
|
|
"last_seen": "string",
|
|
"os": "string",
|
|
"version": "string",
|
|
"groups": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"ssh_enabled": "boolean",
|
|
"user_id": "string",
|
|
"hostname": "string",
|
|
"ui_version": "string",
|
|
"dns_label": "string",
|
|
"login_expiration_enabled": "boolean",
|
|
"login_expired": "boolean",
|
|
"last_login": "string"
|
|
}
|
|
```
|
|
</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>
|
|
</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 "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"ssh_enabled": "boolean",
|
|
"login_expiration_enabled": "boolean"
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"ip": "string",
|
|
"connected": "boolean",
|
|
"last_seen": "string",
|
|
"os": "string",
|
|
"version": "string",
|
|
"groups": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"ssh_enabled": "boolean",
|
|
"user_id": "string",
|
|
"hostname": "string",
|
|
"ui_version": "string",
|
|
"dns_label": "string",
|
|
"login_expiration_enabled": "boolean",
|
|
"login_expired": "boolean",
|
|
"last_login": "string"
|
|
}
|
|
```
|
|
</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: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Setup Keys
|
|
|
|
Interact with and view information about setup keys.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Setup Keys {{ tag: 'GET' , label: '/api/setup-keys' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all Setup Keys
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/setup-keys">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/setup-keys \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"key": "string",
|
|
"name": "string",
|
|
"expires": "string",
|
|
"type": "string",
|
|
"valid": "boolean",
|
|
"revoked": "boolean",
|
|
"used_times": "integer",
|
|
"last_used": "string",
|
|
"state": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"updated_at": "string",
|
|
"usage_limit": "integer"
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Setup Key {{ tag: 'POST' , label: '/api/setup-keys' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a Setup Key
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="name" type="string" required={true}
|
|
|
|
|
|
>
|
|
Setup Key name
|
|
</Property>
|
|
|
|
<Property name="type" type="string" required={true}
|
|
|
|
enumList="type1,type2"
|
|
|
|
|
|
>
|
|
Setup key type, one-off for single time usage and reusable
|
|
</Property>
|
|
|
|
<Property name="expires_in" type="integer" required={true}
|
|
|
|
|
|
>
|
|
Expiration time in seconds
|
|
</Property>
|
|
|
|
<Property name="revoked" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Setup key revocation status
|
|
</Property>
|
|
|
|
<Property name="auto_groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Setup key groups to auto-assign to peers registered with this key
|
|
</Property>
|
|
|
|
<Property name="usage_limit" type="integer" required={true}
|
|
|
|
|
|
>
|
|
A number of times this key can be used. The value of 0 indicates the unlimited usage.
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/setup-keys">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/setup-keys \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"type": "string",
|
|
"expires_in": "integer",
|
|
"revoked": "boolean",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"usage_limit": "integer"
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"key": "string",
|
|
"name": "string",
|
|
"expires": "string",
|
|
"type": "string",
|
|
"valid": "boolean",
|
|
"revoked": "boolean",
|
|
"used_times": "integer",
|
|
"last_used": "string",
|
|
"state": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"updated_at": "string",
|
|
"usage_limit": "integer"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Setup Key {{ tag: 'GET' , label: '/api/setup-keys/{keyId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Get information about a Setup Key
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="keyId" type="string" required={true}>
|
|
The unique identifier of a setup key
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/setup-keys/{keyId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/setup-keys/{keyId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"key": "string",
|
|
"name": "string",
|
|
"expires": "string",
|
|
"type": "string",
|
|
"valid": "boolean",
|
|
"revoked": "boolean",
|
|
"used_times": "integer",
|
|
"last_used": "string",
|
|
"state": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"updated_at": "string",
|
|
"usage_limit": "integer"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a Setup Key {{ tag: 'PUT' , label: '/api/setup-keys/{keyId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update information about a Setup Key
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="keyId" type="string" required={true}>
|
|
The unique identifier of a setup key
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="name" type="string" required={true}
|
|
|
|
|
|
>
|
|
Setup Key name
|
|
</Property>
|
|
|
|
<Property name="type" type="string" required={true}
|
|
|
|
enumList="type1,type2"
|
|
|
|
|
|
>
|
|
Setup key type, one-off for single time usage and reusable
|
|
</Property>
|
|
|
|
<Property name="expires_in" type="integer" required={true}
|
|
|
|
|
|
>
|
|
Expiration time in seconds
|
|
</Property>
|
|
|
|
<Property name="revoked" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Setup key revocation status
|
|
</Property>
|
|
|
|
<Property name="auto_groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Setup key groups to auto-assign to peers registered with this key
|
|
</Property>
|
|
|
|
<Property name="usage_limit" type="integer" required={true}
|
|
|
|
|
|
>
|
|
A number of times this key can be used. The value of 0 indicates the unlimited usage.
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/setup-keys/{keyId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"type": "string",
|
|
"expires_in": "integer",
|
|
"revoked": "boolean",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"usage_limit": "integer"
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"key": "string",
|
|
"name": "string",
|
|
"expires": "string",
|
|
"type": "string",
|
|
"valid": "boolean",
|
|
"revoked": "boolean",
|
|
"used_times": "integer",
|
|
"last_used": "string",
|
|
"state": "string",
|
|
"auto_groups": [
|
|
"string"
|
|
],
|
|
"updated_at": "string",
|
|
"usage_limit": "integer"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Groups
|
|
|
|
Interact with and view information about groups.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Groups {{ tag: 'GET' , label: '/api/groups' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all Groups
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/groups">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/groups \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer",
|
|
"peers": [
|
|
{
|
|
"id": "string",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Group {{ tag: 'POST' , label: '/api/groups' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a Group
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="name" type="string" required={true}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
|
|
<Property name="peers" type="string[]" required={false}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/groups">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/groups \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"peers": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer",
|
|
"peers": [
|
|
{
|
|
"id": "string",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Group {{ tag: 'GET' , label: '/api/groups/{groupId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Get information about a Group
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="groupId" type="string" required={true}>
|
|
The unique identifier of a group
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/groups/{groupId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/groups/{groupId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer",
|
|
"peers": [
|
|
{
|
|
"id": "string",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a Group {{ tag: 'PUT' , label: '/api/groups/{groupId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update/Replace a Group
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="groupId" type="string" required={true}>
|
|
The unique identifier of a group
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="Name" type="string" required={}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
|
|
<Property name="Peers" type="string[]" required={}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/groups/{groupId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/groups/{groupId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"Name": "string",
|
|
"Peers": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer",
|
|
"peers": [
|
|
{
|
|
"id": "string",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a Group {{ tag: 'DELETE' , label: '/api/groups/{groupId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a Group
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="groupId" type="string" required={true}>
|
|
The unique identifier of a group
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/groups/{groupId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/groups/{groupId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Rules
|
|
|
|
Interact with and view information about rules.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Rules {{ tag: 'GET' , label: '/api/rules' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all Rules
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/rules">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/rules \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"disabled": "boolean",
|
|
"flow": "string",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Rule {{ tag: 'POST' , label: '/api/rules' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a Rule
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="sources" type="string[]" required={}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
|
|
<Property name="destinations" type="string[]" required={}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/rules">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/rules \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"description": "string",
|
|
"disabled": "boolean",
|
|
"flow": "string",
|
|
"sources": [
|
|
"string"
|
|
],
|
|
"destinations": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"disabled": "boolean",
|
|
"flow": "string",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Rule {{ tag: 'GET' , label: '/api/rules/{ruleId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Get information about a Rules
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="ruleId" type="string" required={true}>
|
|
The unique identifier of a rule
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/rules/{ruleId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/rules/{ruleId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"disabled": "boolean",
|
|
"flow": "string",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a Rule {{ tag: 'PUT' , label: '/api/rules/{ruleId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update/Replace a Rule
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="ruleId" type="string" required={true}>
|
|
The unique identifier of a rule
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="sources" type="string[]" required={}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
|
|
<Property name="destinations" type="string[]" required={}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/rules/{ruleId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"description": "string",
|
|
"disabled": "boolean",
|
|
"flow": "string",
|
|
"sources": [
|
|
"string"
|
|
],
|
|
"destinations": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"disabled": "boolean",
|
|
"flow": "string",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a Rule {{ tag: 'DELETE' , label: '/api/rules/{ruleId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a Rule
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="ruleId" type="string" required={true}>
|
|
The unique identifier of a rule
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/rules/{ruleId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/rules/{ruleId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Policies
|
|
|
|
Interact with and view information about policies.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Policies {{ tag: 'GET' , label: '/api/policies' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all Policies
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/policies">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/policies \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"query": "string",
|
|
"rules": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"action": "string"
|
|
}
|
|
],
|
|
"id": "string"
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Policy {{ tag: 'POST' , label: '/api/policies' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a Policy
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/policies">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/policies \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"query": "string",
|
|
"rules": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"action": "string"
|
|
}
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"query": "string",
|
|
"rules": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"action": "string"
|
|
}
|
|
],
|
|
"id": "string"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Policy {{ tag: 'GET' , label: '/api/policies/{policyId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Get information about a Policies
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="policyId" type="string" required={true}>
|
|
The unique identifier of a policy
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/policies/{policyId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/policies/{policyId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"query": "string",
|
|
"rules": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"action": "string"
|
|
}
|
|
],
|
|
"id": "string"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a Policy {{ tag: 'PUT' , label: '/api/policies/{policyId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update/Replace a Policy
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="policyId" type="string" required={true}>
|
|
The unique identifier of a policy
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/policies/{policyId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/policies/{policyId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"query": "string",
|
|
"rules": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"action": "string"
|
|
}
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"query": "string",
|
|
"rules": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"enabled": "boolean",
|
|
"sources": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"destinations": [
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"peers_count": "integer"
|
|
}
|
|
],
|
|
"action": "string"
|
|
}
|
|
],
|
|
"id": "string"
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a Policy {{ tag: 'DELETE' , label: '/api/policies/{policyId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a Policy
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="policyId" type="string" required={true}>
|
|
The unique identifier of a policy
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/policies/{policyId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/policies/{policyId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Routes
|
|
|
|
Interact with and view information about routes.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Routes {{ tag: 'GET' , label: '/api/routes' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all routes
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/routes">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/routes \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"network_type": "string",
|
|
"description": "string",
|
|
"network_id": "string",
|
|
"enabled": "boolean",
|
|
"peer": "string",
|
|
"network": "string",
|
|
"metric": "integer",
|
|
"masquerade": "boolean",
|
|
"groups": [
|
|
"string"
|
|
]
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Route {{ tag: 'POST' , label: '/api/routes' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a Route
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="description" type="string" required={true}
|
|
|
|
|
|
>
|
|
Route description
|
|
</Property>
|
|
|
|
<Property name="network_id" type="string" required={true}
|
|
|
|
|
|
|
|
minLen={1}
|
|
|
|
maxLen={40}
|
|
>
|
|
Route network identifier, to group HA routes
|
|
</Property>
|
|
|
|
<Property name="enabled" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Route status
|
|
</Property>
|
|
|
|
<Property name="peer" type="string" required={true}
|
|
|
|
|
|
>
|
|
Peer Identifier associated with route
|
|
</Property>
|
|
|
|
<Property name="network" type="string" required={true}
|
|
|
|
|
|
>
|
|
Network range in CIDR format
|
|
</Property>
|
|
|
|
<Property name="metric" type="integer" required={true}
|
|
|
|
|
|
min={1}
|
|
|
|
|
|
max={9999}
|
|
>
|
|
Route metric number. Lowest number has higher priority
|
|
</Property>
|
|
|
|
<Property name="masquerade" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Indicate if peer should masquerade traffic to this route's prefix
|
|
</Property>
|
|
|
|
<Property name="groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Route group tag groups
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/routes">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/routes \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"description": "string",
|
|
"network_id": "string",
|
|
"enabled": "boolean",
|
|
"peer": "string",
|
|
"network": "string",
|
|
"metric": "integer",
|
|
"masquerade": "boolean",
|
|
"groups": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"network_type": "string",
|
|
"description": "string",
|
|
"network_id": "string",
|
|
"enabled": "boolean",
|
|
"peer": "string",
|
|
"network": "string",
|
|
"metric": "integer",
|
|
"masquerade": "boolean",
|
|
"groups": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Route {{ tag: 'GET' , label: '/api/routes/{routeId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Get information about a Routes
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="routeId" type="string" required={true}>
|
|
The unique identifier of a route
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/routes/{routeId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/routes/{routeId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"network_type": "string",
|
|
"description": "string",
|
|
"network_id": "string",
|
|
"enabled": "boolean",
|
|
"peer": "string",
|
|
"network": "string",
|
|
"metric": "integer",
|
|
"masquerade": "boolean",
|
|
"groups": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a Route {{ tag: 'PUT' , label: '/api/routes/{routeId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update/Replace a Route
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="routeId" type="string" required={true}>
|
|
The unique identifier of a route
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="description" type="string" required={true}
|
|
|
|
|
|
>
|
|
Route description
|
|
</Property>
|
|
|
|
<Property name="network_id" type="string" required={true}
|
|
|
|
|
|
|
|
minLen={1}
|
|
|
|
maxLen={40}
|
|
>
|
|
Route network identifier, to group HA routes
|
|
</Property>
|
|
|
|
<Property name="enabled" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Route status
|
|
</Property>
|
|
|
|
<Property name="peer" type="string" required={true}
|
|
|
|
|
|
>
|
|
Peer Identifier associated with route
|
|
</Property>
|
|
|
|
<Property name="network" type="string" required={true}
|
|
|
|
|
|
>
|
|
Network range in CIDR format
|
|
</Property>
|
|
|
|
<Property name="metric" type="integer" required={true}
|
|
|
|
|
|
min={1}
|
|
|
|
|
|
max={9999}
|
|
>
|
|
Route metric number. Lowest number has higher priority
|
|
</Property>
|
|
|
|
<Property name="masquerade" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Indicate if peer should masquerade traffic to this route's prefix
|
|
</Property>
|
|
|
|
<Property name="groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Route group tag groups
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/routes/{routeId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/routes/{routeId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"description": "string",
|
|
"network_id": "string",
|
|
"enabled": "boolean",
|
|
"peer": "string",
|
|
"network": "string",
|
|
"metric": "integer",
|
|
"masquerade": "boolean",
|
|
"groups": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"network_type": "string",
|
|
"description": "string",
|
|
"network_id": "string",
|
|
"enabled": "boolean",
|
|
"peer": "string",
|
|
"network": "string",
|
|
"metric": "integer",
|
|
"masquerade": "boolean",
|
|
"groups": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a Route {{ tag: 'DELETE' , label: '/api/routes/{routeId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a Route
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="routeId" type="string" required={true}>
|
|
The unique identifier of a route
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/routes/{routeId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/routes/{routeId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# DNS
|
|
|
|
Interact with and view information about DNS configuration.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Nameserver Groups {{ tag: 'GET' , label: '/api/dns/nameservers' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all Nameserver Groups
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/dns/nameservers">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/dns/nameservers \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"nameservers": [
|
|
{
|
|
"ip": "string",
|
|
"ns_type": "string",
|
|
"port": "integer"
|
|
}
|
|
],
|
|
"enabled": "boolean",
|
|
"groups": [
|
|
"string"
|
|
],
|
|
"primary": "boolean",
|
|
"domains": [
|
|
"string"
|
|
]
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Create a Nameserver Group {{ tag: 'POST' , label: '/api/dns/nameservers' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Creates a Nameserver Group
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="name" type="string" required={true}
|
|
|
|
|
|
|
|
minLen={1}
|
|
|
|
maxLen={40}
|
|
>
|
|
Nameserver group name
|
|
</Property>
|
|
|
|
<Property name="description" type="string" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group description
|
|
</Property>
|
|
|
|
<Property name="nameservers" type="undefined[]" required={true}
|
|
|
|
|
|
|
|
minLen={1}
|
|
|
|
maxLen={2}
|
|
>
|
|
Nameserver group
|
|
</Property>
|
|
|
|
<Property name="enabled" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group status
|
|
</Property>
|
|
|
|
<Property name="groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group tag groups
|
|
</Property>
|
|
|
|
<Property name="primary" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group primary status
|
|
</Property>
|
|
|
|
<Property name="domains" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group domain list
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="POST" label="/api/dns/nameservers">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X POST https://api.netbird.io/api/dns/nameservers \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"description": "string",
|
|
"nameservers": [
|
|
{
|
|
"ip": "string",
|
|
"ns_type": "string",
|
|
"port": "integer"
|
|
}
|
|
],
|
|
"enabled": "boolean",
|
|
"groups": [
|
|
"string"
|
|
],
|
|
"primary": "boolean",
|
|
"domains": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"nameservers": [
|
|
{
|
|
"ip": "string",
|
|
"ns_type": "string",
|
|
"port": "integer"
|
|
}
|
|
],
|
|
"enabled": "boolean",
|
|
"groups": [
|
|
"string"
|
|
],
|
|
"primary": "boolean",
|
|
"domains": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve a Nameserver Group {{ tag: 'GET' , label: '/api/dns/nameservers/{nsgroupId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Get information about a Nameserver Groups
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="nsgroupId" type="string" required={true}>
|
|
The unique identifier of a Nameserver Group
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/dns/nameservers/{nsgroupId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"nameservers": [
|
|
{
|
|
"ip": "string",
|
|
"ns_type": "string",
|
|
"port": "integer"
|
|
}
|
|
],
|
|
"enabled": "boolean",
|
|
"groups": [
|
|
"string"
|
|
],
|
|
"primary": "boolean",
|
|
"domains": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update a Nameserver Group {{ tag: 'PUT' , label: '/api/dns/nameservers/{nsgroupId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update/Replace a Nameserver Group
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="nsgroupId" type="string" required={true}>
|
|
The unique identifier of a Nameserver Group
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="name" type="string" required={true}
|
|
|
|
|
|
|
|
minLen={1}
|
|
|
|
maxLen={40}
|
|
>
|
|
Nameserver group name
|
|
</Property>
|
|
|
|
<Property name="description" type="string" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group description
|
|
</Property>
|
|
|
|
<Property name="nameservers" type="undefined[]" required={true}
|
|
|
|
|
|
|
|
minLen={1}
|
|
|
|
maxLen={2}
|
|
>
|
|
Nameserver group
|
|
</Property>
|
|
|
|
<Property name="enabled" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group status
|
|
</Property>
|
|
|
|
<Property name="groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group tag groups
|
|
</Property>
|
|
|
|
<Property name="primary" type="boolean" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group primary status
|
|
</Property>
|
|
|
|
<Property name="domains" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Nameserver group domain list
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/dns/nameservers/{nsgroupId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"name": "string",
|
|
"description": "string",
|
|
"nameservers": [
|
|
{
|
|
"ip": "string",
|
|
"ns_type": "string",
|
|
"port": "integer"
|
|
}
|
|
],
|
|
"enabled": "boolean",
|
|
"groups": [
|
|
"string"
|
|
],
|
|
"primary": "boolean",
|
|
"domains": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"nameservers": [
|
|
{
|
|
"ip": "string",
|
|
"ns_type": "string",
|
|
"port": "integer"
|
|
}
|
|
],
|
|
"enabled": "boolean",
|
|
"groups": [
|
|
"string"
|
|
],
|
|
"primary": "boolean",
|
|
"domains": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Delete a Nameserver Group {{ tag: 'DELETE' , label: '/api/dns/nameservers/{nsgroupId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Delete a Nameserver Group
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="nsgroupId" type="string" required={true}>
|
|
The unique identifier of a Nameserver Group
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="DELETE" label="/api/dns/nameservers/{nsgroupId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X DELETE https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Retrieve DNS Settings {{ tag: 'GET' , label: '/api/dns/settings' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a DNS settings object
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/dns/settings">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/dns/settings \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"disabled_management_groups": [
|
|
"string"
|
|
]
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update DNS Settings {{ tag: 'PUT' , label: '/api/dns/settings' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Updates a DNS settings object
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="disabled_management_groups" type="string[]" required={true}
|
|
|
|
|
|
>
|
|
Groups whose DNS management is disabled
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/dns/settings">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/dns/settings \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"disabled_management_groups": [
|
|
"string"
|
|
]
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"disabled_management_groups": [
|
|
"string"
|
|
]
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Events
|
|
|
|
View information about the account and network events.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Events {{ tag: 'GET' , label: '/api/events' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of all events
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/events">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/events \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"timestamp": "string",
|
|
"activity": "string",
|
|
"activity_code": "string",
|
|
"initiator_id": "string",
|
|
"target_id": "string",
|
|
"meta": "object"
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
|
|
# Accounts
|
|
|
|
View information about the accounts.
|
|
|
|
---
|
|
|
|
|
|
|
|
## List all Accounts {{ tag: 'GET' , label: '/api/accounts' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Returns a list of accounts of a user. Always returns a list of one account.
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="GET" label="/api/accounts">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X GET https://api.netbird.io/api/accounts \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
[
|
|
{
|
|
"id": "string",
|
|
"settings": {
|
|
"peer_login_expiration_enabled": "boolean",
|
|
"peer_login_expiration": "integer"
|
|
}
|
|
}
|
|
]
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|
|
|
|
|
|
## Update an Account {{ tag: 'PUT' , label: '/api/accounts/{accountId}' }}
|
|
|
|
<Row>
|
|
<Col>
|
|
Update information about an account
|
|
|
|
#### Path Parameters
|
|
<Properties>
|
|
|
|
<Property name="accountId" type="string" required={true}>
|
|
The unique identifier of an account
|
|
</Property>
|
|
</Properties>
|
|
|
|
#### Request-Body Parameters
|
|
<Properties>
|
|
|
|
<Property name="settings" type="" required={true}
|
|
|
|
|
|
>
|
|
|
|
</Property>
|
|
</Properties>
|
|
</Col>
|
|
|
|
<Col sticky>
|
|
<CodeGroup title="Request" tag="PUT" label="/api/accounts/{accountId}">
|
|
```bash {{ title: 'cURL' }}
|
|
curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
|
|
-H "Authorization: Bearer {token}" \
|
|
-H 'Accept: application/json' \-H 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"settings": {
|
|
"peer_login_expiration_enabled": "boolean",
|
|
"peer_login_expiration": "integer"
|
|
}
|
|
}'
|
|
```
|
|
|
|
```js
|
|
import ApiClient from '@example/protocol-api'
|
|
|
|
const client = new ApiClient(token)
|
|
|
|
await client.contacts.update('WAz8eIbvDR60rouK', {
|
|
display_name: 'UncleFrank',
|
|
})
|
|
```
|
|
|
|
```python
|
|
from protocol_api import ApiClient
|
|
|
|
client = ApiClient(token)
|
|
|
|
client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank")
|
|
```
|
|
|
|
```php
|
|
$client = new \Protocol\ApiClient($token);
|
|
|
|
$client->contacts->update('WAz8eIbvDR60rouK', [
|
|
'display_name' => 'UncleFrank',
|
|
]);
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
<CodeGroup title="Response">
|
|
```json {{ title: '200' }}
|
|
{
|
|
"id": "string",
|
|
"settings": {
|
|
"peer_login_expiration_enabled": "boolean",
|
|
"peer_login_expiration": "integer"
|
|
}
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
</Row>
|
|
|
|
---
|