Upload media for an asset
curl --request POST \
--url https://api.royalti.io/asset/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import requests
url = "https://api.royalti.io/asset/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.royalti.io/asset/{id}/media', 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/asset/{id}/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/asset/{id}/media"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/asset/{id}/media")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/asset/{id}/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"message": "Media added successfully",
"asset": {
"title": "Midnight City",
"mainArtist": [
"M83",
"M47"
],
"displayArtist": "M83",
"id": "550e8400-e29b-41d4-a716-446655440000",
"otherArtist": [
"Featured Artist"
],
"type": "Audio",
"version": "Album Version",
"isrc": "USRC17607839",
"iswc": "T-123456789-0",
"lyrics": "Waiting in a car...",
"mainGenre": [
"Electronic",
"Synthpop"
],
"subGenre": [
"Synthwave"
],
"contributors": {
"producers": [
"Producer Name"
],
"mixers": [
"Mixer Name"
],
"songwriters": [
"Songwriter Name"
]
},
"externalId": "EXT-12345",
"extra": {
"notes": "Recorded in Abbey Road Studios"
},
"metadata": {
"releaseYear": 2011
},
"assetIDs": [
"asset-1",
"asset-2"
],
"explicit": "clean",
"label": "Royalti Records",
"copyright": "© 2024 Royalti Records",
"publisher": "Royalti Publishing",
"copyrightOwner": "Royalti Music Group",
"artists": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "primary"
},
"660e8400-e29b-41d4-a716-446655440001"
],
"split": [
{
"user": "550e8400-e29b-41d4-a716-446655440002",
"share": 60
},
{
"user": "550e8400-e29b-41d4-a716-446655440003",
"share": 40
}
],
"ddexMetadata": {
"releaseType": "Single",
"recordLabel": "Royalti Records"
},
"resourceReference": "SR123456789",
"technicalResourceDetails": {
"fileFormat": "WAV",
"audioCodec": "PCM",
"bitrate": 1411,
"sampleRate": 44100,
"duration": "PT3M45S"
},
"soundRecordingDetails": {
"recordingDate": "2024-01-15",
"recordingLocation": "Abbey Road Studios",
"language": "en"
},
"musicalWorkReference": {
"workId": "work-123",
"iswc": "T-123456789-0"
},
"enableDDEX": false,
"focusTrack": false,
"danceStyle": [
"Electronic Dance"
],
"rhythmStyle": [
"Upbeat"
],
"instrumentation": [
"Synthesizer",
"Drums"
],
"recordingLocation": "Abbey Road Studios",
"recordingDate": "2024-01-15",
"alternativeTitles": [
"Alt Title 1",
"Alt Title 2"
],
"chartPositions": [
{
"chart": "Billboard Hot 100",
"position": 10,
"date": "2024-01-01"
}
],
"reviews": [
{
"reviewer": "Music Magazine",
"rating": 4.5,
"text": "Great track!"
}
],
"awards": [
{
"name": "Best Electronic Song",
"year": 2024
}
],
"socialMediaHandles": {
"twitter": "@artistname",
"instagram": "@artistname"
},
"language": "en",
"mood": [
"Energetic",
"Uplifting"
],
"tempo": 128,
"key": "C Major",
"productionYear": 2024,
"createdAt": "2026-01-15T02:52:25.458Z",
"updatedAt": "2026-01-15T03:48:31.763Z",
"Artists": [
{
"id": "e0dc6000-af34-4071-8a85-dcadace05c36",
"artistName": "nedJamez",
"type": "primary"
}
],
"Products": []
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Asset
Upload media for an asset
Upload media files (e.g., audio, artwork) for an asset.
POST
/
asset
/
{id}
/
media
Upload media for an asset
curl --request POST \
--url https://api.royalti.io/asset/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import requests
url = "https://api.royalti.io/asset/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.royalti.io/asset/{id}/media', 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/asset/{id}/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/asset/{id}/media"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/asset/{id}/media")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/asset/{id}/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"message": "Media added successfully",
"asset": {
"title": "Midnight City",
"mainArtist": [
"M83",
"M47"
],
"displayArtist": "M83",
"id": "550e8400-e29b-41d4-a716-446655440000",
"otherArtist": [
"Featured Artist"
],
"type": "Audio",
"version": "Album Version",
"isrc": "USRC17607839",
"iswc": "T-123456789-0",
"lyrics": "Waiting in a car...",
"mainGenre": [
"Electronic",
"Synthpop"
],
"subGenre": [
"Synthwave"
],
"contributors": {
"producers": [
"Producer Name"
],
"mixers": [
"Mixer Name"
],
"songwriters": [
"Songwriter Name"
]
},
"externalId": "EXT-12345",
"extra": {
"notes": "Recorded in Abbey Road Studios"
},
"metadata": {
"releaseYear": 2011
},
"assetIDs": [
"asset-1",
"asset-2"
],
"explicit": "clean",
"label": "Royalti Records",
"copyright": "© 2024 Royalti Records",
"publisher": "Royalti Publishing",
"copyrightOwner": "Royalti Music Group",
"artists": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "primary"
},
"660e8400-e29b-41d4-a716-446655440001"
],
"split": [
{
"user": "550e8400-e29b-41d4-a716-446655440002",
"share": 60
},
{
"user": "550e8400-e29b-41d4-a716-446655440003",
"share": 40
}
],
"ddexMetadata": {
"releaseType": "Single",
"recordLabel": "Royalti Records"
},
"resourceReference": "SR123456789",
"technicalResourceDetails": {
"fileFormat": "WAV",
"audioCodec": "PCM",
"bitrate": 1411,
"sampleRate": 44100,
"duration": "PT3M45S"
},
"soundRecordingDetails": {
"recordingDate": "2024-01-15",
"recordingLocation": "Abbey Road Studios",
"language": "en"
},
"musicalWorkReference": {
"workId": "work-123",
"iswc": "T-123456789-0"
},
"enableDDEX": false,
"focusTrack": false,
"danceStyle": [
"Electronic Dance"
],
"rhythmStyle": [
"Upbeat"
],
"instrumentation": [
"Synthesizer",
"Drums"
],
"recordingLocation": "Abbey Road Studios",
"recordingDate": "2024-01-15",
"alternativeTitles": [
"Alt Title 1",
"Alt Title 2"
],
"chartPositions": [
{
"chart": "Billboard Hot 100",
"position": 10,
"date": "2024-01-01"
}
],
"reviews": [
{
"reviewer": "Music Magazine",
"rating": 4.5,
"text": "Great track!"
}
],
"awards": [
{
"name": "Best Electronic Song",
"year": 2024
}
],
"socialMediaHandles": {
"twitter": "@artistname",
"instagram": "@artistname"
},
"language": "en",
"mood": [
"Energetic",
"Uplifting"
],
"tempo": 128,
"key": "C Major",
"productionYear": 2024,
"createdAt": "2026-01-15T02:52:25.458Z",
"updatedAt": "2026-01-15T03:48:31.763Z",
"Artists": [
{
"id": "e0dc6000-af34-4071-8a85-dcadace05c36",
"artistName": "nedJamez",
"type": "primary"
}
],
"Products": []
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Code Examples
const response = await fetch('https://api.royalti.io/asset/example-id/media', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/asset/example-id/media',
headers={
'Authorization': f'Bearer {token}'
},
json={}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/asset/example-id/media \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
Asset ID
Body
multipart/form-data
⌘I