Update Raw Logs Configuration
Updates raw logs configuration. Accepts two distinct payload variants on the same endpoint:
Variant A — Resource assignment (application/json): Replaces the resource list
for a specific delivery type (api, s3, or syslog). Returns the full updated
RawLogsApiResponse envelope including the refreshed data object.
Variant B — Syslog endpoint create/update (application/x-www-form-urlencoded):
Creates a new syslog endpoint (omit syslogid) or updates an existing one (include
syslogid). Returns a minimal success envelope; the client reloads the full config
afterwards via GET /account/logs.
Anonymization constraint: a resource may have anonymization (v4 or v6 ≠ '0') active on at most one syslog endpoint at a time. The server returns a validation error if conflicting anonymization is attempted.
curl -X POST "https://api.5centscdn.com/v2/account/logs" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"resources": [
"12345",
"67890"
],
"type": "api"
}'
import requests
import json
url = "https://api.5centscdn.com/v2/account/logs"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"resources": [
"12345",
"67890"
],
"type": "api"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/account/logs", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"resources": [
"12345",
"67890"
],
"type": "api"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"resources": [
"12345",
"67890"
],
"type": "api"
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/account/logs", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/account/logs')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"resources": [
"12345",
"67890"
],
"type": "api"
}'
response = http.request(request)
puts response.body
{
"result": "success",
"data": {
"id": 10001,
"hashid": "abc123def456",
"resources_api": [
"12345",
"67890"
],
"resources_s3": [
"12345"
],
"resources_syslog": {
"0": {
"id": "42",
"hostname": "syslog.example.com",
"port": "514",
"protocol": "udp",
"format": "json",
"anonymize": {
"v4": "0",
"v6": "0"
},
"resources": [
"12345"
]
}
},
"counts": {
"s3": 1,
"api": 2,
"syslog": 1,
"bySyslog": {
"42": 1
}
},
"resources_syslog_curr": [
"12345"
],
"limit": 10,
"available": 9
}
}
{
"result": "success"
}
{
"result": "error",
"message": "Validation failed",
"errors": [
"Hostname is required",
"Port must be between 1 and 65535"
]
}
/account/logs
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
Complete replacement list of resource IDs. Overwrites all previously assigned resources for the given delivery type.
Log delivery type to update.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Body
Complete replacement list of resource IDs. Overwrites all previously assigned resources for the given delivery type.
["12345","67890"]Responses
Operation outcome.
successfailureComplete raw logs configuration for a service account. Returned by GET and embedded in successful POST responses.
Human-readable error description. Present only when result is not 'success'.