Update Royalty Source (Admin)
curl --request PUT \
--url https://api.royalti.io/sources/admin/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"label": "<string>",
"type": "<string>",
"format": "<string>",
"public": true,
"isActive": true,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"dataQuery": {},
"fileNameFormat": "<string>",
"schema": "<string>",
"delimiter": "<string>",
"tableNameFormat": "<string>",
"headerRows": 123,
"defaultCurrency": "<string>",
"defaultFeeRate": 123,
"feeDescription": "<string>",
"feeEmbeddedInQuery": true,
"parentSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.royalti.io/sources/admin/{id}"
payload = {
"name": "<string>",
"label": "<string>",
"type": "<string>",
"format": "<string>",
"public": True,
"isActive": True,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"dataQuery": {},
"fileNameFormat": "<string>",
"schema": "<string>",
"delimiter": "<string>",
"tableNameFormat": "<string>",
"headerRows": 123,
"defaultCurrency": "<string>",
"defaultFeeRate": 123,
"feeDescription": "<string>",
"feeEmbeddedInQuery": True,
"parentSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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: '<string>',
label: '<string>',
type: '<string>',
format: '<string>',
public: true,
isActive: true,
startDate: '2023-12-25',
endDate: '2023-12-25',
dataQuery: {},
fileNameFormat: '<string>',
schema: '<string>',
delimiter: '<string>',
tableNameFormat: '<string>',
headerRows: 123,
defaultCurrency: '<string>',
defaultFeeRate: 123,
feeDescription: '<string>',
feeEmbeddedInQuery: true,
parentSourceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.royalti.io/sources/admin/{id}', 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/sources/admin/{id}",
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' => '<string>',
'label' => '<string>',
'type' => '<string>',
'format' => '<string>',
'public' => true,
'isActive' => true,
'startDate' => '2023-12-25',
'endDate' => '2023-12-25',
'dataQuery' => [
],
'fileNameFormat' => '<string>',
'schema' => '<string>',
'delimiter' => '<string>',
'tableNameFormat' => '<string>',
'headerRows' => 123,
'defaultCurrency' => '<string>',
'defaultFeeRate' => 123,
'feeDescription' => '<string>',
'feeEmbeddedInQuery' => true,
'parentSourceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/sources/admin/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"public\": true,\n \"isActive\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"dataQuery\": {},\n \"fileNameFormat\": \"<string>\",\n \"schema\": \"<string>\",\n \"delimiter\": \"<string>\",\n \"tableNameFormat\": \"<string>\",\n \"headerRows\": 123,\n \"defaultCurrency\": \"<string>\",\n \"defaultFeeRate\": 123,\n \"feeDescription\": \"<string>\",\n \"feeEmbeddedInQuery\": true,\n \"parentSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/sources/admin/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"public\": true,\n \"isActive\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"dataQuery\": {},\n \"fileNameFormat\": \"<string>\",\n \"schema\": \"<string>\",\n \"delimiter\": \"<string>\",\n \"tableNameFormat\": \"<string>\",\n \"headerRows\": 123,\n \"defaultCurrency\": \"<string>\",\n \"defaultFeeRate\": 123,\n \"feeDescription\": \"<string>\",\n \"feeEmbeddedInQuery\": true,\n \"parentSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/sources/admin/{id}")
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\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"public\": true,\n \"isActive\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"dataQuery\": {},\n \"fileNameFormat\": \"<string>\",\n \"schema\": \"<string>\",\n \"delimiter\": \"<string>\",\n \"tableNameFormat\": \"<string>\",\n \"headerRows\": 123,\n \"defaultCurrency\": \"<string>\",\n \"defaultFeeRate\": 123,\n \"feeDescription\": \"<string>\",\n \"feeEmbeddedInQuery\": true,\n \"parentSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "RoyaltySource updated successfully",
"data": {
"id": "src-1",
"name": "spotify",
"label": "Spotify",
"type": "DSP",
"format": "csv",
"public": true,
"isActive": true,
"startDate": "2020-01-01",
"endDate": "2025-01-01",
"dataQuery": {
"type": "bigquery",
"dataset": "royalty_data"
},
"fileNameFormat": "{ORG}_Snap_{SALPER-YYYYMM}_Monthly-Sales.csv",
"schema": "artist_name,track_name,streams,revenue",
"delimiter": ",",
"tableNameFormat": "merlin_snap_SALPER_ACCPER",
"columnFormat": "Start_Date:SALPER-YYYY-MM-DD;ISRC:ISRC",
"headerRows": 1,
"fileInfo": {},
"salesDataQuery": "<string>",
"royaltySumQuery": "<string>",
"countSumQuery": "<string>",
"metadataQuery": "<string>",
"assetExtractionQuery": "<string>",
"productExtractionQuery": "<string>",
"defaultCurrency": "USD",
"defaultFeeRate": 0.015,
"feeType": "percentage",
"feeDescription": "Merlin distribution fee",
"feeEmbeddedInQuery": false,
"parentSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceCategory": "dsp"
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}Sources
Update Royalty Source (Admin)
Updates an existing royalty source record.
PUT
/
sources
/
admin
/
{id}
Update Royalty Source (Admin)
curl --request PUT \
--url https://api.royalti.io/sources/admin/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"label": "<string>",
"type": "<string>",
"format": "<string>",
"public": true,
"isActive": true,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"dataQuery": {},
"fileNameFormat": "<string>",
"schema": "<string>",
"delimiter": "<string>",
"tableNameFormat": "<string>",
"headerRows": 123,
"defaultCurrency": "<string>",
"defaultFeeRate": 123,
"feeDescription": "<string>",
"feeEmbeddedInQuery": true,
"parentSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.royalti.io/sources/admin/{id}"
payload = {
"name": "<string>",
"label": "<string>",
"type": "<string>",
"format": "<string>",
"public": True,
"isActive": True,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"dataQuery": {},
"fileNameFormat": "<string>",
"schema": "<string>",
"delimiter": "<string>",
"tableNameFormat": "<string>",
"headerRows": 123,
"defaultCurrency": "<string>",
"defaultFeeRate": 123,
"feeDescription": "<string>",
"feeEmbeddedInQuery": True,
"parentSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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: '<string>',
label: '<string>',
type: '<string>',
format: '<string>',
public: true,
isActive: true,
startDate: '2023-12-25',
endDate: '2023-12-25',
dataQuery: {},
fileNameFormat: '<string>',
schema: '<string>',
delimiter: '<string>',
tableNameFormat: '<string>',
headerRows: 123,
defaultCurrency: '<string>',
defaultFeeRate: 123,
feeDescription: '<string>',
feeEmbeddedInQuery: true,
parentSourceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.royalti.io/sources/admin/{id}', 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/sources/admin/{id}",
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' => '<string>',
'label' => '<string>',
'type' => '<string>',
'format' => '<string>',
'public' => true,
'isActive' => true,
'startDate' => '2023-12-25',
'endDate' => '2023-12-25',
'dataQuery' => [
],
'fileNameFormat' => '<string>',
'schema' => '<string>',
'delimiter' => '<string>',
'tableNameFormat' => '<string>',
'headerRows' => 123,
'defaultCurrency' => '<string>',
'defaultFeeRate' => 123,
'feeDescription' => '<string>',
'feeEmbeddedInQuery' => true,
'parentSourceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/sources/admin/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"public\": true,\n \"isActive\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"dataQuery\": {},\n \"fileNameFormat\": \"<string>\",\n \"schema\": \"<string>\",\n \"delimiter\": \"<string>\",\n \"tableNameFormat\": \"<string>\",\n \"headerRows\": 123,\n \"defaultCurrency\": \"<string>\",\n \"defaultFeeRate\": 123,\n \"feeDescription\": \"<string>\",\n \"feeEmbeddedInQuery\": true,\n \"parentSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/sources/admin/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"public\": true,\n \"isActive\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"dataQuery\": {},\n \"fileNameFormat\": \"<string>\",\n \"schema\": \"<string>\",\n \"delimiter\": \"<string>\",\n \"tableNameFormat\": \"<string>\",\n \"headerRows\": 123,\n \"defaultCurrency\": \"<string>\",\n \"defaultFeeRate\": 123,\n \"feeDescription\": \"<string>\",\n \"feeEmbeddedInQuery\": true,\n \"parentSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/sources/admin/{id}")
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\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"public\": true,\n \"isActive\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"dataQuery\": {},\n \"fileNameFormat\": \"<string>\",\n \"schema\": \"<string>\",\n \"delimiter\": \"<string>\",\n \"tableNameFormat\": \"<string>\",\n \"headerRows\": 123,\n \"defaultCurrency\": \"<string>\",\n \"defaultFeeRate\": 123,\n \"feeDescription\": \"<string>\",\n \"feeEmbeddedInQuery\": true,\n \"parentSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "RoyaltySource updated successfully",
"data": {
"id": "src-1",
"name": "spotify",
"label": "Spotify",
"type": "DSP",
"format": "csv",
"public": true,
"isActive": true,
"startDate": "2020-01-01",
"endDate": "2025-01-01",
"dataQuery": {
"type": "bigquery",
"dataset": "royalty_data"
},
"fileNameFormat": "{ORG}_Snap_{SALPER-YYYYMM}_Monthly-Sales.csv",
"schema": "artist_name,track_name,streams,revenue",
"delimiter": ",",
"tableNameFormat": "merlin_snap_SALPER_ACCPER",
"columnFormat": "Start_Date:SALPER-YYYY-MM-DD;ISRC:ISRC",
"headerRows": 1,
"fileInfo": {},
"salesDataQuery": "<string>",
"royaltySumQuery": "<string>",
"countSumQuery": "<string>",
"metadataQuery": "<string>",
"assetExtractionQuery": "<string>",
"productExtractionQuery": "<string>",
"defaultCurrency": "USD",
"defaultFeeRate": 0.015,
"feeType": "percentage",
"feeDescription": "Merlin distribution fee",
"feeEmbeddedInQuery": false,
"parentSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceCategory": "dsp"
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
Required Permissions
sources:admin:update
Updatable Fields
All fields from the create endpoint can be updated individually. Only provided fields are modified; omitted fields remain unchanged.Code Examples
const response = await fetch('https://api.royalti.io/sources/admin/example-id', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "sample-name",
"label": "sample-label",
"type": "sample-type",
"format": "sample-format",
"public": true,
"isActive": true,
"startDate": "2024-01-21",
"endDate": "2024-01-21",
"dataQuery": {},
"fileNameFormat": "sample-fileNameFormat",
"schema": "sample-schema",
"delimiter": "sample-delimiter",
"tableNameFormat": "sample-tableNameFormat",
"headerRows": 1,
"defaultCurrency": "sample-defaultCurrency",
"defaultFeeRate": 1,
"feeType": "sample-feeType",
"feeDescription": "sample-feeDescription",
"exchangeRateStrategy": "sample-exchangeRateStrategy",
"feeEmbeddedInQuery": true,
"parentSourceId": "sample-parentSourceId",
"sourceCategory": "sample-sourceCategory"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
'https://api.royalti.io/sources/admin/example-id',
headers={
'Authorization': f'Bearer {token}'
},
json={"name":"sample-name","label":"sample-label","type":"sample-type","format":"sample-format","public":true,"isActive":true,"startDate":"2024-01-21","endDate":"2024-01-21","dataQuery":{},"fileNameFormat":"sample-fileNameFormat","schema":"sample-schema","delimiter":"sample-delimiter","tableNameFormat":"sample-tableNameFormat","headerRows":1,"defaultCurrency":"sample-defaultCurrency","defaultFeeRate":1,"feeType":"sample-feeType","feeDescription":"sample-feeDescription","exchangeRateStrategy":"sample-exchangeRateStrategy","feeEmbeddedInQuery":true,"parentSourceId":"sample-parentSourceId","sourceCategory":"sample-sourceCategory"}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/sources/admin/example-id \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"sample-name","label":"sample-label","type":"sample-type","format":"sample-format","public":true,"isActive":true,"startDate":"2024-01-21","endDate":"2024-01-21","dataQuery":{},"fileNameFormat":"sample-fileNameFormat","schema":"sample-schema","delimiter":"sample-delimiter","tableNameFormat":"sample-tableNameFormat","headerRows":1,"defaultCurrency":"sample-defaultCurrency","defaultFeeRate":1,"feeType":"sample-feeType","feeDescription":"sample-feeDescription","exchangeRateStrategy":"sample-exchangeRateStrategy","feeEmbeddedInQuery":true,"parentSourceId":"sample-parentSourceId","sourceCategory":"sample-sourceCategory"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
Royalty source ID
Example:
"src-1"
Body
application/json
Source name (normalized to lowercase)
Display label
Source type
File format
JSONB query configuration. When provided as an object, dedicated query columns are auto-synced.
Maximum string length:
3Available options:
percentage, fixed Available options:
cte, inline, external_table Available options:
aggregator, dsp, publisher, label, other ⌘I