Enable or disable server log collection
curl --request PUT \
--url https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"enabled": true
}
'import requests
url = "https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection"
payload = { "enabled": True }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"replayed": true,
"serverId": "<string>",
"desiredState": "enabled",
"status": "failed",
"generation": "<string>",
"version": "<string>",
"lastReportAt": "<string>",
"lastIngestedAt": "<string>",
"errorMessage": "<string>",
"supportedContainers": 123,
"unsupportedContainers": 123,
"queueBytes": 123,
"droppedRecords": 123,
"localization": {
"dateFormat": "day-short-month-year",
"timeFormat": "24-hour",
"timeZone": "<string>",
"timestamps": {}
}
}{
"replayed": true,
"serverId": "<string>",
"desiredState": "enabled",
"status": "failed",
"generation": "<string>",
"version": "<string>",
"lastReportAt": "<string>",
"lastIngestedAt": "<string>",
"errorMessage": "<string>",
"supportedContainers": 123,
"unsupportedContainers": 123,
"queueBytes": 123,
"droppedRecords": 123,
"localization": {
"dateFormat": "day-short-month-year",
"timeFormat": "24-hour",
"timeZone": "<string>",
"timestamps": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Enable or disable server log collection
Enable or disable server log collection through the Towbar REST API.
PUT
/
servers
/
{serverId}
/
log-collection
Enable or disable server log collection
curl --request PUT \
--url https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"enabled": true
}
'import requests
url = "https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection"
payload = { "enabled": True }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://towbar-api.example.com/v1/api/servers/{serverId}/log-collection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"replayed": true,
"serverId": "<string>",
"desiredState": "enabled",
"status": "failed",
"generation": "<string>",
"version": "<string>",
"lastReportAt": "<string>",
"lastIngestedAt": "<string>",
"errorMessage": "<string>",
"supportedContainers": 123,
"unsupportedContainers": 123,
"queueBytes": 123,
"droppedRecords": 123,
"localization": {
"dateFormat": "day-short-month-year",
"timeFormat": "24-hour",
"timeZone": "<string>",
"timestamps": {}
}
}{
"replayed": true,
"serverId": "<string>",
"desiredState": "enabled",
"status": "failed",
"generation": "<string>",
"version": "<string>",
"lastReportAt": "<string>",
"lastIngestedAt": "<string>",
"errorMessage": "<string>",
"supportedContainers": 123,
"unsupportedContainers": 123,
"queueBytes": 123,
"droppedRecords": 123,
"localization": {
"dateFormat": "day-short-month-year",
"timeFormat": "24-hour",
"timeZone": "<string>",
"timestamps": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Required permissions: server.collectLogs. Personal keys are capped by their owner’s current team role.
Supply an Idempotency-Key for this action. An accepted request may continue asynchronously; poll the returned ID.
See request conventions and automation workflows. MCP clients use the task-oriented tool catalogue.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
1 - 255Path Parameters
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Body
application/json
Response
Queued installation or disable operation. The generation identifies this operation; inspect until it reaches waiting, collecting, disabled, or failed. Waiting does not prove ingestion. Accepted work continues asynchronously; poll its ID. An idempotent replay returns 200.
Allowed value:
"enabled"status
Option 1 · stringOption 2 · stringOption 3 · stringOption 4 · stringOption 5 · stringOption 6 · stringOption 7 · stringOption 8 · string
required
Allowed value:
"failed"Show child attributes
Show child attributes
Last modified on October 15, 2026
