cURL
curl --request PUT \
--url https://api.example.com/v1/panel/settings/theme/assets/{kind} \
--header 'Content-Type: image/*' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '<string>'import requests
url = "https://api.example.com/v1/panel/settings/theme/assets/{kind}"
payload = "<string>"
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "image/*"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'image/*'},
body: '<string>'
};
fetch('https://api.example.com/v1/panel/settings/theme/assets/{kind}', 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://api.example.com/v1/panel/settings/theme/assets/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: image/*",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$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://api.example.com/v1/panel/settings/theme/assets/{kind}"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "image/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/v1/panel/settings/theme/assets/{kind}")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "image/*")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/settings/theme/assets/{kind}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'image/*'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"kind": "logo_light",
"contentType": "image/png",
"byteSize": 123,
"checksum": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}panel
Put v1panelsettingsthemeassets
Requires settings.write. The body is the image itself rather than a form or a base64 field, so its size is bounded before a byte is read. The declared content type must match the magic number of the bytes. SVG is not accepted: it can carry a script, and these files are served from the same origin as both panels.
PUT
/
v1
/
panel
/
settings
/
theme
/
assets
/
{kind}
cURL
curl --request PUT \
--url https://api.example.com/v1/panel/settings/theme/assets/{kind} \
--header 'Content-Type: image/*' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '<string>'import requests
url = "https://api.example.com/v1/panel/settings/theme/assets/{kind}"
payload = "<string>"
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "image/*"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'image/*'},
body: '<string>'
};
fetch('https://api.example.com/v1/panel/settings/theme/assets/{kind}', 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://api.example.com/v1/panel/settings/theme/assets/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: image/*",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$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://api.example.com/v1/panel/settings/theme/assets/{kind}"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "image/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/v1/panel/settings/theme/assets/{kind}")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "image/*")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/settings/theme/assets/{kind}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'image/*'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"kind": "logo_light",
"contentType": "image/png",
"byteSize": 123,
"checksum": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Headers
Echoes the token from the current session. Required on every unsafe method.
Path Parameters
Available options:
logo_light, logo_dark, favicon Body
image/*
One PNG, JPEG, or WebP image. The exact type is declared in the Content-Type header and must match the bytes themselves; the media type range here is what lets one request body carry any of the three.
The body is of type file.
Response
Saved
Available options:
logo_light, logo_dark, favicon Available options:
image/png, image/jpeg, image/webp SHA-256 of the bytes, hex encoded. Published as the ETag of the asset.