Link Existing Asset to Release
curl --request POST \
--url https://api.royalti.io/releases/{id}/tracks/link-asset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetId": "550e8400-e29b-41d4-a716-446655440000",
"trackNumber": 2,
"overrides": {
"title": "My Song (Radio Edit)",
"explicit": "clean"
}
}
'import requests
url = "https://api.royalti.io/releases/{id}/tracks/link-asset"
payload = {
"assetId": "550e8400-e29b-41d4-a716-446655440000",
"trackNumber": 2,
"overrides": {
"title": "My Song (Radio Edit)",
"explicit": "clean"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assetId: '550e8400-e29b-41d4-a716-446655440000',
trackNumber: 2,
overrides: {title: 'My Song (Radio Edit)', explicit: 'clean'}
})
};
fetch('https://api.royalti.io/releases/{id}/tracks/link-asset', 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/releases/{id}/tracks/link-asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assetId' => '550e8400-e29b-41d4-a716-446655440000',
'trackNumber' => 2,
'overrides' => [
'title' => 'My Song (Radio Edit)',
'explicit' => 'clean'
]
]),
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/releases/{id}/tracks/link-asset"
payload := strings.NewReader("{\n \"assetId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"trackNumber\": 2,\n \"overrides\": {\n \"title\": \"My Song (Radio Edit)\",\n \"explicit\": \"clean\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.royalti.io/releases/{id}/tracks/link-asset")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assetId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"trackNumber\": 2,\n \"overrides\": {\n \"title\": \"My Song (Radio Edit)\",\n \"explicit\": \"clean\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/releases/{id}/tracks/link-asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assetId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"trackNumber\": 2,\n \"overrides\": {\n \"title\": \"My Song (Radio Edit)\",\n \"explicit\": \"clean\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Asset \"My Song\" linked to release successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"TenantId": 123,
"ReleaseId": "660e8400-e29b-41d4-a716-446655441111",
"assetId": "770e8400-e29b-41d4-a716-446655442222",
"trackNumber": 1,
"title": "My Track Title",
"version": "Radio Edit",
"isrc": "USABC1234567",
"iswc": "T-123456789-0",
"duration": 213.5,
"lyrics": "Verse 1\nChorus\nVerse 2",
"language": "en",
"displayArtist": "Artist Name",
"artists": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"artistName": "John Doe",
"type": "primary"
},
{
"id": "660e8400-e29b-41d4-a716-446655441111",
"artistName": "Jane Smith",
"type": "featuring"
}
],
"mainGenre": [
"Pop",
"Rock"
],
"subGenre": [
"Alternative"
],
"contributors": {
"producer": [
"Producer Name"
],
"songwriter": [
"Writer Name"
]
},
"media": [
{
"cloudId": "550e8400-e29b-41d4-a716-446655440000",
"cloudUrl": "https://storage.royalti.io/files/audio.mp3",
"type": "audio",
"name": "my-track.mp3",
"isLink": false,
"releasePath": "tenant123/releases/release456/tracks/track789/file.mp3",
"metadata": {
"duration": 213.5,
"bitrate": "320",
"sampleRate": "44100",
"channels": "2",
"codec": "mp3",
"fileSize": 1048576,
"mimeType": "audio/mpeg",
"processedAt": "2023-11-07T05:31:56Z",
"linkValidated": true
}
}
],
"metadata": {
"bpm": 120,
"key": "C Major"
},
"explicit": false
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Internal server error"
}Release
Link Existing Asset to Release
POST /releases//tracks/link-asset
POST
/
releases
/
{id}
/
tracks
/
link-asset
Link Existing Asset to Release
curl --request POST \
--url https://api.royalti.io/releases/{id}/tracks/link-asset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetId": "550e8400-e29b-41d4-a716-446655440000",
"trackNumber": 2,
"overrides": {
"title": "My Song (Radio Edit)",
"explicit": "clean"
}
}
'import requests
url = "https://api.royalti.io/releases/{id}/tracks/link-asset"
payload = {
"assetId": "550e8400-e29b-41d4-a716-446655440000",
"trackNumber": 2,
"overrides": {
"title": "My Song (Radio Edit)",
"explicit": "clean"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assetId: '550e8400-e29b-41d4-a716-446655440000',
trackNumber: 2,
overrides: {title: 'My Song (Radio Edit)', explicit: 'clean'}
})
};
fetch('https://api.royalti.io/releases/{id}/tracks/link-asset', 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/releases/{id}/tracks/link-asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assetId' => '550e8400-e29b-41d4-a716-446655440000',
'trackNumber' => 2,
'overrides' => [
'title' => 'My Song (Radio Edit)',
'explicit' => 'clean'
]
]),
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/releases/{id}/tracks/link-asset"
payload := strings.NewReader("{\n \"assetId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"trackNumber\": 2,\n \"overrides\": {\n \"title\": \"My Song (Radio Edit)\",\n \"explicit\": \"clean\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.royalti.io/releases/{id}/tracks/link-asset")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assetId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"trackNumber\": 2,\n \"overrides\": {\n \"title\": \"My Song (Radio Edit)\",\n \"explicit\": \"clean\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/releases/{id}/tracks/link-asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assetId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"trackNumber\": 2,\n \"overrides\": {\n \"title\": \"My Song (Radio Edit)\",\n \"explicit\": \"clean\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Asset \"My Song\" linked to release successfully",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"TenantId": 123,
"ReleaseId": "660e8400-e29b-41d4-a716-446655441111",
"assetId": "770e8400-e29b-41d4-a716-446655442222",
"trackNumber": 1,
"title": "My Track Title",
"version": "Radio Edit",
"isrc": "USABC1234567",
"iswc": "T-123456789-0",
"duration": 213.5,
"lyrics": "Verse 1\nChorus\nVerse 2",
"language": "en",
"displayArtist": "Artist Name",
"artists": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"artistName": "John Doe",
"type": "primary"
},
{
"id": "660e8400-e29b-41d4-a716-446655441111",
"artistName": "Jane Smith",
"type": "featuring"
}
],
"mainGenre": [
"Pop",
"Rock"
],
"subGenre": [
"Alternative"
],
"contributors": {
"producer": [
"Producer Name"
],
"songwriter": [
"Writer Name"
]
},
"media": [
{
"cloudId": "550e8400-e29b-41d4-a716-446655440000",
"cloudUrl": "https://storage.royalti.io/files/audio.mp3",
"type": "audio",
"name": "my-track.mp3",
"isLink": false,
"releasePath": "tenant123/releases/release456/tracks/track789/file.mp3",
"metadata": {
"duration": 213.5,
"bitrate": "320",
"sampleRate": "44100",
"channels": "2",
"codec": "mp3",
"fileSize": 1048576,
"mimeType": "audio/mpeg",
"processedAt": "2023-11-07T05:31:56Z",
"linkValidated": true
}
}
],
"metadata": {
"bpm": 120,
"key": "C Major"
},
"explicit": false
}
}{
"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
This endpoint allows linking an existing Asset to a release as a new track. The Asset’s data will be used as defaults, which can be overridden with theoverrides parameter. Only releases in ‘draft’ or ‘rejected’ status can have Assets linked.
Authorization:
- Required role:
useror higher
Code Examples
const response = await fetch('https://api.royalti.io/releases/example-id/tracks/link-asset', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"ref": "#/components/schemas/LinkAssetRequest"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/releases/example-id/tracks/link-asset',
headers={
'Authorization': f'Bearer {token}'
},
json={"ref":"#/components/schemas/LinkAssetRequest"}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/releases/example-id/tracks/link-asset \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ref":"#/components/schemas/LinkAssetRequest"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
Release ID
Body
application/json
UUID of the existing Asset to link
Example:
"550e8400-e29b-41d4-a716-446655440000"
Optional specific track number (if not provided, will use next available)
Required range:
x >= 1Example:
2
Optional fields to override from the Asset's data
Show child attributes
Show child attributes
Example:
{
"title": "Radio Edit Version",
"explicit": "clean"
}
⌘I