Skip to main content
PUT
/
source-creator
/
sessions
/
{id}
/
mappings
Step 2b — Save user-confirmed column mappings
curl --request PUT \
  --url https://api.royalti.io/source-creator/sessions/{id}/mappings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "confirmedMappings": [
    {
      "sourceColumn": "<string>",
      "semanticType": "<string>",
      "dateFormat": "<string>",
      "transformation": "<string>"
    }
  ],
  "sourceName": "my_new_dsp",
  "unmappedColumns": [
    "<string>"
  ],
  "sourceLabel": "<string>",
  "aggregatorName": "<string>"
}
'
import requests

url = "https://api.royalti.io/source-creator/sessions/{id}/mappings"

payload = {
"confirmedMappings": [
{
"sourceColumn": "<string>",
"semanticType": "<string>",
"dateFormat": "<string>",
"transformation": "<string>"
}
],
"sourceName": "my_new_dsp",
"unmappedColumns": ["<string>"],
"sourceLabel": "<string>",
"aggregatorName": "<string>"
}
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({
confirmedMappings: [
{
sourceColumn: '<string>',
semanticType: '<string>',
dateFormat: '<string>',
transformation: '<string>'
}
],
sourceName: 'my_new_dsp',
unmappedColumns: ['<string>'],
sourceLabel: '<string>',
aggregatorName: '<string>'
})
};

fetch('https://api.royalti.io/source-creator/sessions/{id}/mappings', 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/source-creator/sessions/{id}/mappings",
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([
'confirmedMappings' => [
[
'sourceColumn' => '<string>',
'semanticType' => '<string>',
'dateFormat' => '<string>',
'transformation' => '<string>'
]
],
'sourceName' => 'my_new_dsp',
'unmappedColumns' => [
'<string>'
],
'sourceLabel' => '<string>',
'aggregatorName' => '<string>'
]),
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/source-creator/sessions/{id}/mappings"

payload := strings.NewReader("{\n \"confirmedMappings\": [\n {\n \"sourceColumn\": \"<string>\",\n \"semanticType\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"transformation\": \"<string>\"\n }\n ],\n \"sourceName\": \"my_new_dsp\",\n \"unmappedColumns\": [\n \"<string>\"\n ],\n \"sourceLabel\": \"<string>\",\n \"aggregatorName\": \"<string>\"\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/source-creator/sessions/{id}/mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"confirmedMappings\": [\n {\n \"sourceColumn\": \"<string>\",\n \"semanticType\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"transformation\": \"<string>\"\n }\n ],\n \"sourceName\": \"my_new_dsp\",\n \"unmappedColumns\": [\n \"<string>\"\n ],\n \"sourceLabel\": \"<string>\",\n \"aggregatorName\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.royalti.io/source-creator/sessions/{id}/mappings")

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 \"confirmedMappings\": [\n {\n \"sourceColumn\": \"<string>\",\n \"semanticType\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"transformation\": \"<string>\"\n }\n ],\n \"sourceName\": \"my_new_dsp\",\n \"unmappedColumns\": [\n \"<string>\"\n ],\n \"sourceLabel\": \"<string>\",\n \"aggregatorName\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "message": "Mappings saved successfully",
  "data": {
    "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "mappingsCount": 123,
    "unmappedCount": 123,
    "validationIssues": [
      "<string>"
    ],
    "suggestedSourceName": "<string>"
  }
}
{
"status": "error",
"message": "<string>"
}
{
"status": "error",
"message": "This feature requires a plan upgrade",
"data": {
"feature": "royaltyAccess",
"currentPlan": "FREE",
"availablePlans": [
{}
]
}
}
{
"status": "error",
"message": "<string>"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

PUT /source-creator/sessions//mappings Description: Saves the user-confirmed column mappings, source name/label, optional aggregator name, and optional royalty type. Validates that at least ROYALTY or COUNT is mapped, warns if ISRC (or ASSET_TITLE+ASSET_ARTIST) isn’t mapped, warns if period-type columns lack a dateFormat, and — when the session has a dataClass set — checks confirmed mappings against the canonical fact-schema’s required columns. sourceName must match ^[a-zA-Z0-9_-]+$. Also fires a best-effort smart source-name suggestion after saving. Authorization:
  • Required role: admin or higher
Method: PUT

Code Examples

const response = await fetch('https://api.royalti.io/source-creator/sessions/example-id/mappings', {
  method: 'PUT',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "ref": "#/components/schemas/SaveMappingsRequest"
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.put(
  'https://api.royalti.io/source-creator/sessions/example-id/mappings',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"ref":"#/components/schemas/SaveMappingsRequest"}
)

data = response.json()
print(data)
curl -X PUT https://api.royalti.io/source-creator/sessions/example-id/mappings \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ref":"#/components/schemas/SaveMappingsRequest"}'

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Path Parameters

id
string<uuid>
required

Session ID

Body

application/json
confirmedMappings
object[]
required
sourceName
string
required

Alphanumeric, underscores, and hyphens only. Normalized as the RoyaltySource name on save.

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"my_new_dsp"

unmappedColumns
string[]
sourceLabel
string

Display label; defaults to sourceName if omitted.

aggregatorName
string | null
royaltyType
enum<string> | null

Optional per-source rights type. Case-insensitive on input; the matched canonical value (as listed) is persisted. Omit, send null, or send an empty string for "unknown" — anything else that doesn't case-insensitively match one of these values is a 400.

Available options:
Master,
Publishing,
Mechanical,
Performance,
Sync

Response

Mappings saved successfully

status
string
Example:

"success"

message
string
Example:

"Mappings saved successfully"

data
object