From b35de5b4775daebd1c03db9736a3dc15be759c88 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Thu, 26 Feb 2026 16:28:00 +0100 Subject: [PATCH] =?UTF-8?q?Escape=20MDX-specific=20characters=20in=20API?= =?UTF-8?q?=20templates=20and=20refine=20Navigation=E2=80=A6=20(#638)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Escape MDX-specific characters in API templates and refine NavigationAPI links * Update API pages with v0.66.0 --------- Co-authored-by: netbirddev --- generator/api.ts | 22 +- generator/templates/ApiTemplate.ts | 11 +- src/components/NavigationAPI.jsx | 24 +- src/pages/ipa/resources/accounts.mdx | 96 +- src/pages/ipa/resources/dns-zones.mdx | 22 +- src/pages/ipa/resources/dns.mdx | 6 +- .../ipa/resources/edr-falcon-integrations.mdx | 1330 +++++ .../resources/edr-huntress-integrations.mdx | 1511 ++++++ .../ipa/resources/edr-intune-integrations.mdx | 1404 ++++++ src/pages/ipa/resources/edr-peers.mdx | 517 ++ .../edr-sentinelone-integrations.mdx | 2085 ++++++++ .../event-streaming-integrations.mdx | 1188 +++++ src/pages/ipa/resources/events.mdx | 286 ++ src/pages/ipa/resources/geo-locations.mdx | 2 +- src/pages/ipa/resources/groups.mdx | 6 +- .../ipa/resources/identity-providers.mdx | 6 +- src/pages/ipa/resources/idp.mdx | 1591 ++++++ src/pages/ipa/resources/ingress-ports.mdx | 22 +- src/pages/ipa/resources/instance.mdx | 182 + src/pages/ipa/resources/invoice.mdx | 543 ++ src/pages/ipa/resources/jobs.mdx | 8 +- src/pages/ipa/resources/msp.mdx | 1873 +++++++ src/pages/ipa/resources/networks.mdx | 38 +- src/pages/ipa/resources/peers.mdx | 10 +- src/pages/ipa/resources/policies.mdx | 6 +- src/pages/ipa/resources/posture-checks.mdx | 6 +- src/pages/ipa/resources/routes.mdx | 6 +- src/pages/ipa/resources/services.mdx | 4399 +++++++++++++++++ src/pages/ipa/resources/setup-keys.mdx | 6 +- src/pages/ipa/resources/tokens.mdx | 12 +- src/pages/ipa/resources/usage.mdx | 184 + src/pages/ipa/resources/users.mdx | 1310 ++++- 32 files changed, 18602 insertions(+), 110 deletions(-) create mode 100644 src/pages/ipa/resources/edr-falcon-integrations.mdx create mode 100644 src/pages/ipa/resources/edr-huntress-integrations.mdx create mode 100644 src/pages/ipa/resources/edr-intune-integrations.mdx create mode 100644 src/pages/ipa/resources/edr-peers.mdx create mode 100644 src/pages/ipa/resources/edr-sentinelone-integrations.mdx create mode 100644 src/pages/ipa/resources/event-streaming-integrations.mdx create mode 100644 src/pages/ipa/resources/idp.mdx create mode 100644 src/pages/ipa/resources/invoice.mdx create mode 100644 src/pages/ipa/resources/msp.mdx create mode 100644 src/pages/ipa/resources/services.mdx create mode 100644 src/pages/ipa/resources/usage.mdx diff --git a/generator/api.ts b/generator/api.ts index a559ca35..5f862834 100644 --- a/generator/api.ts +++ b/generator/api.ts @@ -7,6 +7,15 @@ import * as yaml from 'js-yaml'; import { merge } from 'allof-merge' import RequestBodyObject = OpenAPIV3_1.RequestBodyObject; +function escapeMdx(text: string): string { + if (!text) return text; + return text + .replace(/<=/g, "{'<='}") + .replace(/>=/g, "{'>='}") + .replace(/^- /gm, '\\- ') + .replace(/\n- /g, '\n\\- '); +} + // Pre-processes the spec to fix allOf with conflicting enums by merging them function fixConflictingEnumAllOf(obj: any): any { if (obj === null || typeof obj !== 'object') { @@ -123,7 +132,10 @@ async function gen_v3(spec: OpenAPIV3.Document, dest: string) { Object.entries(spec.paths).forEach(([key, val]) => { const fullPath = `${server}${key}` - toArrayWithKey(val!, 'operation').forEach((o) => { + const httpMethods = ['get', 'post', 'put', 'delete', 'patch', 'options', 'head', 'trace'] + toArrayWithKey(val!, 'operation') + .filter((o) => httpMethods.includes(o.operation)) + .forEach((o) => { const operation = o as v3OperationWithPath var request = null @@ -135,7 +147,7 @@ async function gen_v3(spec: OpenAPIV3.Document, dest: string) { } var response = null - if(operation.responses["200"] != undefined && operation.responses["200"]["content"] != undefined && operation.responses["200"]["content"]["application/json"] != undefined) { + if(operation.responses && operation.responses["200"] != undefined && operation.responses["200"]["content"] != undefined && operation.responses["200"]["content"]["application/json"] != undefined) { response = { example: extractInfo(operation.responses["200"]["content"]["application/json"].schema, 'example'), schema: extractInfo(operation.responses["200"]["content"]["application/json"].schema, 'type') @@ -158,7 +170,10 @@ async function gen_v3(spec: OpenAPIV3.Document, dest: string) { }) }) + const excludedTags = ['Checkout', 'AWS Marketplace', 'Plans', 'Subscription', 'Portal'] + tagGroups.forEach((value: enrichedOperation[], key: string) => { + if (excludedTags.includes(key)) return const operations = value @@ -176,11 +191,12 @@ async function gen_v3(spec: OpenAPIV3.Document, dest: string) { tag: key, sections, operations, + escapeMdx, // components, }) // Write to disk - let outputFile = dest + "/" + key.toLowerCase().replace(" ", "-") + ".mdx" + let outputFile = dest + "/" + key.toLowerCase().replace(/ /g, "-") + ".mdx" writeToDisk(outputFile, content) // console.log('Saved: ', outputFile) diff --git a/generator/templates/ApiTemplate.ts b/generator/templates/ApiTemplate.ts index 8ae87c20..e16477af 100644 --- a/generator/templates/ApiTemplate.ts +++ b/generator/templates/ApiTemplate.ts @@ -1,5 +1,4 @@ const template = ` - export const title = '<%- tag %>' <% operations.forEach(function(operation){ %> @@ -8,14 +7,14 @@ export const title = '<%- tag %>' - <%- operation.description %> + <%- escapeMdx(operation.description) %> <% if(operation.parameters && operation.parameters.filter((parameter) => parameter.in === 'path').length > 0){ %> ### Path Parameters <% operation.parameters.filter((parameter) => parameter.in === 'path').forEach(function(parameter){ %> - <%- parameter.description %> - + <%- escapeMdx(parameter.description) %> + <% }); -%> <% }; -%> @@ -24,7 +23,7 @@ export const title = '<%- tag %>' <% operation.parameters.filter((parameter) => parameter.in === 'query').forEach(function(parameter){ %> - <%- parameter.description %> + <%- escapeMdx(parameter.description) %> <% }); -%> @@ -76,7 +75,7 @@ function renderProperties(properties, required = [], depth = 0) { <% } else { %> - <% if(value.description) { %><%- value.description %><% } %> + <% if(value.description) { %><%- escapeMdx(value.description) %><% } %> <% } %> <% }); diff --git a/src/components/NavigationAPI.jsx b/src/components/NavigationAPI.jsx index 81f47709..9bd200a5 100644 --- a/src/components/NavigationAPI.jsx +++ b/src/components/NavigationAPI.jsx @@ -15,7 +15,6 @@ export const apiNavigation = [ { title: 'Quickstart', href: '/api/guides/quickstart' }, { title: 'Authentication', href: '/api/guides/authentication' }, { title: 'Errors', href: '/api/guides/errors' }, - // { title: 'Events', href: '/accounts' }, ], }, { @@ -25,22 +24,39 @@ export const apiNavigation = [ { title: 'Users', href: '/api/resources/users' }, { title: 'Tokens', href: '/api/resources/tokens' }, { title: 'Peers', href: '/api/resources/peers' }, - { title: 'Ingress Ports', href: '/api/resources/ingress-ports' }, { title: 'Setup Keys', href: '/api/resources/setup-keys' }, { title: 'Groups', href: '/api/resources/groups' }, { title: 'Policies', href: '/api/resources/policies' }, - { title: 'Posture-Checks', href: '/api/resources/posture-checks' }, - { title: 'Geo-Locations', href: '/api/resources/geo-locations' }, + { title: 'Posture Checks', href: '/api/resources/posture-checks' }, + { title: 'Geo Locations', href: '/api/resources/geo-locations' }, { title: 'Routes (deprecated)', href: '/api/resources/routes' }, { title: 'Networks', href: '/api/resources/networks' }, { title: 'DNS', href: '/api/resources/dns' }, { title: 'DNS Zones', href: '/api/resources/dns-zones' }, + { title: 'Services', href: '/api/resources/services' }, { title: 'Events', href: '/api/resources/events' }, + { title: 'Event Streaming', href: '/api/resources/event-streaming-integrations' }, { title: 'Jobs', href: '/api/resources/jobs' }, { title: 'Identity Providers', href: '/api/resources/identity-providers' }, { title: 'Instance', href: '/api/resources/instance' }, ], }, + { + title: 'Cloud Resources', + links: [ + { title: 'Ingress Ports', href: '/api/resources/ingress-ports' }, + { title: 'IDP (SCIM)', href: '/api/resources/idp' }, + { title: 'Event Streaming', href: '/api/resources/event-streaming-integrations' }, + { title: 'EDR Peers', href: '/api/resources/edr-peers' }, + { title: 'EDR Falcon', href: '/api/resources/edr-falcon-integrations' }, + { title: 'EDR Huntress', href: '/api/resources/edr-huntress-integrations' }, + { title: 'EDR Intune', href: '/api/resources/edr-intune-integrations' }, + { title: 'EDR SentinelOne', href: '/api/resources/edr-sentinelone-integrations' }, + { title: 'MSP', href: '/api/resources/msp' }, + { title: 'Invoice', href: '/api/resources/invoice' }, + { title: 'Usage', href: '/api/resources/usage' }, + ], + }, ] export function NavigationAPI({tableOfContents, className}) { diff --git a/src/pages/ipa/resources/accounts.mdx b/src/pages/ipa/resources/accounts.mdx index 3356a7e9..68caf5f6 100644 --- a/src/pages/ipa/resources/accounts.mdx +++ b/src/pages/ipa/resources/accounts.mdx @@ -178,6 +178,10 @@ echo $response; "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -189,7 +193,8 @@ echo $response; }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "domain": "netbird.io", "domain_category": "private", @@ -221,6 +226,10 @@ echo $response; "routing_peer_dns_resolution_enabled": "boolean", "dns_domain": "string", "network_range": "string", + "peer_expose_enabled": "boolean", + "peer_expose_groups": [ + "string" + ], "extra": { "peer_approval_enabled": "boolean", "user_approval_required": "boolean", @@ -232,7 +241,8 @@ echo $response; }, "lazy_connection_enabled": "boolean", "auto_update_version": "string", - "embedded_idp_enabled": "boolean" + "embedded_idp_enabled": "boolean", + "local_auth_disabled": "boolean" }, "domain": "string", "domain_category": "string", @@ -265,7 +275,7 @@ echo $response; The unique identifier of an account - + @@ -429,7 +439,7 @@ echo $response; The unique identifier of an account - + ### Request-Body Parameters @@ -499,6 +509,16 @@ echo $response; Allows to define a custom network range for the account in CIDR format + + + + Enables or disables peer expose. If enabled, peers can expose local services through the reverse proxy using the CLI. + + + + + Limits which peer groups are allowed to expose services. If empty, all peers are allowed when peer expose is enabled. + @@ -551,6 +571,11 @@ echo $response; Indicates whether the embedded identity provider (Dex) is enabled for this account. This is a read-only field. + + + + Indicates whether local (email/password) authentication is disabled. When true, users can only authenticate via external identity providers. This is a read-only field. + @@ -608,6 +633,10 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \ "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -619,7 +648,8 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \ }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -646,6 +676,10 @@ let data = JSON.stringify({ "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -657,7 +691,8 @@ let data = JSON.stringify({ }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -706,6 +741,10 @@ payload = json.dumps({ "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -717,7 +756,8 @@ payload = json.dumps({ }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -766,6 +806,10 @@ func main() { "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -777,7 +821,8 @@ func main() { }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -844,6 +889,10 @@ request.body = JSON.dump({ "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -855,7 +904,8 @@ request.body = JSON.dump({ }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -886,6 +936,10 @@ RequestBody body = RequestBody.create(mediaType, '{ "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -897,7 +951,8 @@ RequestBody body = RequestBody.create(mediaType, '{ }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -944,6 +999,10 @@ curl_setopt_array($curl, array( "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -955,7 +1014,8 @@ curl_setopt_array($curl, array( }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "onboarding": { "signup_form_pending": true, @@ -997,6 +1057,10 @@ echo $response; "routing_peer_dns_resolution_enabled": true, "dns_domain": "my-organization.org", "network_range": "100.64.0.0/16", + "peer_expose_enabled": false, + "peer_expose_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], "extra": { "peer_approval_enabled": true, "user_approval_required": false, @@ -1008,7 +1072,8 @@ echo $response; }, "lazy_connection_enabled": true, "auto_update_version": "0.51.2", - "embedded_idp_enabled": false + "embedded_idp_enabled": false, + "local_auth_disabled": false }, "domain": "netbird.io", "domain_category": "private", @@ -1038,6 +1103,10 @@ echo $response; "routing_peer_dns_resolution_enabled": "boolean", "dns_domain": "string", "network_range": "string", + "peer_expose_enabled": "boolean", + "peer_expose_groups": [ + "string" + ], "extra": { "peer_approval_enabled": "boolean", "user_approval_required": "boolean", @@ -1049,7 +1118,8 @@ echo $response; }, "lazy_connection_enabled": "boolean", "auto_update_version": "string", - "embedded_idp_enabled": "boolean" + "embedded_idp_enabled": "boolean", + "local_auth_disabled": "boolean" }, "domain": "string", "domain_category": "string", diff --git a/src/pages/ipa/resources/dns-zones.mdx b/src/pages/ipa/resources/dns-zones.mdx index 64ba8555..7439d9f8 100644 --- a/src/pages/ipa/resources/dns-zones.mdx +++ b/src/pages/ipa/resources/dns-zones.mdx @@ -569,7 +569,7 @@ echo $response; The unique identifier of a zone - + @@ -789,7 +789,7 @@ echo $response; The unique identifier of a zone - + ### Request-Body Parameters @@ -1137,7 +1137,7 @@ echo $response; The unique identifier of a zone - + @@ -1301,7 +1301,7 @@ echo $response; The unique identifier of a zone - + @@ -1497,7 +1497,7 @@ echo $response; The unique identifier of a zone - + ### Request-Body Parameters @@ -1763,11 +1763,11 @@ echo $response; The unique identifier of a zone - + The unique identifier of a DNS record - + @@ -1959,11 +1959,11 @@ echo $response; The unique identifier of a zone - + The unique identifier of a DNS record - + ### Request-Body Parameters @@ -2229,11 +2229,11 @@ echo $response; The unique identifier of a zone - + The unique identifier of a DNS record - + diff --git a/src/pages/ipa/resources/dns.mdx b/src/pages/ipa/resources/dns.mdx index 7a520dc6..b1c7f42e 100644 --- a/src/pages/ipa/resources/dns.mdx +++ b/src/pages/ipa/resources/dns.mdx @@ -655,7 +655,7 @@ echo $response; The unique identifier of a Nameserver Group - + @@ -875,7 +875,7 @@ echo $response; The unique identifier of a Nameserver Group - + ### Request-Body Parameters @@ -1309,7 +1309,7 @@ echo $response; The unique identifier of a Nameserver Group - + diff --git a/src/pages/ipa/resources/edr-falcon-integrations.mdx b/src/pages/ipa/resources/edr-falcon-integrations.mdx new file mode 100644 index 00000000..1c4bf224 --- /dev/null +++ b/src/pages/ipa/resources/edr-falcon-integrations.mdx @@ -0,0 +1,1330 @@ +export const title = 'EDR Falcon Integrations' + + + +## Create EDR Falcon Integration {{ tag: 'POST' , label: '/api/integrations/edr/falcon' }} + + + + Creates a new EDR Falcon integration + + ### Request-Body Parameters + + + + CrowdStrike API client ID + + + + + CrowdStrike API client secret + + + + + CrowdStrike cloud identifier (e.g., "us-1", "us-2", "eu-1") + + + + + The Groups this integration applies to + + + + + The minimum Zero Trust Assessment score required for agent approval (0-100) + + + + + Indicates whether the integration is enabled + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/edr/falcon \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/edr/falcon', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/falcon" +payload = json.dumps({ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/falcon" + method := "POST" + + payload := strings.NewReader(`{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/falcon") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/falcon") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/falcon', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier" + }, + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "zta_score_threshold": { + "type": "integer", + "description": "The minimum Zero Trust Assessment score required for agent approval (0-100)" + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "cloud_id": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "zta_score_threshold": "integer", + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Get EDR Falcon Integration {{ tag: 'GET' , label: '/api/integrations/edr/falcon' }} + + + + Retrieves a specific EDR Falcon integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/edr/falcon \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/edr/falcon', + 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/integrations/edr/falcon" + +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/integrations/edr/falcon" + 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/integrations/edr/falcon") + +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/integrations/edr/falcon") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/falcon', + 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' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier" + }, + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "zta_score_threshold": { + "type": "integer", + "description": "The minimum Zero Trust Assessment score required for agent approval (0-100)" + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "cloud_id": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "zta_score_threshold": "integer", + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Update EDR Falcon Integration {{ tag: 'PUT' , label: '/api/integrations/edr/falcon' }} + + + + Updates an existing EDR Falcon Integration. + + ### Request-Body Parameters + + + + CrowdStrike API client ID + + + + + CrowdStrike API client secret + + + + + CrowdStrike cloud identifier (e.g., "us-1", "us-2", "eu-1") + + + + + The Groups this integration applies to + + + + + The minimum Zero Trust Assessment score required for agent approval (0-100) + + + + + Indicates whether the integration is enabled + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/edr/falcon \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/edr/falcon', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/falcon" +payload = json.dumps({ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/falcon" + method := "PUT" + + payload := strings.NewReader(`{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/falcon") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/falcon") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/falcon', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "client_id": { + "type": "string", + "description": "CrowdStrike API client ID" + }, + "secret": { + "type": "string", + "description": "CrowdStrike API client secret" + }, + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier (e.g., \"us-1\", \"us-2\", \"eu-1\")" + }, + "groups": [ + { + "type": "string" + } + ], + "zta_score_threshold": 75, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "cloud_id": { + "type": "string", + "description": "CrowdStrike cloud identifier" + }, + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "zta_score_threshold": { + "type": "integer", + "description": "The minimum Zero Trust Assessment score required for agent approval (0-100)" + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "cloud_id": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "zta_score_threshold": "integer", + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Delete EDR Falcon Integration {{ tag: 'DELETE' , label: '/api/integrations/edr/falcon' }} + + + + Deletes an existing EDR Falcon Integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/integrations/edr/falcon \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/integrations/edr/falcon', + headers: { + '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/integrations/edr/falcon" + +headers = { + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/falcon" + method := "DELETE" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/integrations/edr/falcon") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.new(url) +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/integrations/edr/falcon") + .method("DELETE") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/falcon', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- diff --git a/src/pages/ipa/resources/edr-huntress-integrations.mdx b/src/pages/ipa/resources/edr-huntress-integrations.mdx new file mode 100644 index 00000000..82faa72b --- /dev/null +++ b/src/pages/ipa/resources/edr-huntress-integrations.mdx @@ -0,0 +1,1511 @@ +export const title = 'EDR Huntress Integrations' + + + +## Create EDR Huntress Integration {{ tag: 'POST' , label: '/api/integrations/edr/huntress' }} + + + + Creates a new EDR Huntress integration + + ### Request-Body Parameters + + + + Huntress API key + + + + + Huntress API secret + + + + + The Groups this integrations applies to + + + + + The devices last sync requirement interval in hours. Minimum value is 24 hours + + + + + Indicates whether the integration is enabled + + + + +
+ Attribute conditions to match when approving agents + + + + + Policy status of Defender AV for Managed Antivirus. + + + + + Status of Defender AV Managed Antivirus. + + + + + Sub-status of Defender AV Managed Antivirus. + + + + + Status of agent firewall. Can be one of Disabled, Enabled, Pending Isolation, Isolated, Pending Release. + + + + + +
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/edr/huntress \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/edr/huntress', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/huntress" +payload = json.dumps({ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/huntress" + method := "POST" + + payload := strings.NewReader(`{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/huntress") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/huntress") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/huntress', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "enabled": "boolean", + "match_attributes": { + "defender_policy_status": "string", + "defender_status": "string", + "defender_substatus": "string", + "firewall_status": "string" + } +} +``` + + + + +
+ +--- + + +## Get EDR Huntress Integration {{ tag: 'GET' , label: '/api/integrations/edr/huntress' }} + + + + Retrieves a specific EDR Huntress integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/edr/huntress \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/edr/huntress', + 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/integrations/edr/huntress" + +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/integrations/edr/huntress" + 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/integrations/edr/huntress") + +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/integrations/edr/huntress") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/huntress', + 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' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "enabled": "boolean", + "match_attributes": { + "defender_policy_status": "string", + "defender_status": "string", + "defender_substatus": "string", + "firewall_status": "string" + } +} +``` + + + + + + +--- + + +## Update EDR Huntress Integration {{ tag: 'PUT' , label: '/api/integrations/edr/huntress' }} + + + + Updates an existing EDR Huntress Integration. + + ### Request-Body Parameters + + + + Huntress API key + + + + + Huntress API secret + + + + + The Groups this integrations applies to + + + + + The devices last sync requirement interval in hours. Minimum value is 24 hours + + + + + Indicates whether the integration is enabled + + + + +
+ Attribute conditions to match when approving agents + + + + + Policy status of Defender AV for Managed Antivirus. + + + + + Status of Defender AV Managed Antivirus. + + + + + Sub-status of Defender AV Managed Antivirus. + + + + + Status of agent firewall. Can be one of Disabled, Enabled, Pending Isolation, Isolated, Pending Release. + + + + + +
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/edr/huntress \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/edr/huntress', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/huntress" +payload = json.dumps({ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/huntress" + method := "PUT" + + payload := strings.NewReader(`{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/huntress") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/huntress") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/huntress', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "api_key": { + "type": "string", + "description": "Huntress API key" + }, + "api_secret": { + "type": "string", + "description": "Huntress API secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "defender_policy_status": "Compliant", + "defender_status": "Healthy", + "defender_substatus": "Up to date", + "firewall_status": "Enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "enabled": "boolean", + "match_attributes": { + "defender_policy_status": "string", + "defender_status": "string", + "defender_substatus": "string", + "firewall_status": "string" + } +} +``` + + + + +
+ +--- + + +## Delete EDR Huntress Integration {{ tag: 'DELETE' , label: '/api/integrations/edr/huntress' }} + + + + Deletes an EDR Huntress Integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/integrations/edr/huntress \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/integrations/edr/huntress', + 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/integrations/edr/huntress" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/huntress" + method := "DELETE" + + 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/integrations/edr/huntress") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.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/integrations/edr/huntress") + .method("DELETE") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/huntress', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{} +``` +```json {{ title: 'Schema' }} +{ + "type": "object", + "example": {} +} +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/edr-intune-integrations.mdx b/src/pages/ipa/resources/edr-intune-integrations.mdx new file mode 100644 index 00000000..2a02c3a2 --- /dev/null +++ b/src/pages/ipa/resources/edr-intune-integrations.mdx @@ -0,0 +1,1404 @@ +export const title = 'EDR Intune Integrations' + + + +## Create EDR Intune Integration {{ tag: 'POST' , label: '/api/integrations/edr/intune' }} + + + + Creates a new EDR Intune integration for the authenticated account. + + + ### Request-Body Parameters + + + + The Azure application client id + + + + + The Azure tenant id + + + + + The Azure application client secret + + + + + The Groups this integrations applies to + + + + + The devices last sync requirement interval in hours. Minimum value is 24 hours. + + + + + Indicates whether the integration is enabled + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/edr/intune \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/edr/intune', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/intune" +payload = json.dumps({ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/intune" + method := "POST" + + payload := strings.NewReader(`{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/intune") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/intune") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/intune', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "acc_abcdef123456", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "client_id": "acc_abcdef123456", + "tenant_id": "acc_abcdef123456", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "client_id": "string", + "tenant_id": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Get EDR Intune Integration {{ tag: 'GET' , label: '/api/integrations/edr/intune' }} + + + + Retrieves a specific EDR Intune integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/edr/intune \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/edr/intune', + 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/integrations/edr/intune" + +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/integrations/edr/intune" + 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/integrations/edr/intune") + +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/integrations/edr/intune") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/intune', + 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' }} +{ + "id": 123, + "account_id": "acc_abcdef123456", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "client_id": "acc_abcdef123456", + "tenant_id": "acc_abcdef123456", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "client_id": "string", + "tenant_id": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Update EDR Intune Integration {{ tag: 'PUT' , label: '/api/integrations/edr/intune' }} + + + + Updates an existing EDR Intune Integration. The request body structure is `EDRIntuneRequest`. + + + ### Request-Body Parameters + + + + The Azure application client id + + + + + The Azure tenant id + + + + + The Azure application client secret + + + + + The Groups this integrations applies to + + + + + The devices last sync requirement interval in hours. Minimum value is 24 hours. + + + + + Indicates whether the integration is enabled + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/edr/intune \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/edr/intune', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/intune" +payload = json.dumps({ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/intune" + method := "PUT" + + payload := strings.NewReader(`{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/intune") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/intune") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/intune', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "client_id": { + "type": "string", + "description": "The Azure application client id" + }, + "tenant_id": { + "type": "string", + "description": "The Azure tenant id" + }, + "secret": { + "type": "string", + "description": "The Azure application client secret" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "acc_abcdef123456", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "client_id": "acc_abcdef123456", + "tenant_id": "acc_abcdef123456", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "client_id": "string", + "tenant_id": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Delete EDR Intune Integration {{ tag: 'DELETE' , label: '/api/integrations/edr/intune' }} + + + + Deletes an EDR Intune Integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/integrations/edr/intune \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/integrations/edr/intune', + 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/integrations/edr/intune" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/intune" + method := "DELETE" + + 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/integrations/edr/intune") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.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/integrations/edr/intune") + .method("DELETE") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/intune', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{} +``` +```json {{ title: 'Schema' }} +{ + "type": "object", + "example": {} +} +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/edr-peers.mdx b/src/pages/ipa/resources/edr-peers.mdx new file mode 100644 index 00000000..51d89130 --- /dev/null +++ b/src/pages/ipa/resources/edr-peers.mdx @@ -0,0 +1,517 @@ +export const title = 'EDR Peers' + + + +## Bypass compliance for a non-compliant peer {{ tag: 'POST' , label: '/api/peers/{peer-id}/edr/bypass' }} + + + + Allows an admin to bypass EDR compliance checks for a specific peer. +The peer will remain bypassed until the admin revokes it OR the device becomes +naturally compliant in the EDR system. + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/peers/{peer-id}/edr/bypass \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/peers/{peer-id}/edr/bypass', + 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/peers/{peer-id}/edr/bypass" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/peers/{peer-id}/edr/bypass" + method := "POST" + + 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/peers/{peer-id}/edr/bypass") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.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/peers/{peer-id}/edr/bypass") + .method("POST") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/peers/{peer-id}/edr/bypass', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "peer_id": "chacbco6lnnbn6cg5s91" +} +``` +```json {{ title: 'Schema' }} +{ + "peer_id": "string" +} +``` + + + + + + +--- + + +## Revoke compliance bypass for a peer {{ tag: 'DELETE' , label: '/api/peers/{peer-id}/edr/bypass' }} + + + + Removes the compliance bypass, subjecting the peer to normal EDR validation. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/peers/{peer-id}/edr/bypass \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/peers/{peer-id}/edr/bypass', + headers: { + '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/peers/{peer-id}/edr/bypass" + +headers = { + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/peers/{peer-id}/edr/bypass" + method := "DELETE" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/peers/{peer-id}/edr/bypass") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.new(url) +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/peers/{peer-id}/edr/bypass") + .method("DELETE") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/peers/{peer-id}/edr/bypass', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## List all bypassed peers {{ tag: 'GET' , label: '/api/peers/edr/bypassed' }} + + + + Returns all peers that have compliance bypassed by an admin. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/peers/edr/bypassed \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/peers/edr/bypassed', + 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/peers/edr/bypassed" + +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/peers/edr/bypassed" + 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/peers/edr/bypassed") + +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/peers/edr/bypassed") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/peers/edr/bypassed', + 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' }} +[ + { + "peer_id": "chacbco6lnnbn6cg5s91" + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "peer_id": "string" + } +] +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/edr-sentinelone-integrations.mdx b/src/pages/ipa/resources/edr-sentinelone-integrations.mdx new file mode 100644 index 00000000..7fb9c127 --- /dev/null +++ b/src/pages/ipa/resources/edr-sentinelone-integrations.mdx @@ -0,0 +1,2085 @@ +export const title = 'EDR SentinelOne Integrations' + + + +## Create EDR SentinelOne Integration {{ tag: 'POST' , label: '/api/integrations/edr/sentinelone' }} + + + + Creates a new EDR SentinelOne integration + + ### Request-Body Parameters + + + + SentinelOne API token + + + + + The Base URL of SentinelOne API + + + + + The Groups this integrations applies to + + + + + The devices last sync requirement interval in hours. Minimum value is 24 hours. + + + + + Indicates whether the integration is enabled + + + + +
+ Attribute conditions to match when approving agents + + + + + The maximum allowed number of active threats on the agent + + + + + Whether disk encryption is enabled on the agent + + + + + Whether the agent firewall is enabled + + + + + Whether the agent is currently flagged as infected + + + + + Whether the agent has been recently active and reporting + + + + + Whether the agent is running the latest available version + + + + + The current network connectivity status of the device + + + + + The current operational state of the agent + + + + + +
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/edr/sentinelone \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/edr/sentinelone', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/sentinelone" +payload = json.dumps({ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/sentinelone" + method := "POST" + + payload := strings.NewReader(`{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/sentinelone") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/sentinelone") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/sentinelone', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "api_url": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "match_attributes": { + "active_threats": "integer", + "encrypted_applications": "boolean", + "firewall_enabled": "boolean", + "infected": "boolean", + "is_active": "boolean", + "is_up_to_date": "boolean", + "network_status": "string", + "operational_state": "string" + }, + "enabled": "boolean" +} +``` + + + + +
+ +--- + + +## Get EDR SentinelOne Integration {{ tag: 'GET' , label: '/api/integrations/edr/sentinelone' }} + + + + Retrieves a specific EDR SentinelOne integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/edr/sentinelone \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/edr/sentinelone', + 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/integrations/edr/sentinelone" + +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/integrations/edr/sentinelone" + 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/integrations/edr/sentinelone") + +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/integrations/edr/sentinelone") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/sentinelone', + 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' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "api_url": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "match_attributes": { + "active_threats": "integer", + "encrypted_applications": "boolean", + "firewall_enabled": "boolean", + "infected": "boolean", + "is_active": "boolean", + "is_up_to_date": "boolean", + "network_status": "string", + "operational_state": "string" + }, + "enabled": "boolean" +} +``` + + + + + + +--- + + +## Update EDR SentinelOne Integration {{ tag: 'PUT' , label: '/api/integrations/edr/sentinelone' }} + + + + Updates an existing EDR SentinelOne Integration. + + ### Request-Body Parameters + + + + SentinelOne API token + + + + + The Base URL of SentinelOne API + + + + + The Groups this integrations applies to + + + + + The devices last sync requirement interval in hours. Minimum value is 24 hours. + + + + + Indicates whether the integration is enabled + + + + +
+ Attribute conditions to match when approving agents + + + + + The maximum allowed number of active threats on the agent + + + + + Whether disk encryption is enabled on the agent + + + + + Whether the agent firewall is enabled + + + + + Whether the agent is currently flagged as infected + + + + + Whether the agent has been recently active and reporting + + + + + Whether the agent is running the latest available version + + + + + The current network connectivity status of the device + + + + + The current operational state of the agent + + + + + +
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/edr/sentinelone \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/edr/sentinelone', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/edr/sentinelone" +payload = json.dumps({ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/sentinelone" + method := "PUT" + + payload := strings.NewReader(`{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/edr/sentinelone") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/edr/sentinelone") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/sentinelone', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "api_token": { + "type": "string", + "description": "SentinelOne API token" + }, + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "type": "string" + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours. Minimum value is 24 hours.", + "minimum": 24 + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled", + "default": true + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "ch8i4ug6lnn4g9hqv7l0", + "last_synced_at": "2023-05-15T10:30:00Z", + "created_by": { + "type": "string", + "description": "The user id that created the integration" + }, + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "api_url": { + "type": "string", + "description": "The Base URL of SentinelOne API" + }, + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "devs", + "peers_count": 2, + "resources_count": 5, + "issued": "api", + "peers": [ + { + "id": "chacbco6lnnbn6cg5s90", + "name": "stage-host-1" + } + ], + "resources": [ + { + "id": "chacdk86lnnboviihd7g", + "type": "host" + } + ] + } + ], + "last_synced_interval": { + "type": "integer", + "description": "The devices last sync requirement interval in hours." + }, + "match_attributes": { + "active_threats": 0, + "encrypted_applications": { + "description": "Whether disk encryption is enabled on the agent", + "type": "boolean" + }, + "firewall_enabled": { + "description": "Whether the agent firewall is enabled", + "type": "boolean" + }, + "infected": { + "description": "Whether the agent is currently flagged as infected", + "type": "boolean" + }, + "is_active": { + "description": "Whether the agent has been recently active and reporting", + "type": "boolean" + }, + "is_up_to_date": { + "description": "Whether the agent is running the latest available version", + "type": "boolean" + }, + "network_status": { + "description": "The current network connectivity status of the device", + "type": "string", + "enum": [ + "connected", + "disconnected", + "quarantined" + ] + }, + "operational_state": { + "description": "The current operational state of the agent", + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the integration is enabled" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "last_synced_at": "string", + "created_by": "string", + "created_at": "string", + "updated_at": "string", + "api_url": "string", + "groups": [ + { + "id": "string", + "name": "string", + "peers_count": "integer", + "resources_count": "integer", + "issued": "string", + "peers": [ + { + "id": "string", + "name": "string" + } + ], + "resources": [ + { + "id": "string", + "type": "string" + } + ] + } + ], + "last_synced_interval": "integer", + "match_attributes": { + "active_threats": "integer", + "encrypted_applications": "boolean", + "firewall_enabled": "boolean", + "infected": "boolean", + "is_active": "boolean", + "is_up_to_date": "boolean", + "network_status": "string", + "operational_state": "string" + }, + "enabled": "boolean" +} +``` + + + + +
+ +--- + + +## Delete EDR SentinelOne Integration {{ tag: 'DELETE' , label: '/api/integrations/edr/sentinelone' }} + + + + Deletes an EDR SentinelOne Integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/integrations/edr/sentinelone \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/integrations/edr/sentinelone', + 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/integrations/edr/sentinelone" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/edr/sentinelone" + method := "DELETE" + + 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/integrations/edr/sentinelone") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.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/integrations/edr/sentinelone") + .method("DELETE") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/edr/sentinelone', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{} +``` +```json {{ title: 'Schema' }} +{ + "type": "object", + "example": {} +} +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/event-streaming-integrations.mdx b/src/pages/ipa/resources/event-streaming-integrations.mdx new file mode 100644 index 00000000..b3e6a79e --- /dev/null +++ b/src/pages/ipa/resources/event-streaming-integrations.mdx @@ -0,0 +1,1188 @@ +export const title = 'Event Streaming Integrations' + + + +## Create Event Streaming Integration {{ tag: 'POST' , label: '/api/event-streaming' }} + + + + Creates a new event streaming integration for the authenticated account. +The request body should conform to `CreateIntegrationRequest`. +Note: Based on the provided Go code, the `enabled` field from the request is part of the `CreateIntegrationRequest` struct, +but the backend `manager.CreateIntegration` function signature shown does not directly use this `enabled` field. +The actual behavior for `enabled` during creation should be confirmed (e.g., it might have a server-side default or be handled by other logic). + + + ### Request-Body Parameters + + + + The event streaming platform to integrate with (e.g., "datadog", "s3", "firehose"). This field is used for creation. For updates (PUT), this field, if sent, is ignored by the backend. + + + + + Platform-specific configuration as key-value pairs. For creation, all necessary credentials and settings must be provided. For updates, provide the fields to change or the entire new configuration. + + + + + Specifies whether the integration is enabled. During creation (POST), this value is sent by the client, but the provided backend manager function `CreateIntegration` does not appear to use it directly, so its effect on creation should be verified. During updates (PUT), this field is used to enable or disable the integration. + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/event-streaming \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/event-streaming', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/event-streaming" +payload = json.dumps({ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/event-streaming" + method := "POST" + + payload := strings.NewReader(`{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/event-streaming") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/event-streaming") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/event-streaming', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "acc_abcdef123456", + "enabled": true, + "platform": "datadog", + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "config": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "enabled": "boolean", + "platform": "string", + "created_at": "string", + "updated_at": "string", + "config": { + "type": "object", + "additionalProperties": "string", + "description": "Configuration for the integration. Sensitive keys (like API keys, secret keys) are masked with '****' in responses, as indicated by the GetIntegration handler logic.", + "example": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } + } +} +``` + + + + + + +--- + + +## List Event Streaming Integrations {{ tag: 'GET' , label: '/api/event-streaming' }} + + + + Retrieves all event streaming integrations for the authenticated account. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/event-streaming \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/event-streaming', + 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/event-streaming" + +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/event-streaming" + 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/event-streaming") + +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/event-streaming") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/event-streaming', + 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' }} +[ + { + "id": 123, + "account_id": "acc_abcdef123456", + "enabled": true, + "platform": "datadog", + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "config": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "integer", + "account_id": "string", + "enabled": "boolean", + "platform": "string", + "created_at": "string", + "updated_at": "string", + "config": { + "type": "object", + "additionalProperties": "string", + "description": "Configuration for the integration. Sensitive keys (like API keys, secret keys) are masked with '****' in responses, as indicated by the GetIntegration handler logic.", + "example": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } + } + } +] +``` + + + + + + +--- + + +## Get Event Streaming Integration {{ tag: 'GET' , label: '/api/event-streaming/{id}' }} + + + + Retrieves a specific event streaming integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/event-streaming/{id} \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/event-streaming/{id}', + 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/event-streaming/{id}" + +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/event-streaming/{id}" + 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/event-streaming/{id}") + +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/event-streaming/{id}") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/event-streaming/{id}', + 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' }} +{ + "id": 123, + "account_id": "acc_abcdef123456", + "enabled": true, + "platform": "datadog", + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "config": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "enabled": "boolean", + "platform": "string", + "created_at": "string", + "updated_at": "string", + "config": { + "type": "object", + "additionalProperties": "string", + "description": "Configuration for the integration. Sensitive keys (like API keys, secret keys) are masked with '****' in responses, as indicated by the GetIntegration handler logic.", + "example": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } + } +} +``` + + + + + + +--- + + +## Update Event Streaming Integration {{ tag: 'PUT' , label: '/api/event-streaming/{id}' }} + + + + Updates an existing event streaming integration. The request body structure is `CreateIntegrationRequest`. +However, for updates: +\- The `platform` field, if provided in the body, is ignored by the backend manager function, as the platform of an existing integration is typically immutable. +\- The `enabled` and `config` fields from the request body are used to update the integration. + + + ### Request-Body Parameters + + + + The event streaming platform to integrate with (e.g., "datadog", "s3", "firehose"). This field is used for creation. For updates (PUT), this field, if sent, is ignored by the backend. + + + + + Platform-specific configuration as key-value pairs. For creation, all necessary credentials and settings must be provided. For updates, provide the fields to change or the entire new configuration. + + + + + Specifies whether the integration is enabled. During creation (POST), this value is sent by the client, but the provided backend manager function `CreateIntegration` does not appear to use it directly, so its effect on creation should be verified. During updates (PUT), this field is used to enable or disable the integration. + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/event-streaming/{id} \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/event-streaming/{id}', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/event-streaming/{id}" +payload = json.dumps({ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/event-streaming/{id}" + method := "PUT" + + payload := strings.NewReader(`{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/event-streaming/{id}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/event-streaming/{id}") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/event-streaming/{id}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "platform": "s3", + "config": { + "bucket_name": "my-event-logs", + "region": "us-east-1", + "access_key_id": "AKIA...", + "secret_access_key": "YOUR_SECRET_KEY" + }, + "enabled": true +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "account_id": "acc_abcdef123456", + "enabled": true, + "platform": "datadog", + "created_at": "2023-05-15T10:30:00Z", + "updated_at": "2023-05-16T11:45:00Z", + "config": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "account_id": "string", + "enabled": "boolean", + "platform": "string", + "created_at": "string", + "updated_at": "string", + "config": { + "type": "object", + "additionalProperties": "string", + "description": "Configuration for the integration. Sensitive keys (like API keys, secret keys) are masked with '****' in responses, as indicated by the GetIntegration handler logic.", + "example": { + "api_key": "****", + "site": "datadoghq.com", + "region": "us-east-1" + } + } +} +``` + + + + + + +--- + + +## Delete Event Streaming Integration {{ tag: 'DELETE' , label: '/api/event-streaming/{id}' }} + + + + Deletes an event streaming integration by its ID. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/event-streaming/{id} \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/event-streaming/{id}', + 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/event-streaming/{id}" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/event-streaming/{id}" + method := "DELETE" + + 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/event-streaming/{id}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.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/event-streaming/{id}") + .method("DELETE") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/event-streaming/{id}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{} +``` +```json {{ title: 'Schema' }} +{ + "type": "object", + "example": {} +} +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/events.mdx b/src/pages/ipa/resources/events.mdx index 18cd79d6..83e9bf58 100644 --- a/src/pages/ipa/resources/events.mdx +++ b/src/pages/ipa/resources/events.mdx @@ -561,3 +561,289 @@ echo $response;
--- + + +## List all Reverse Proxy Access Logs {{ tag: 'GET' , label: '/api/events/proxy' }} + + + + Returns a paginated list of all reverse proxy access log entries + + ### Query Parameters + + + + Page number for pagination (1-indexed) + + + + Number of items per page (max 100) + + + + Field to sort by (url sorts by host then path) + + + + Sort order (ascending or descending) + + + + General search across request ID, host, path, source IP, user email, and user name + + + + Filter by source IP address + + + + Filter by host header + + + + Filter by request path (supports partial matching) + + + + Filter by authenticated user ID + + + + Filter by user email (partial matching) + + + + Filter by user name (partial matching) + + + + Filter by HTTP method + + + + Filter by status (success = 2xx/3xx, failed = 1xx/4xx/5xx) + + + + Filter by HTTP status code + + + + 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/events/proxy \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/events/proxy', + 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/events/proxy" + +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/events/proxy" + 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/events/proxy") + +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/events/proxy") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/events/proxy', + 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": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "service_id": "ch8i4ug6lnn4g9hqv7m0", + "timestamp": "2024-01-31T15:30:00Z", + "method": "GET", + "host": "example.com", + "path": "/api/users", + "duration_ms": 150, + "status_code": 200, + "source_ip": "192.168.1.100", + "reason": "Authentication failed", + "user_id": "user-123", + "auth_method_used": "oidc", + "country_code": "US", + "city_name": "San Francisco" + } + ], + "page": 1, + "page_size": 50, + "total_records": 523, + "total_pages": 11 +} +``` +```json {{ title: 'Schema' }} +{ + "data": [ + { + "id": "string", + "service_id": "string", + "timestamp": "string", + "method": "string", + "host": "string", + "path": "string", + "duration_ms": "integer", + "status_code": "integer", + "source_ip": "string", + "reason": "string", + "user_id": "string", + "auth_method_used": "string", + "country_code": "string", + "city_name": "string" + } + ], + "page": "integer", + "page_size": "integer", + "total_records": "integer", + "total_pages": "integer" +} +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/geo-locations.mdx b/src/pages/ipa/resources/geo-locations.mdx index b5b87842..efc05913 100644 --- a/src/pages/ipa/resources/geo-locations.mdx +++ b/src/pages/ipa/resources/geo-locations.mdx @@ -189,7 +189,7 @@ echo $response; - + diff --git a/src/pages/ipa/resources/groups.mdx b/src/pages/ipa/resources/groups.mdx index c336f2fa..bbc8e60f 100644 --- a/src/pages/ipa/resources/groups.mdx +++ b/src/pages/ipa/resources/groups.mdx @@ -569,7 +569,7 @@ echo $response; The unique identifier of a group - + @@ -785,7 +785,7 @@ echo $response; The unique identifier of a group - + ### Request-Body Parameters @@ -1129,7 +1129,7 @@ echo $response; The unique identifier of a group - + diff --git a/src/pages/ipa/resources/identity-providers.mdx b/src/pages/ipa/resources/identity-providers.mdx index d97d8769..d03d17a1 100644 --- a/src/pages/ipa/resources/identity-providers.mdx +++ b/src/pages/ipa/resources/identity-providers.mdx @@ -471,7 +471,7 @@ echo $response; The unique identifier of an identity provider - + @@ -663,7 +663,7 @@ echo $response; The unique identifier of an identity provider - + ### Request-Body Parameters @@ -941,7 +941,7 @@ echo $response; The unique identifier of an identity provider - + diff --git a/src/pages/ipa/resources/idp.mdx b/src/pages/ipa/resources/idp.mdx new file mode 100644 index 00000000..e5443e03 --- /dev/null +++ b/src/pages/ipa/resources/idp.mdx @@ -0,0 +1,1591 @@ +export const title = 'IDP' + + + +## Create SCIM IDP Integration {{ tag: 'POST' , label: '/api/integrations/scim-idp' }} + + + + Creates a new SCIM integration + + ### Request-Body Parameters + + + + The connection prefix used for the SCIM provider + + + + + Name of the SCIM identity provider + + + + + List of start_with string patterns for groups to sync + + + + + List of start_with string patterns for groups which users to sync + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/scim-idp \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/scim-idp" +payload = json.dumps({ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/scim-idp" + method := "POST" + + payload := strings.NewReader(`{ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/scim-idp") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/scim-idp") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "prefix": { + "type": "string", + "description": "The connection prefix used for the SCIM provider" + }, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "enabled": true, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ], + "auth_token": "nbs_abc***********************************", + "last_synced_at": "2023-05-15T10:30:00Z" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "enabled": "boolean", + "provider": "string", + "group_prefixes": [ + "string" + ], + "user_group_prefixes": [ + "string" + ], + "auth_token": "string", + "last_synced_at": "string" +} +``` + + + + + + +--- + + +## Get All SCIM IDP Integrations {{ tag: 'GET' , label: '/api/integrations/scim-idp' }} + + + + Retrieves all SCIM IDP integrations for the authenticated account + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/scim-idp \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp', + 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/integrations/scim-idp" + +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/integrations/scim-idp" + 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/integrations/scim-idp") + +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/integrations/scim-idp") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp', + 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' }} +[ + { + "id": 123, + "enabled": true, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ], + "auth_token": "nbs_abc***********************************", + "last_synced_at": "2023-05-15T10:30:00Z" + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "integer", + "enabled": "boolean", + "provider": "string", + "group_prefixes": [ + "string" + ], + "user_group_prefixes": [ + "string" + ], + "auth_token": "string", + "last_synced_at": "string" + } +] +``` + + + + + + +--- + + +## Get SCIM IDP Integration {{ tag: 'GET' , label: '/api/integrations/scim-idp/{id}' }} + + + + Retrieves an SCIM IDP integration by ID. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/scim-idp/{id} \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp/{id}', + 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/integrations/scim-idp/{id}" + +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/integrations/scim-idp/{id}" + 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/integrations/scim-idp/{id}") + +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/integrations/scim-idp/{id}") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp/{id}', + 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' }} +{ + "id": 123, + "enabled": true, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ], + "auth_token": "nbs_abc***********************************", + "last_synced_at": "2023-05-15T10:30:00Z" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "enabled": "boolean", + "provider": "string", + "group_prefixes": [ + "string" + ], + "user_group_prefixes": [ + "string" + ], + "auth_token": "string", + "last_synced_at": "string" +} +``` + + + + + + +--- + + +## Update SCIM IDP Integration {{ tag: 'PUT' , label: '/api/integrations/scim-idp/{id}' }} + + + + Updates an existing SCIM IDP Integration. + + ### Request-Body Parameters + + + + Indicates whether the integration is enabled + + + + + List of start_with string patterns for groups to sync + + + + + List of start_with string patterns for groups which users to sync + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/scim-idp/{id} \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp/{id}', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/scim-idp/{id}" +payload = json.dumps({ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/scim-idp/{id}" + method := "PUT" + + payload := strings.NewReader(`{ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/scim-idp/{id}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/scim-idp/{id}") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp/{id}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "enabled": true, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ] +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": 123, + "enabled": true, + "provider": { + "type": "string", + "description": "Name of the SCIM identity provider" + }, + "group_prefixes": [ + "Engineering", + "Sales" + ], + "user_group_prefixes": [ + "Users" + ], + "auth_token": "nbs_abc***********************************", + "last_synced_at": "2023-05-15T10:30:00Z" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "integer", + "enabled": "boolean", + "provider": "string", + "group_prefixes": [ + "string" + ], + "user_group_prefixes": [ + "string" + ], + "auth_token": "string", + "last_synced_at": "string" +} +``` + + + + + + +--- + + +## Delete SCIM IDP Integration {{ tag: 'DELETE' , label: '/api/integrations/scim-idp/{id}' }} + + + + Deletes an SCIM IDP integration by ID. + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/integrations/scim-idp/{id} \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp/{id}', + 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/integrations/scim-idp/{id}" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/scim-idp/{id}" + method := "DELETE" + + 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/integrations/scim-idp/{id}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.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/integrations/scim-idp/{id}") + .method("DELETE") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp/{id}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{} +``` +```json {{ title: 'Schema' }} +{ + "type": "object", + "example": {} +} +``` + + + + + + +--- + + +## Regenerate SCIM Token {{ tag: 'POST' , label: '/api/integrations/scim-idp/{id}/token' }} + + + + Regenerates the SCIM API token for an SCIM IDP integration. + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/scim-idp/{id}/token \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp/{id}/token', + 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/integrations/scim-idp/{id}/token" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/scim-idp/{id}/token" + method := "POST" + + 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/integrations/scim-idp/{id}/token") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.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/integrations/scim-idp/{id}/token") + .method("POST") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp/{id}/token', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "auth_token": "nbs_F3f0d..." +} +``` +```json {{ title: 'Schema' }} +{ + "auth_token": "string" +} +``` + + + + + + +--- + + +## Get SCIM Integration Sync Logs {{ tag: 'GET' , label: '/api/integrations/scim-idp/{id}/logs' }} + + + + Retrieves synchronization logs for a SCIM IDP integration. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/scim-idp/{id}/logs \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/scim-idp/{id}/logs', + 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/integrations/scim-idp/{id}/logs" + +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/integrations/scim-idp/{id}/logs" + 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/integrations/scim-idp/{id}/logs") + +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/integrations/scim-idp/{id}/logs") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/scim-idp/{id}/logs', + 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' }} +[ + { + "id": 123, + "level": "info", + "timestamp": "2023-05-15T10:30:00Z", + "message": "Successfully synchronized users and groups" + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "integer", + "level": "string", + "timestamp": "string", + "message": "string" + } +] +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/ingress-ports.mdx b/src/pages/ipa/resources/ingress-ports.mdx index 9d7326e2..913948fe 100644 --- a/src/pages/ipa/resources/ingress-ports.mdx +++ b/src/pages/ipa/resources/ingress-ports.mdx @@ -13,7 +13,7 @@ export const title = 'Ingress Ports' The unique identifier of a peer - + ### Query Parameters @@ -237,7 +237,7 @@ echo $response; The unique identifier of a peer - + ### Request-Body Parameters @@ -625,11 +625,11 @@ echo $response; The unique identifier of a peer - + The unique identifier of an ingress port allocation - + @@ -841,11 +841,11 @@ echo $response; The unique identifier of a peer - + The unique identifier of an ingress port allocation - + ### Request-Body Parameters @@ -1233,11 +1233,11 @@ echo $response; The unique identifier of a peer - + The unique identifier of an ingress port allocation - + @@ -1859,7 +1859,7 @@ echo $response; The unique identifier of an ingress peer - + @@ -2063,7 +2063,7 @@ echo $response; The unique identifier of an ingress peer - + ### Request-Body Parameters @@ -2317,7 +2317,7 @@ echo $response; The unique identifier of an ingress peer - + diff --git a/src/pages/ipa/resources/instance.mdx b/src/pages/ipa/resources/instance.mdx index bba047fb..05221d4c 100644 --- a/src/pages/ipa/resources/instance.mdx +++ b/src/pages/ipa/resources/instance.mdx @@ -178,6 +178,188 @@ echo $response; --- +## Get Version Info {{ tag: 'GET' , label: '/api/instance/version' }} + + + + Returns version information for NetBird components including the current management server version and latest available versions from GitHub. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/instance/version \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/instance/version', + 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/instance/version" + +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/instance/version" + 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/instance/version") + +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/instance/version") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/instance/version', + 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' }} +{ + "management_current_version": "0.35.0", + "dashboard_available_version": "2.10.0", + "management_available_version": "0.35.0", + "management_update_available": true +} +``` +```json {{ title: 'Schema' }} +{ + "management_current_version": "string", + "dashboard_available_version": "string", + "management_available_version": "string", + "management_update_available": "boolean" +} +``` + + + + + + +--- + + ## Setup Instance {{ tag: 'POST' , label: '/api/setup' }} diff --git a/src/pages/ipa/resources/invoice.mdx b/src/pages/ipa/resources/invoice.mdx new file mode 100644 index 00000000..c1ff106e --- /dev/null +++ b/src/pages/ipa/resources/invoice.mdx @@ -0,0 +1,543 @@ +export const title = 'Invoice' + + + +## Get account's paid invoices {{ tag: 'GET' , label: '/api/integrations/billing/invoices' }} + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/billing/invoices \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/billing/invoices', + 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/integrations/billing/invoices" + +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/integrations/billing/invoices" + 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/integrations/billing/invoices") + +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/integrations/billing/invoices") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/billing/invoices', + 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' }} +[ + { + "id": "in_1MtHbELkdIwHu7ixl4OzzPMv", + "type": { + "type": "string", + "description": "The invoice type", + "enum": [ + "account", + "tenants" + ] + }, + "period_start": "2021-08-01T12:00:00Z", + "period_end": "2021-08-31T12:00:00Z" + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "string", + "type": "string", + "period_start": "string", + "period_end": "string" + } +] +``` + + + + + + +--- + + +## Get account invoice URL to Stripe. {{ tag: 'GET' , label: '/api/integrations/billing/invoices/{id}/pdf' }} + + + + + + ### Path Parameters + + + + The unique identifier of the invoice + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/billing/invoices/{id}/pdf \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/billing/invoices/{id}/pdf', + 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/integrations/billing/invoices/{id}/pdf" + +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/integrations/billing/invoices/{id}/pdf" + 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/integrations/billing/invoices/{id}/pdf") + +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/integrations/billing/invoices/{id}/pdf") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/billing/invoices/{id}/pdf', + 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' }} +{ + "url": "https://invoice.stripe.com/i/acct_1M2DaBKina4I2KUb/test_YWNjdF8xTTJEdVBLaW5hM0kyS1ViLF1SeFpQdEJZd3lUOGNEajNqeWdrdXY2RFM4aHcyCnpsLDEzMjg3GTgyNQ02000JoIHc1X?s=db" +} +``` +```json {{ title: 'Schema' }} +{ + "url": "string" +} +``` + + + + + + +--- + + +## Get account invoice CSV. {{ tag: 'GET' , label: '/api/integrations/billing/invoices/{id}/csv' }} + + + + + + ### Path Parameters + + + + The unique identifier of the invoice + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/billing/invoices/{id}/csv \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/billing/invoices/{id}/csv', + headers: { + '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/integrations/billing/invoices/{id}/csv" + +headers = { + '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/integrations/billing/invoices/{id}/csv" + method := "GET" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/integrations/billing/invoices/{id}/csv") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Get.new(url) +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/integrations/billing/invoices/{id}/csv") + .method("GET") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/billing/invoices/{id}/csv', + 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( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- diff --git a/src/pages/ipa/resources/jobs.mdx b/src/pages/ipa/resources/jobs.mdx index 37768c2f..e9820931 100644 --- a/src/pages/ipa/resources/jobs.mdx +++ b/src/pages/ipa/resources/jobs.mdx @@ -13,7 +13,7 @@ export const title = 'Jobs' The unique identifier of a peer - + @@ -276,7 +276,7 @@ echo $response; The unique identifier of a peer - + ### Request-Body Parameters @@ -611,11 +611,11 @@ echo $response; The unique identifier of a peer - + The unique identifier of a job - + diff --git a/src/pages/ipa/resources/msp.mdx b/src/pages/ipa/resources/msp.mdx new file mode 100644 index 00000000..32b0b0bd --- /dev/null +++ b/src/pages/ipa/resources/msp.mdx @@ -0,0 +1,1873 @@ +export const title = 'MSP' + + + +## Get MSP tenants {{ tag: 'GET' , label: '/api/integrations/msp/tenants' }} + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/msp/tenants \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants', + 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/integrations/msp/tenants" + +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/integrations/msp/tenants" + 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/integrations/msp/tenants") + +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/integrations/msp/tenants") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants', + 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' }} +[ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ], + "activated_at": "2021-08-01T12:00:00Z", + "dns_challenge": "YXNkYSBkYXNhc2Rhc2RhIGFzZGFzZDJhc2QyNDUxNQ", + "created_at": "2021-08-01T12:00:00Z", + "updated_at": "2021-08-01T12:00:00Z", + "invited_at": "2021-08-01T12:00:00Z", + "status": "active" + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "string", + "name": "string", + "domain": "string", + "groups": [ + { + "id": "string", + "role": "string" + } + ], + "activated_at": "string", + "dns_challenge": "string", + "created_at": "string", + "updated_at": "string", + "invited_at": "string", + "status": "string" + } +] +``` + + + + + + +--- + + +## Create MSP tenant {{ tag: 'POST' , label: '/api/integrations/msp/tenants' }} + + + + + + ### Request-Body Parameters + + + + The name for the MSP tenant + + + + + The name for the MSP tenant + + + + +
+ MSP users Groups that can access the Tenant and Roles to assume + + + + + The Group ID + + + + + The Role name + + + + + +
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/msp/tenants \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/msp/tenants" +payload = json.dumps({ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants" + method := "POST" + + payload := strings.NewReader(`{ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/msp/tenants") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/msp/tenants") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ], + "activated_at": "2021-08-01T12:00:00Z", + "dns_challenge": "YXNkYSBkYXNhc2Rhc2RhIGFzZGFzZDJhc2QyNDUxNQ", + "created_at": "2021-08-01T12:00:00Z", + "updated_at": "2021-08-01T12:00:00Z", + "invited_at": "2021-08-01T12:00:00Z", + "status": "active" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "groups": [ + { + "id": "string", + "role": "string" + } + ], + "activated_at": "string", + "dns_challenge": "string", + "created_at": "string", + "updated_at": "string", + "invited_at": "string", + "status": "string" +} +``` + + + + +
+ +--- + + +## Update MSP tenant {{ tag: 'PUT' , label: '/api/integrations/msp/tenants/{id}' }} + + + + + + ### Path Parameters + + + + The unique identifier of a tenant account + + + + ### Request-Body Parameters + + + + The name for the MSP tenant + + + + +
+ MSP users Groups that can access the Tenant and Roles to assume + + + + + The Group ID + + + + + The Role name + + + + + +
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/msp/tenants/{id} \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants/{id}', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/msp/tenants/{id}" +payload = json.dumps({ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants/{id}" + method := "PUT" + + payload := strings.NewReader(`{ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/integrations/msp/tenants/{id}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/msp/tenants/{id}") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants/{id}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "name": "My new tenant", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ] +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ], + "activated_at": "2021-08-01T12:00:00Z", + "dns_challenge": "YXNkYSBkYXNhc2Rhc2RhIGFzZGFzZDJhc2QyNDUxNQ", + "created_at": "2021-08-01T12:00:00Z", + "updated_at": "2021-08-01T12:00:00Z", + "invited_at": "2021-08-01T12:00:00Z", + "status": "active" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "groups": [ + { + "id": "string", + "role": "string" + } + ], + "activated_at": "string", + "dns_challenge": "string", + "created_at": "string", + "updated_at": "string", + "invited_at": "string", + "status": "string" +} +``` + + + + +
+ +--- + + +## Unlink a tenant {{ tag: 'POST' , label: '/api/integrations/msp/tenants/{id}/unlink' }} + + + + + + ### Path Parameters + + + + The unique identifier of a tenant account + + + + ### Request-Body Parameters + + + + The new owners user ID. + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/msp/tenants/{id}/unlink \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "owner": "google-oauth2|123456789012345678901" +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "owner": "google-oauth2|123456789012345678901" +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants/{id}/unlink', + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/msp/tenants/{id}/unlink" +payload = json.dumps({ + "owner": "google-oauth2|123456789012345678901" +}) +headers = { + 'Content-Type': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants/{id}/unlink" + method := "POST" + + payload := strings.NewReader(`{ + "owner": "google-oauth2|123456789012345678901" +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("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/integrations/msp/tenants/{id}/unlink") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "owner": "google-oauth2|123456789012345678901" +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "owner": "google-oauth2|123456789012345678901" +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/msp/tenants/{id}/unlink") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants/{id}/unlink', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "owner": "google-oauth2|123456789012345678901" +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## Verify a tenant domain DNS challenge {{ tag: 'POST' , label: '/api/integrations/msp/tenants/{id}/dns' }} + + + + + + ### Path Parameters + + + + The unique identifier of a tenant account + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/msp/tenants/{id}/dns \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants/{id}/dns', + headers: { + '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/integrations/msp/tenants/{id}/dns" + +headers = { + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants/{id}/dns" + method := "POST" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/integrations/msp/tenants/{id}/dns") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +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/integrations/msp/tenants/{id}/dns") + .method("POST") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants/{id}/dns', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## Create subscription for Tenant {{ tag: 'POST' , label: '/api/integrations/msp/tenants/{id}/subscription' }} + + + + + + ### Path Parameters + + + + The unique identifier of a tenant account + + + + ### Request-Body Parameters + + + + The Price ID to change the subscription to. + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/msp/tenants/{id}/subscription \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants/{id}/subscription', + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/msp/tenants/{id}/subscription" +payload = json.dumps({ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}) +headers = { + 'Content-Type': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants/{id}/subscription" + method := "POST" + + payload := strings.NewReader(`{ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("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/integrations/msp/tenants/{id}/subscription") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/msp/tenants/{id}/subscription") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants/{id}/subscription', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "priceID": "price_1HhxOpBzq4JbCqRmJxkpzL2V" +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## Invite existing account as a Tenant to the MSP account {{ tag: 'POST' , label: '/api/integrations/msp/tenants/{id}/invite' }} + + + + + + ### Path Parameters + + + + The unique identifier of an existing tenant account + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/integrations/msp/tenants/{id}/invite \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants/{id}/invite', + 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/integrations/msp/tenants/{id}/invite" + +headers = { + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants/{id}/invite" + method := "POST" + + 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/integrations/msp/tenants/{id}/invite") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.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/integrations/msp/tenants/{id}/invite") + .method("POST") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants/{id}/invite', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": "ch8i4ug6lnn4g9hqv7m0", + "name": "My new tenant", + "domain": "tenant.com", + "groups": [ + { + "id": "ch8i4ug6lnn4g9hqv7m0", + "role": "admin" + } + ], + "activated_at": "2021-08-01T12:00:00Z", + "dns_challenge": "YXNkYSBkYXNhc2Rhc2RhIGFzZGFzZDJhc2QyNDUxNQ", + "created_at": "2021-08-01T12:00:00Z", + "updated_at": "2021-08-01T12:00:00Z", + "invited_at": "2021-08-01T12:00:00Z", + "status": "active" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "groups": [ + { + "id": "string", + "role": "string" + } + ], + "activated_at": "string", + "dns_challenge": "string", + "created_at": "string", + "updated_at": "string", + "invited_at": "string", + "status": "string" +} +``` + + + + + + +--- + + +## Response by the invited Tenant account owner {{ tag: 'PUT' , label: '/api/integrations/msp/tenants/{id}/invite' }} + + + + + + ### Path Parameters + + + + The unique identifier of an existing tenant account + + + + ### Request-Body Parameters + + + + Accept or decline the invitation. + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/integrations/msp/tenants/{id}/invite \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/integrations/msp/tenants/{id}/invite', + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/integrations/msp/tenants/{id}/invite" +payload = json.dumps({ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}) +headers = { + 'Content-Type': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/integrations/msp/tenants/{id}/invite" + method := "PUT" + + payload := strings.NewReader(`{ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("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/integrations/msp/tenants/{id}/invite") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/integrations/msp/tenants/{id}/invite") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/msp/tenants/{id}/invite', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "value": { + "type": "string", + "description": "Accept or decline the invitation.", + "enum": [ + "accept", + "decline" + ] + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- diff --git a/src/pages/ipa/resources/networks.mdx b/src/pages/ipa/resources/networks.mdx index d0c19c67..c930451f 100644 --- a/src/pages/ipa/resources/networks.mdx +++ b/src/pages/ipa/resources/networks.mdx @@ -467,7 +467,7 @@ echo $response; The unique identifier of a network - + @@ -675,7 +675,7 @@ echo $response; The unique identifier of a network - + ### Request-Body Parameters @@ -933,7 +933,7 @@ echo $response; The unique identifier of a network - + @@ -1097,7 +1097,7 @@ echo $response; The unique identifier of a network - + @@ -1313,7 +1313,7 @@ echo $response; The unique identifier of a network - + ### Request-Body Parameters @@ -1625,11 +1625,11 @@ echo $response; The unique identifier of a network - + The unique identifier of a network resource - + @@ -1841,11 +1841,11 @@ echo $response; The unique identifier of a network - + The unique identifier of a resource - + ### Request-Body Parameters @@ -2157,11 +2157,11 @@ echo $response; - + - + @@ -2325,7 +2325,7 @@ echo $response; The unique identifier of a network - + @@ -2527,7 +2527,7 @@ echo $response; The unique identifier of a network - + ### Request-Body Parameters @@ -2825,11 +2825,11 @@ echo $response; The unique identifier of a network - + The unique identifier of a router - + @@ -3027,11 +3027,11 @@ echo $response; The unique identifier of a network - + The unique identifier of a router - + ### Request-Body Parameters @@ -3329,11 +3329,11 @@ echo $response; - + - + diff --git a/src/pages/ipa/resources/peers.mdx b/src/pages/ipa/resources/peers.mdx index a8667fb1..b2af8630 100644 --- a/src/pages/ipa/resources/peers.mdx +++ b/src/pages/ipa/resources/peers.mdx @@ -308,7 +308,7 @@ echo $response; The unique identifier of a peer - + @@ -593,7 +593,7 @@ echo $response; The unique identifier of a peer - + ### Request-Body Parameters @@ -976,7 +976,7 @@ echo $response; The unique identifier of a peer - + @@ -1140,7 +1140,7 @@ echo $response; The unique identifier of a peer - + @@ -1348,7 +1348,7 @@ echo $response; The unique identifier of a peer - + ### Request-Body Parameters diff --git a/src/pages/ipa/resources/policies.mdx b/src/pages/ipa/resources/policies.mdx index 6b89cb42..b6d90ff1 100644 --- a/src/pages/ipa/resources/policies.mdx +++ b/src/pages/ipa/resources/policies.mdx @@ -1113,7 +1113,7 @@ echo $response; The unique identifier of a policy - + @@ -1415,7 +1415,7 @@ echo $response; The unique identifier of a policy - + ### Request-Body Parameters @@ -2225,7 +2225,7 @@ echo $response; The unique identifier of a policy - + diff --git a/src/pages/ipa/resources/posture-checks.mdx b/src/pages/ipa/resources/posture-checks.mdx index c97b2690..85bd857a 100644 --- a/src/pages/ipa/resources/posture-checks.mdx +++ b/src/pages/ipa/resources/posture-checks.mdx @@ -1177,7 +1177,7 @@ echo $response; The unique identifier of a posture check - + @@ -1459,7 +1459,7 @@ echo $response; The unique identifier of a posture check - + ### Request-Body Parameters @@ -2353,7 +2353,7 @@ echo $response; The unique identifier of a posture check - + diff --git a/src/pages/ipa/resources/routes.mdx b/src/pages/ipa/resources/routes.mdx index 3fd25944..68d30e33 100644 --- a/src/pages/ipa/resources/routes.mdx +++ b/src/pages/ipa/resources/routes.mdx @@ -695,7 +695,7 @@ echo $response; The unique identifier of a route - + @@ -923,7 +923,7 @@ echo $response; The unique identifier of a route - + ### Request-Body Parameters @@ -1389,7 +1389,7 @@ echo $response; The unique identifier of a route - + diff --git a/src/pages/ipa/resources/services.mdx b/src/pages/ipa/resources/services.mdx new file mode 100644 index 00000000..2e3ef988 --- /dev/null +++ b/src/pages/ipa/resources/services.mdx @@ -0,0 +1,4399 @@ +export const title = 'Services' + + + +## List all Services {{ tag: 'GET' , label: '/api/reverse-proxies/services' }} + + + + Returns a list of all reverse proxy services + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/reverse-proxies/services \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/services', + 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/reverse-proxies/services" + +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/reverse-proxies/services" + 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/reverse-proxies/services") + +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/reverse-proxies/services") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/services', + 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' }} +[ + { + "id": { + "type": "string", + "description": "Service ID" + }, + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "proxy_cluster": "eu.proxy.netbird.io", + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled" + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + }, + "meta": { + "created_at": "2024-02-03T10:30:00Z", + "certificate_issued_at": "2024-02-03T10:35:00Z", + "status": "active" + } + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "string", + "name": "string", + "domain": "string", + "proxy_cluster": "string", + "targets": [ + { + "target_id": "string", + "target_type": "string", + "path": "string", + "protocol": "string", + "host": "string", + "port": "integer", + "enabled": "boolean" + } + ], + "enabled": "boolean", + "pass_host_header": "boolean", + "rewrite_redirects": "boolean", + "auth": { + "password_auth": { + "enabled": "boolean", + "password": "string" + }, + "pin_auth": { + "enabled": "boolean", + "pin": "string" + }, + "bearer_auth": { + "enabled": "boolean", + "distribution_groups": [ + "string" + ] + }, + "link_auth": { + "enabled": "boolean" + } + }, + "meta": { + "created_at": "string", + "certificate_issued_at": "string", + "status": "string" + } + } +] +``` + + + + + + +--- + + +## Create a Service {{ tag: 'POST' , label: '/api/reverse-proxies/services' }} + + + + Creates a new reverse proxy service + + ### Request-Body Parameters + + + + Service name + + + + + Domain for the service + + + + +
+ List of target backends for this service + + + + + Target ID + + + + + Target type (e.g., "peer", "resource") + + + + + URL path prefix for this target + + + + + Protocol to use when connecting to the backend + + + + + Backend ip or domain for this target + + + + + Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https). + + + + + Whether this target is enabled + + + + + +
+ +
+ + + Whether the service is enabled + + + + + When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address + + + + + When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain + + + + +
+ More Information + + + + +
+ More Information + + + + + Whether password auth is enabled + + + + + Auth password + + + + + +
+ +
+ + +
+ More Information + + + + + Whether PIN auth is enabled + + + + + PIN value + + + + + +
+ +
+ + +
+ More Information + + + + + Whether bearer auth is enabled + + + + + List of group IDs that can use bearer auth + + + + + +
+ +
+ + +
+ More Information + + + + + Whether link auth is enabled + + + + + +
+ +
+
+ +
+
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/reverse-proxies/services \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/services', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/reverse-proxies/services" +payload = json.dumps({ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/reverse-proxies/services" + method := "POST" + + payload := strings.NewReader(`{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/reverse-proxies/services") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/reverse-proxies/services") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/services', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": { + "type": "string", + "description": "Service ID" + }, + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "proxy_cluster": "eu.proxy.netbird.io", + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled" + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + }, + "meta": { + "created_at": "2024-02-03T10:30:00Z", + "certificate_issued_at": "2024-02-03T10:35:00Z", + "status": "active" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "proxy_cluster": "string", + "targets": [ + { + "target_id": "string", + "target_type": "string", + "path": "string", + "protocol": "string", + "host": "string", + "port": "integer", + "enabled": "boolean" + } + ], + "enabled": "boolean", + "pass_host_header": "boolean", + "rewrite_redirects": "boolean", + "auth": { + "password_auth": { + "enabled": "boolean", + "password": "string" + }, + "pin_auth": { + "enabled": "boolean", + "pin": "string" + }, + "bearer_auth": { + "enabled": "boolean", + "distribution_groups": [ + "string" + ] + }, + "link_auth": { + "enabled": "boolean" + } + }, + "meta": { + "created_at": "string", + "certificate_issued_at": "string", + "status": "string" + } +} +``` + + + + +
+ +--- + + +## List available proxy clusters {{ tag: 'GET' , label: '/api/reverse-proxies/clusters' }} + + + + Returns a list of available proxy clusters with their connection status + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/reverse-proxies/clusters \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/clusters', + 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/reverse-proxies/clusters" + +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/reverse-proxies/clusters" + 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/reverse-proxies/clusters") + +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/reverse-proxies/clusters") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/clusters', + 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' }} +[ + { + "address": "eu.proxy.netbird.io", + "connected_proxies": 3 + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "address": "string", + "connected_proxies": "integer" + } +] +``` + + + + + + +--- + + +## Retrieve a Service {{ tag: 'GET' , label: '/api/reverse-proxies/services/{serviceId}' }} + + + + Get information about a specific reverse proxy service + + ### Path Parameters + + + + The unique identifier of a service + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/reverse-proxies/services/{serviceId} \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/services/{serviceId}', + 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/reverse-proxies/services/{serviceId}" + +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/reverse-proxies/services/{serviceId}" + 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/reverse-proxies/services/{serviceId}") + +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/reverse-proxies/services/{serviceId}") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/services/{serviceId}', + 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' }} +{ + "id": { + "type": "string", + "description": "Service ID" + }, + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "proxy_cluster": "eu.proxy.netbird.io", + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled" + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + }, + "meta": { + "created_at": "2024-02-03T10:30:00Z", + "certificate_issued_at": "2024-02-03T10:35:00Z", + "status": "active" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "proxy_cluster": "string", + "targets": [ + { + "target_id": "string", + "target_type": "string", + "path": "string", + "protocol": "string", + "host": "string", + "port": "integer", + "enabled": "boolean" + } + ], + "enabled": "boolean", + "pass_host_header": "boolean", + "rewrite_redirects": "boolean", + "auth": { + "password_auth": { + "enabled": "boolean", + "password": "string" + }, + "pin_auth": { + "enabled": "boolean", + "pin": "string" + }, + "bearer_auth": { + "enabled": "boolean", + "distribution_groups": [ + "string" + ] + }, + "link_auth": { + "enabled": "boolean" + } + }, + "meta": { + "created_at": "string", + "certificate_issued_at": "string", + "status": "string" + } +} +``` + + + + + + +--- + + +## Update a Service {{ tag: 'PUT' , label: '/api/reverse-proxies/services/{serviceId}' }} + + + + Update an existing service + + ### Path Parameters + + + + The unique identifier of a service + + + + ### Request-Body Parameters + + + + Service name + + + + + Domain for the service + + + + +
+ List of target backends for this service + + + + + Target ID + + + + + Target type (e.g., "peer", "resource") + + + + + URL path prefix for this target + + + + + Protocol to use when connecting to the backend + + + + + Backend ip or domain for this target + + + + + Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https). + + + + + Whether this target is enabled + + + + + +
+ +
+ + + Whether the service is enabled + + + + + When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address + + + + + When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain + + + + +
+ More Information + + + + +
+ More Information + + + + + Whether password auth is enabled + + + + + Auth password + + + + + +
+ +
+ + +
+ More Information + + + + + Whether PIN auth is enabled + + + + + PIN value + + + + + +
+ +
+ + +
+ More Information + + + + + Whether bearer auth is enabled + + + + + List of group IDs that can use bearer auth + + + + + +
+ +
+ + +
+ More Information + + + + + Whether link auth is enabled + + + + + +
+ +
+
+ +
+
+ +
+
+ + + + + + +```bash {{ title: 'cURL' }} +curl -X PUT https://api.netbird.io/api/reverse-proxies/services/{serviceId} \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}); +let config = { + method: 'put', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/services/{serviceId}', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/reverse-proxies/services/{serviceId}" +payload = json.dumps({ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("PUT", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/reverse-proxies/services/{serviceId}" + method := "PUT" + + payload := strings.NewReader(`{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/reverse-proxies/services/{serviceId}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Put.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/reverse-proxies/services/{serviceId}") + .method("PUT", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/services/{serviceId}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS => '{ + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled", + "default": true + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": { + "type": "string", + "description": "Service ID" + }, + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "proxy_cluster": "eu.proxy.netbird.io", + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled" + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + }, + "meta": { + "created_at": "2024-02-03T10:30:00Z", + "certificate_issued_at": "2024-02-03T10:35:00Z", + "status": "active" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "proxy_cluster": "string", + "targets": [ + { + "target_id": "string", + "target_type": "string", + "path": "string", + "protocol": "string", + "host": "string", + "port": "integer", + "enabled": "boolean" + } + ], + "enabled": "boolean", + "pass_host_header": "boolean", + "rewrite_redirects": "boolean", + "auth": { + "password_auth": { + "enabled": "boolean", + "password": "string" + }, + "pin_auth": { + "enabled": "boolean", + "pin": "string" + }, + "bearer_auth": { + "enabled": "boolean", + "distribution_groups": [ + "string" + ] + }, + "link_auth": { + "enabled": "boolean" + } + }, + "meta": { + "created_at": "string", + "certificate_issued_at": "string", + "status": "string" + } +} +``` + + + + +
+ +--- + + +## Delete a Service {{ tag: 'DELETE' , label: '/api/reverse-proxies/services/{serviceId}' }} + + + + Delete an existing service + + ### Path Parameters + + + + The unique identifier of a service + + + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/reverse-proxies/services/{serviceId} \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/services/{serviceId}', + headers: { + '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/reverse-proxies/services/{serviceId}" + +headers = { + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/reverse-proxies/services/{serviceId}" + method := "DELETE" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/reverse-proxies/services/{serviceId}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.new(url) +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/reverse-proxies/services/{serviceId}") + .method("DELETE") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/services/{serviceId}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## Retrieve Service Domains {{ tag: 'GET' , label: '/api/reverse-proxies/domains' }} + + + + Get information about domains that can be used for service endpoints. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/reverse-proxies/domains \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/domains', + 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/reverse-proxies/domains" + +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/reverse-proxies/domains" + 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/reverse-proxies/domains") + +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/reverse-proxies/domains") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/domains', + 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' }} +[ + { + "id": { + "type": "string", + "description": "Domain ID" + }, + "domain": { + "type": "string", + "description": "Domain name" + }, + "validated": { + "type": "boolean", + "description": "Whether the domain has been validated" + }, + "type": "free", + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain is validated against (only for custom domains)" + } + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "string", + "domain": "string", + "validated": "boolean", + "type": "string", + "target_cluster": "string" + } +] +``` + + + + + + +--- + + +## Create a Custom domain {{ tag: 'POST' , label: '/api/reverse-proxies/domains' }} + + + + Create a new Custom domain for use with service endpoints, this will trigger an initial validation check + + ### Request-Body Parameters + + + + Domain name + + + + + The proxy cluster this domain should be validated against + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/reverse-proxies/domains \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/domains', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/reverse-proxies/domains" +payload = json.dumps({ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/reverse-proxies/domains" + method := "POST" + + payload := strings.NewReader(`{ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/reverse-proxies/domains") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/reverse-proxies/domains") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/domains', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "domain": { + "type": "string", + "description": "Domain name" + }, + "target_cluster": { + "type": "string", + "description": "The proxy cluster this domain should be validated against" + } +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": { + "type": "string", + "description": "Service ID" + }, + "name": { + "type": "string", + "description": "Service name" + }, + "domain": { + "type": "string", + "description": "Domain for the service" + }, + "proxy_cluster": "eu.proxy.netbird.io", + "targets": [ + { + "target_id": { + "type": "string", + "description": "Target ID" + }, + "target_type": { + "type": "string", + "description": "Target type (e.g., \"peer\", \"resource\")", + "enum": [ + "peer", + "resource" + ] + }, + "path": { + "type": "string", + "description": "URL path prefix for this target" + }, + "protocol": { + "type": "string", + "description": "Protocol to use when connecting to the backend", + "enum": [ + "http", + "https" + ] + }, + "host": { + "type": "string", + "description": "Backend ip or domain for this target" + }, + "port": { + "type": "integer", + "description": "Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https)." + }, + "enabled": { + "type": "boolean", + "description": "Whether this target is enabled" + } + } + ], + "enabled": { + "type": "boolean", + "description": "Whether the service is enabled" + }, + "pass_host_header": { + "type": "boolean", + "description": "When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address" + }, + "rewrite_redirects": { + "type": "boolean", + "description": "When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain" + }, + "auth": { + "password_auth": { + "enabled": { + "type": "boolean", + "description": "Whether password auth is enabled" + }, + "password": { + "type": "string", + "description": "Auth password" + } + }, + "pin_auth": { + "enabled": { + "type": "boolean", + "description": "Whether PIN auth is enabled" + }, + "pin": { + "type": "string", + "description": "PIN value" + } + }, + "bearer_auth": { + "enabled": { + "type": "boolean", + "description": "Whether bearer auth is enabled" + }, + "distribution_groups": [ + { + "type": "string" + } + ] + }, + "link_auth": { + "enabled": { + "type": "boolean", + "description": "Whether link auth is enabled" + } + } + }, + "meta": { + "created_at": "2024-02-03T10:30:00Z", + "certificate_issued_at": "2024-02-03T10:35:00Z", + "status": "active" + } +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "name": "string", + "domain": "string", + "proxy_cluster": "string", + "targets": [ + { + "target_id": "string", + "target_type": "string", + "path": "string", + "protocol": "string", + "host": "string", + "port": "integer", + "enabled": "boolean" + } + ], + "enabled": "boolean", + "pass_host_header": "boolean", + "rewrite_redirects": "boolean", + "auth": { + "password_auth": { + "enabled": "boolean", + "password": "string" + }, + "pin_auth": { + "enabled": "boolean", + "pin": "string" + }, + "bearer_auth": { + "enabled": "boolean", + "distribution_groups": [ + "string" + ] + }, + "link_auth": { + "enabled": "boolean" + } + }, + "meta": { + "created_at": "string", + "certificate_issued_at": "string", + "status": "string" + } +} +``` + + + + + + +--- + + +## Delete a Custom domain {{ tag: 'DELETE' , label: '/api/reverse-proxies/domains/{domainId}' }} + + + + Delete an existing service custom domain + + ### Path Parameters + + + + The custom domain ID + + + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/reverse-proxies/domains/{domainId} \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/domains/{domainId}', + headers: { + '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/reverse-proxies/domains/{domainId}" + +headers = { + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/reverse-proxies/domains/{domainId}" + method := "DELETE" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/reverse-proxies/domains/{domainId}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.new(url) +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/reverse-proxies/domains/{domainId}") + .method("DELETE") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/domains/{domainId}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## Validate a custom domain {{ tag: 'GET' , label: '/api/reverse-proxies/domains/{domainId}/validate' }} + + + + Trigger domain ownership validation for a custom domain + + ### Path Parameters + + + + The custom domain ID + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/reverse-proxies/domains/{domainId}/validate \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/reverse-proxies/domains/{domainId}/validate', + headers: { + '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/reverse-proxies/domains/{domainId}/validate" + +headers = { + '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/reverse-proxies/domains/{domainId}/validate" + method := "GET" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/reverse-proxies/domains/{domainId}/validate") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Get.new(url) +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/reverse-proxies/domains/{domainId}/validate") + .method("GET") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/reverse-proxies/domains/{domainId}/validate', + 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( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- diff --git a/src/pages/ipa/resources/setup-keys.mdx b/src/pages/ipa/resources/setup-keys.mdx index a8698eb8..fd7e67b9 100644 --- a/src/pages/ipa/resources/setup-keys.mdx +++ b/src/pages/ipa/resources/setup-keys.mdx @@ -557,7 +557,7 @@ echo $response; The unique identifier of a setup key - + @@ -773,7 +773,7 @@ echo $response; The unique identifier of a setup key - + ### Request-Body Parameters @@ -1053,7 +1053,7 @@ echo $response; The unique identifier of a setup key - + diff --git a/src/pages/ipa/resources/tokens.mdx b/src/pages/ipa/resources/tokens.mdx index 5cd0a7bc..9cd2a195 100644 --- a/src/pages/ipa/resources/tokens.mdx +++ b/src/pages/ipa/resources/tokens.mdx @@ -13,7 +13,7 @@ export const title = 'Tokens' The unique identifier of a user - + @@ -211,7 +211,7 @@ echo $response; The unique identifier of a user - + ### Request-Body Parameters @@ -461,11 +461,11 @@ echo $response; The unique identifier of a user - + The unique identifier of a token - + @@ -659,11 +659,11 @@ echo $response; The unique identifier of a user - + The unique identifier of a token - + diff --git a/src/pages/ipa/resources/usage.mdx b/src/pages/ipa/resources/usage.mdx new file mode 100644 index 00000000..fef75e3a --- /dev/null +++ b/src/pages/ipa/resources/usage.mdx @@ -0,0 +1,184 @@ +export const title = 'Usage' + + + +## Get current usage {{ tag: 'GET' , label: '/api/integrations/billing/usage' }} + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/integrations/billing/usage \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/integrations/billing/usage', + 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/integrations/billing/usage" + +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/integrations/billing/usage" + 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/integrations/billing/usage") + +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/integrations/billing/usage") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/integrations/billing/usage', + 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' }} +{ + "active_users": 15, + "total_users": 20, + "active_peers": 10, + "total_peers": 25 +} +``` +```json {{ title: 'Schema' }} +{ + "active_users": "integer", + "total_users": "integer", + "active_peers": "integer", + "total_peers": "integer" +} +``` + + + + + + +--- diff --git a/src/pages/ipa/resources/users.mdx b/src/pages/ipa/resources/users.mdx index 8c1ddebf..a1255bf5 100644 --- a/src/pages/ipa/resources/users.mdx +++ b/src/pages/ipa/resources/users.mdx @@ -629,7 +629,7 @@ echo $response; The unique identifier of a user - + ### Request-Body Parameters @@ -965,7 +965,7 @@ echo $response; The unique identifier of a user - + @@ -1129,7 +1129,7 @@ echo $response; The unique identifier of a user - + @@ -1293,7 +1293,7 @@ echo $response; The unique identifier of a user - + @@ -1553,7 +1553,7 @@ echo $response; The unique identifier of a user - + @@ -1717,7 +1717,7 @@ echo $response; The unique identifier of a user - + ### Request-Body Parameters @@ -2170,3 +2170,1301 @@ echo $response;
--- + + +## List user invites {{ tag: 'GET' , label: '/api/users/invites' }} + + + + Lists all pending invites for the account. Only available when embedded IdP is enabled. + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/users/invites \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/users/invites', + 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/users/invites" + +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/users/invites" + 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/users/invites") + +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/users/invites") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/invites', + 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' }} +[ + { + "id": "d5p7eedra0h0lt6f59hg", + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_at": "2024-01-25T10:00:00Z", + "created_at": "2024-01-22T10:00:00Z", + "expired": false, + "invite_token": "nbi_Xk5Lz9mP2vQwRtYu1aN3bC4dE5fGh0ABC123" + } +] +``` +```json {{ title: 'Schema' }} +[ + { + "id": "string", + "email": "string", + "name": "string", + "role": "string", + "auto_groups": [ + "string" + ], + "expires_at": "string", + "created_at": "string", + "expired": "boolean", + "invite_token": "string" + } +] +``` + + + + + + +--- + + +## Create a user invite {{ tag: 'POST' , label: '/api/users/invites' }} + + + + Creates an invite link for a new user. Only available when embedded IdP is enabled. The user is not created until they accept the invite. + + ### Request-Body Parameters + + + + User's email address + + + + + User's full name + + + + + User's NetBird account role + + + + + Group IDs to auto-assign to peers registered by this user + + + + + Invite expiration time in seconds (default 72 hours) + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/users/invites \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/users/invites', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/users/invites" +payload = json.dumps({ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/users/invites" + method := "POST" + + payload := strings.NewReader(`{ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/users/invites") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/users/invites") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/invites', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_in": 259200 +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "id": "d5p7eedra0h0lt6f59hg", + "email": "user@example.com", + "name": "John Doe", + "role": "user", + "auto_groups": [ + "ch8i4ug6lnn4g9hqv7m0" + ], + "expires_at": "2024-01-25T10:00:00Z", + "created_at": "2024-01-22T10:00:00Z", + "expired": false, + "invite_token": "nbi_Xk5Lz9mP2vQwRtYu1aN3bC4dE5fGh0ABC123" +} +``` +```json {{ title: 'Schema' }} +{ + "id": "string", + "email": "string", + "name": "string", + "role": "string", + "auto_groups": [ + "string" + ], + "expires_at": "string", + "created_at": "string", + "expired": "boolean", + "invite_token": "string" +} +``` + + + + + + +--- + + +## Delete a user invite {{ tag: 'DELETE' , label: '/api/users/invites/{inviteId}' }} + + + + Deletes a pending invite. Only available when embedded IdP is enabled. + + ### Path Parameters + + + + The ID of the invite to delete + + + + + + +```bash {{ title: 'cURL' }} +curl -X DELETE https://api.netbird.io/api/users/invites/{inviteId} \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'delete', + maxBodyLength: Infinity, + url: '/api/users/invites/{inviteId}', + headers: { + '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/users/invites/{inviteId}" + +headers = { + 'Authorization': 'Token ' +} + +response = requests.request("DELETE", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/users/invites/{inviteId}" + method := "DELETE" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + 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/users/invites/{inviteId}") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Delete.new(url) +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/users/invites/{inviteId}") + .method("DELETE") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/invites/{inviteId}', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + + + +--- + + +## Regenerate a user invite {{ tag: 'POST' , label: '/api/users/invites/{inviteId}/regenerate' }} + + + + Regenerates an invite link for an existing invite. Invalidates the previous token and creates a new one. + + ### Path Parameters + + + + The ID of the invite to regenerate + + + + ### Request-Body Parameters + + + + Invite expiration time in seconds (default 72 hours) + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/users/invites/{inviteId}/regenerate \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "expires_in": 259200 +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "expires_in": 259200 +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/users/invites/{inviteId}/regenerate', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/users/invites/{inviteId}/regenerate" +payload = json.dumps({ + "expires_in": 259200 +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/users/invites/{inviteId}/regenerate" + method := "POST" + + payload := strings.NewReader(`{ + "expires_in": 259200 +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/users/invites/{inviteId}/regenerate") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "expires_in": 259200 +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "expires_in": 259200 +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/users/invites/{inviteId}/regenerate") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/invites/{inviteId}/regenerate', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "expires_in": 259200 +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "invite_token": "nbi_Xk5Lz9mP2vQwRtYu1aN3bC4dE5fGh0ABC123", + "invite_expires_at": "2024-01-28T10:00:00Z" +} +``` +```json {{ title: 'Schema' }} +{ + "invite_token": "string", + "invite_expires_at": "string" +} +``` + + + + + + +--- + + +## Get invite information {{ tag: 'GET' , label: '/api/users/invites/{token}' }} + + + + Retrieves public information about an invite. This endpoint is unauthenticated and protected by the token itself. + + ### Path Parameters + + + + The invite token + + + + + + +```bash {{ title: 'cURL' }} +curl -X GET https://api.netbird.io/api/users/invites/{token} \ +-H 'Accept: application/json' \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'get', + maxBodyLength: Infinity, + url: '/api/users/invites/{token}', + 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/users/invites/{token}" + +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/users/invites/{token}" + 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/users/invites/{token}") + +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/users/invites/{token}") + .method("GET") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/invites/{token}', + 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' }} +{ + "email": "user@example.com", + "name": "John Doe", + "expires_at": "2024-01-25T10:00:00Z", + "valid": true, + "invited_by": "Admin User" +} +``` +```json {{ title: 'Schema' }} +{ + "email": "string", + "name": "string", + "expires_at": "string", + "valid": "boolean", + "invited_by": "string" +} +``` + + + + + + +--- + + +## Accept an invite {{ tag: 'POST' , label: '/api/users/invites/{token}/accept' }} + + + + Accepts an invite and creates the user with the provided password. This endpoint is unauthenticated and protected by the token itself. + + ### Path Parameters + + + + The invite token + + + + ### Request-Body Parameters + + + + The password the user wants to set. Must be at least 8 characters long and contain at least one uppercase letter, one digit, and one special character (any character that is not a letter or digit, including spaces). + + + + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/users/invites/{token}/accept \ +-H 'Accept: application/json' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Token ' \ +--data-raw '{ + "password": "SecurePass123!" +}' +``` + +```js +const axios = require('axios'); +let data = JSON.stringify({ + "password": "SecurePass123!" +}); +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/users/invites/{token}/accept', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': 'Token ' + }, + data : data +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/users/invites/{token}/accept" +payload = json.dumps({ + "password": "SecurePass123!" +}) +headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers, data=payload) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/users/invites/{token}/accept" + method := "POST" + + payload := strings.NewReader(`{ + "password": "SecurePass123!" +}`) + client := &http.Client { + } + req, err := http.NewRequest(method, url, payload) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Accept", "application/json") + req.Header.Add("Authorization", "Token ") + + 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/users/invites/{token}/accept") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Content-Type"] = "application/json" +request["Accept"] = "application/json" +request["Authorization"] = "Token " + +request.body = JSON.dump({ + "password": "SecurePass123!" +}) +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +MediaType mediaType = MediaType.parse("application/json"); +RequestBody body = RequestBody.create(mediaType, '{ + "password": "SecurePass123!" +}'); +Request request = new Request.Builder() + .url("https://api.netbird.io/api/users/invites/{token}/accept") + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/invites/{token}/accept', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => '{ + "password": "SecurePass123!" +}', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Accept: application/json', + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + +```json {{ title: 'Example' }} +{ + "success": true +} +``` +```json {{ title: 'Schema' }} +{ + "success": "boolean" +} +``` + + + + + + +---