Update Template
curl --request PUT \
--url https://api.royalti.io/defaultsettings/templates/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Hip-Hop Album Standard",
"description": "Updated settings for hip-hop album releases",
"tags": [
"hip-hop",
"album",
"updated"
]
}
'import requests
url = "https://api.royalti.io/defaultsettings/templates/{templateId}"
payload = {
"name": "Updated Hip-Hop Album Standard",
"description": "Updated settings for hip-hop album releases",
"tags": ["hip-hop", "album", "updated"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated Hip-Hop Album Standard',
description: 'Updated settings for hip-hop album releases',
tags: ['hip-hop', 'album', 'updated']
})
};
fetch('https://api.royalti.io/defaultsettings/templates/{templateId}', 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.royalti.io/defaultsettings/templates/{templateId}",
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([
'name' => 'Updated Hip-Hop Album Standard',
'description' => 'Updated settings for hip-hop album releases',
'tags' => [
'hip-hop',
'album',
'updated'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.royalti.io/defaultsettings/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"Updated Hip-Hop Album Standard\",\n \"description\": \"Updated settings for hip-hop album releases\",\n \"tags\": [\n \"hip-hop\",\n \"album\",\n \"updated\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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://api.royalti.io/defaultsettings/templates/{templateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Hip-Hop Album Standard\",\n \"description\": \"Updated settings for hip-hop album releases\",\n \"tags\": [\n \"hip-hop\",\n \"album\",\n \"updated\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/defaultsettings/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Hip-Hop Album Standard\",\n \"description\": \"Updated settings for hip-hop album releases\",\n \"tags\": [\n \"hip-hop\",\n \"album\",\n \"updated\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Template updated successfully",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"settings": {
"content": {
"version": "<string>",
"language": "<string>",
"mainGenre": [
"<string>"
],
"subGenre": [
"<string>"
],
"contributors": {}
},
"business": {
"label": "<string>",
"copyright": "<string>",
"publisher": "<string>",
"copyrightOwner": "<string>",
"distribution": "<string>"
},
"ddex": {
"enableDDEX": true,
"labelName": "<string>",
"resourceReference": "<string>",
"grid": "<string>",
"icpn": "<string>"
},
"validation": {
"requireGenre": true,
"requireLyrics": true,
"requireDescription": true,
"minimumTrackCount": 1,
"maximumTrackCount": 2
}
},
"description": "<string>",
"isPublic": true,
"isSystem": false,
"usageCount": 0,
"tags": [
"<string>"
],
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}Default Settings
Update Template
PUT /defaultsettings/templates/
PUT
/
defaultsettings
/
templates
/
{templateId}
Update Template
curl --request PUT \
--url https://api.royalti.io/defaultsettings/templates/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Hip-Hop Album Standard",
"description": "Updated settings for hip-hop album releases",
"tags": [
"hip-hop",
"album",
"updated"
]
}
'import requests
url = "https://api.royalti.io/defaultsettings/templates/{templateId}"
payload = {
"name": "Updated Hip-Hop Album Standard",
"description": "Updated settings for hip-hop album releases",
"tags": ["hip-hop", "album", "updated"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated Hip-Hop Album Standard',
description: 'Updated settings for hip-hop album releases',
tags: ['hip-hop', 'album', 'updated']
})
};
fetch('https://api.royalti.io/defaultsettings/templates/{templateId}', 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.royalti.io/defaultsettings/templates/{templateId}",
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([
'name' => 'Updated Hip-Hop Album Standard',
'description' => 'Updated settings for hip-hop album releases',
'tags' => [
'hip-hop',
'album',
'updated'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.royalti.io/defaultsettings/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"Updated Hip-Hop Album Standard\",\n \"description\": \"Updated settings for hip-hop album releases\",\n \"tags\": [\n \"hip-hop\",\n \"album\",\n \"updated\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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://api.royalti.io/defaultsettings/templates/{templateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Hip-Hop Album Standard\",\n \"description\": \"Updated settings for hip-hop album releases\",\n \"tags\": [\n \"hip-hop\",\n \"album\",\n \"updated\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/defaultsettings/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Hip-Hop Album Standard\",\n \"description\": \"Updated settings for hip-hop album releases\",\n \"tags\": [\n \"hip-hop\",\n \"album\",\n \"updated\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Template updated successfully",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"settings": {
"content": {
"version": "<string>",
"language": "<string>",
"mainGenre": [
"<string>"
],
"subGenre": [
"<string>"
],
"contributors": {}
},
"business": {
"label": "<string>",
"copyright": "<string>",
"publisher": "<string>",
"copyrightOwner": "<string>",
"distribution": "<string>"
},
"ddex": {
"enableDDEX": true,
"labelName": "<string>",
"resourceReference": "<string>",
"grid": "<string>",
"icpn": "<string>"
},
"validation": {
"requireGenre": true,
"requireLyrics": true,
"requireDescription": true,
"minimumTrackCount": 1,
"maximumTrackCount": 2
}
},
"description": "<string>",
"isPublic": true,
"isSystem": false,
"usageCount": 0,
"tags": [
"<string>"
],
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}Description
PUT /defaultsettings/templates/ Description: Update an existing template. Only the template creator can update it (unless it’s a system template). Authorization:- Required role:
adminor higher
PUT
Path Parameters:
| Parameter | Type | Description | Required |
|---|---|---|---|
| templateId | uuid | ID of template to update | Yes |
| Parameter | Type | Description | Required |
|---|---|---|---|
| name | string | Template name | No |
| description | string | Template description | No |
| settings | object | Template settings | No |
| isPublic | boolean | Public visibility | No |
| tags | array | Tags for categorization | No |
Code Examples
const response = await fetch('https://api.royalti.io/defaultsettings/templates/example-id', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "sample-name",
"description": "sample-description",
"isPublic": true,
"tags": [
{}
]
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
'https://api.royalti.io/defaultsettings/templates/example-id',
json={"name":"sample-name","description":"sample-description","isPublic":true,"tags":[{}]}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/defaultsettings/templates/example-id \
-H "Content-Type: application/json" \
-d '{"name":"sample-name","description":"sample-description","isPublic":true,"tags":[{}]}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
ID of the template to update
Body
application/json
⌘I