From 7c8e14988991ab5c1f1f62e7e84d8f3f38e15bb9 Mon Sep 17 00:00:00 2001 From: netbirddev Date: Wed, 1 Jul 2026 20:40:04 +0000 Subject: [PATCH] Update API pages with v0.74.0 --- src/pages/ipa/resources/accounts.mdx | 16 + src/pages/ipa/resources/agent-network.mdx | 455 +++++++++++++++++++++- 2 files changed, 457 insertions(+), 14 deletions(-) diff --git a/src/pages/ipa/resources/accounts.mdx b/src/pages/ipa/resources/accounts.mdx index 5fd2ebe2..9d480ae7 100644 --- a/src/pages/ipa/resources/accounts.mdx +++ b/src/pages/ipa/resources/accounts.mdx @@ -200,6 +200,7 @@ echo $response; "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -254,6 +255,7 @@ echo $response; "lazy_connection_enabled": "boolean", "auto_update_version": "string", "auto_update_always": "boolean", + "metrics_push_enabled": "boolean", "embedded_idp_enabled": "boolean", "local_auth_disabled": "boolean", "local_mfa_enabled": "boolean", @@ -594,6 +596,11 @@ echo $response; When true, updates are installed automatically in the background. When false, updates require user interaction from the UI. + + + + Enables or disables client metrics push for all peers in the account + @@ -692,6 +699,7 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \ "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -745,6 +753,7 @@ let data = JSON.stringify({ "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -820,6 +829,7 @@ payload = json.dumps({ "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -895,6 +905,7 @@ func main() { "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -989,6 +1000,7 @@ request.body = JSON.dump({ "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -1046,6 +1058,7 @@ RequestBody body = RequestBody.create(mediaType, '{ "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -1119,6 +1132,7 @@ curl_setopt_array($curl, array( "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -1187,6 +1201,7 @@ echo $response; "lazy_connection_enabled": true, "auto_update_version": "0.51.2", "auto_update_always": false, + "metrics_push_enabled": false, "embedded_idp_enabled": false, "local_auth_disabled": false, "local_mfa_enabled": false, @@ -1239,6 +1254,7 @@ echo $response; "lazy_connection_enabled": "boolean", "auto_update_version": "string", "auto_update_always": "boolean", + "metrics_push_enabled": "boolean", "embedded_idp_enabled": "boolean", "local_auth_disabled": "boolean", "local_mfa_enabled": "boolean", diff --git a/src/pages/ipa/resources/agent-network.mdx b/src/pages/ipa/resources/agent-network.mdx index ddcd4566..571079b0 100644 --- a/src/pages/ipa/resources/agent-network.mdx +++ b/src/pages/ipa/resources/agent-network.mdx @@ -342,6 +342,401 @@ echo $response; --- +## List Agent Network access logs grouped by session {{ tag: 'GET' , label: '/api/agent-network/access-log-sessions' }} + + + + Returns a paginated, server-side-filtered list of agent-network (LLM) access logs grouped by session. The page unit is a session (total_records counts sessions); each session carries an aggregate summary and its ordered entries. Requests the client sent no session id for each form their own singleton group. Accepts the same filters as the flat access-logs endpoint. Available only when the account has log collection enabled. + + ### Query Parameters + + + + Page number for pagination (1-indexed). + + + + Number of sessions per page (max 100). + + + + Session-level field to sort by. "timestamp" is the session's last activity, "started_at" its first. + + + + Sort order (ascending or descending). + + + + General search across log ID, host, path, model, and user email/name. + + + + Filter by authenticated user ID. + + + + Filter to a single conversation / coding session id. + + + + Filter by authorising group id. Repeat for multiple (matches any). + + + + Filter by resolved provider id. Repeat for multiple (matches any). + + + + Filter by model. Repeat for multiple (matches any). + + + + Filter by policy decision (e.g. allow, deny). + + + + Filter by request path prefix (matches entries whose path starts with this value). + + + + Filter by timestamp {'>='} start_date (RFC3339 format). + + + + Filter by timestamp {'<='} end_date (RFC3339 format). + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/agent-network/access-log-sessions \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/agent-network/access-log-sessions', + headers: { + 'Accept': 'application/json', + 'Authorization': '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/agent-network/access-log-sessions" + +headers = { + 'Accept': 'application/json', + 'Authorization': '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/agent-network/access-log-sessions" + 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 ") + + 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/agent-network/access-log-sessions") + +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 " + +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/agent-network/access-log-sessions") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/agent-network/access-log-sessions', + 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 ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "data": [ + { + "session_id": "019eeb72-ab7c-7cd2-aa05-6e8eb834afcb", + "user_id": { + "type": "string", + "description": "NetBird user id of the session's caller." + }, + "group_ids": [ + { + "type": "string" + } + ], + "started_at": "2026-05-05T12:30:00Z", + "ended_at": "2026-05-05T12:34:56Z", + "request_count": 7, + "input_tokens": 8400, + "output_tokens": 4480, + "total_tokens": 12880, + "cost_usd": 0.1617, + "providers": [ + { + "type": "string" + } + ], + "models": [ + { + "type": "string" + } + ], + "decision": "allow", + "entries": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "service_id": { + "type": "string", + "description": "ID of the synthesised agent-network service that handled the request." + }, + "timestamp": "2026-05-05T12:34:56Z", + "status_code": 200, + "duration_ms": 850, + "user_id": { + "type": "string", + "description": "NetBird user id of the authenticated caller, if applicable." + }, + "source_ip": { + "type": "string", + "description": "Source IP of the request. Empty when log collection is disabled." + }, + "method": "POST", + "host": { + "type": "string", + "description": "Upstream host the request was routed to. Empty when log collection is disabled." + }, + "path": { + "type": "string", + "description": "Request path. Empty when log collection is disabled." + }, + "provider": "openai", + "model": "gpt-4o", + "session_id": "019eeb72-ab7c-7cd2-aa05-6e8eb834afcb", + "resolved_provider_id": { + "type": "string", + "description": "NetBird agent-network provider id that served the request." + }, + "selected_policy_id": { + "type": "string", + "description": "Agent-network policy id that authorised (or denied) the request." + }, + "decision": "allow", + "deny_reason": { + "type": "string", + "description": "Raw deny reason code when the request was blocked (e.g. llm_policy.token_cap_exceeded)." + }, + "input_tokens": 1200, + "output_tokens": 640, + "total_tokens": 1840, + "cost_usd": 0.0231, + "stream": { + "type": "boolean", + "description": "Whether the request was a streaming completion." + }, + "group_ids": [ + { + "type": "string" + } + ], + "request_prompt": { + "type": "string", + "description": "Captured request prompt. Present only when prompt collection is enabled." + }, + "response_completion": { + "type": "string", + "description": "Captured response completion. Present only when prompt collection is enabled." + } + } + ] + } + ], + "page": 1, + "page_size": 50, + "total_records": 124, + "total_pages": 3 +} +``` +```json {{ title: 'Schema' }} +{ + "data": [ + { + "session_id": "string", + "user_id": "string", + "group_ids": [ + "string" + ], + "started_at": "string", + "ended_at": "string", + "request_count": "integer", + "input_tokens": "integer", + "output_tokens": "integer", + "total_tokens": "integer", + "cost_usd": "number", + "providers": [ + "string" + ], + "models": [ + "string" + ], + "decision": "string", + "entries": [ + { + "id": "string", + "service_id": "string", + "timestamp": "string", + "status_code": "integer", + "duration_ms": "integer", + "user_id": "string", + "source_ip": "string", + "method": "string", + "host": "string", + "path": "string", + "provider": "string", + "model": "string", + "session_id": "string", + "resolved_provider_id": "string", + "selected_policy_id": "string", + "decision": "string", + "deny_reason": "string", + "input_tokens": "integer", + "output_tokens": "integer", + "total_tokens": "integer", + "cost_usd": "number", + "stream": "boolean", + "group_ids": [ + "string" + ], + "request_prompt": "string", + "response_completion": "string" + } + ] + } + ], + "page": "integer", + "page_size": "integer", + "total_records": "integer", + "total_pages": "integer" +} +``` + + + + + + +--- + + ## Agent Network usage overview {{ tag: 'GET' , label: '/api/agent-network/usage/overview' }} @@ -3277,6 +3672,7 @@ echo $response; "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", "enabled": true, + "skip_tls_verification": false, "created_at": "2026-04-26T10:30:00Z", "updated_at": "2026-04-26T10:30:00Z" } @@ -3307,6 +3703,7 @@ echo $response; "identity_header_user_id": "string", "identity_header_groups": "string", "enabled": "boolean", + "skip_tls_verification": "boolean", "created_at": "string", "updated_at": "string" } @@ -3403,6 +3800,11 @@ echo $response; Whether the provider is enabled. Defaults to true on create. + + + + Skip upstream TLS certificate verification when the proxy dials this provider's URL. For self-hosted / internal gateways behind a private or self-signed certificate. Defaults to false. When omitted on update, the stored value is left unchanged. + @@ -3434,7 +3836,8 @@ curl -X POST https://api.netbird.io/api/agent-network/providers \ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }' ``` @@ -3458,7 +3861,8 @@ let data = JSON.stringify({ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }); let config = { method: 'post', @@ -3504,7 +3908,8 @@ payload = json.dumps({ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }) headers = { 'Content-Type': 'application/json', @@ -3550,7 +3955,8 @@ func main() { }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }`) client := &http.Client { } @@ -3615,7 +4021,8 @@ request.body = JSON.dump({ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }) response = https.request(request) puts response.read_body @@ -3643,7 +4050,8 @@ RequestBody body = RequestBody.create(mediaType, '{ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }'); Request request = new Request.Builder() .url("https://api.netbird.io/api/agent-network/providers") @@ -3687,7 +4095,8 @@ curl_setopt_array($curl, array( }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', @@ -3725,6 +4134,7 @@ echo $response; "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", "enabled": true, + "skip_tls_verification": false, "created_at": "2026-04-26T10:30:00Z", "updated_at": "2026-04-26T10:30:00Z" } @@ -3753,6 +4163,7 @@ echo $response; "identity_header_user_id": "string", "identity_header_groups": "string", "enabled": "boolean", + "skip_tls_verification": "boolean", "created_at": "string", "updated_at": "string" } @@ -3951,6 +4362,7 @@ echo $response; "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", "enabled": true, + "skip_tls_verification": false, "created_at": "2026-04-26T10:30:00Z", "updated_at": "2026-04-26T10:30:00Z" } @@ -3979,6 +4391,7 @@ echo $response; "identity_header_user_id": "string", "identity_header_groups": "string", "enabled": "boolean", + "skip_tls_verification": "boolean", "created_at": "string", "updated_at": "string" } @@ -4082,6 +4495,11 @@ echo $response; Whether the provider is enabled. Defaults to true on create. + + + + Skip upstream TLS certificate verification when the proxy dials this provider's URL. For self-hosted / internal gateways behind a private or self-signed certificate. Defaults to false. When omitted on update, the stored value is left unchanged. + @@ -4113,7 +4531,8 @@ curl -X PUT https://api.netbird.io/api/agent-network/providers/{providerId} \ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }' ``` @@ -4137,7 +4556,8 @@ let data = JSON.stringify({ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }); let config = { method: 'put', @@ -4183,7 +4603,8 @@ payload = json.dumps({ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }) headers = { 'Content-Type': 'application/json', @@ -4229,7 +4650,8 @@ func main() { }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }`) client := &http.Client { } @@ -4294,7 +4716,8 @@ request.body = JSON.dump({ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }) response = https.request(request) puts response.read_body @@ -4322,7 +4745,8 @@ RequestBody body = RequestBody.create(mediaType, '{ }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }'); Request request = new Request.Builder() .url("https://api.netbird.io/api/agent-network/providers/{providerId}") @@ -4366,7 +4790,8 @@ curl_setopt_array($curl, array( }, "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true + "enabled": true, + "skip_tls_verification": false }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', @@ -4404,6 +4829,7 @@ echo $response; "identity_header_user_id": "x-bf-dim-netbird_user_id", "identity_header_groups": "x-bf-dim-netbird_groups", "enabled": true, + "skip_tls_verification": false, "created_at": "2026-04-26T10:30:00Z", "updated_at": "2026-04-26T10:30:00Z" } @@ -4432,6 +4858,7 @@ echo $response; "identity_header_user_id": "string", "identity_header_groups": "string", "enabled": "boolean", + "skip_tls_verification": "boolean", "created_at": "string", "updated_at": "string" }