Skip to main content
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": "Spotify UK",
  "label": "Spotify UK",
  "type": "DSP",
  "format": "csv",
  "public": true,
  "isActive": true,
  "startDate": "2021-01-01",
  "endDate": "2025-12-31",
  "dataQuery": {},
  "fileNameFormat": "<string>",
  "schema": "<string>",
  "delimiter": "<string>",
  "tableNameFormat": "<string>",
  "headerRows": 123
}
'
{
  "message": "RoyaltySource updated successfully"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

Required Permissions

  • sources:admin:update

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": "Spotify UK",
    "label": "Spotify UK",
    "type": "DSP",
    "format": "csv",
    "public": true,
    "isActive": true,
    "startDate": "2021-01-01",
    "endDate": "2025-12-31",
    "dataQuery": {},
    "fileNameFormat": "sample-fileNameFormat",
    "schema": "sample-schema",
    "delimiter": "sample-delimiter",
    "tableNameFormat": "sample-tableNameFormat",
    "headerRows": 1
  })
});

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

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Royalty source ID

Example:

"src-1"

Body

application/json
name
string
Example:

"Spotify UK"

label
string
Example:

"Spotify UK"

type
string
Example:

"DSP"

format
string
Example:

"csv"

public
boolean

Make source publicly available

Example:

true

isActive
boolean

Mark source as active/inactive

Example:

true

startDate
string<date> | null
Example:

"2021-01-01"

endDate
string<date> | null
Example:

"2025-12-31"

dataQuery
object

JSONB query configuration

fileNameFormat
string | null
schema
string | null

Text representation of schema

delimiter
string | null
tableNameFormat
string | null
headerRows
integer | null

Response

Royalty source updated successfully

message
string
Example:

"RoyaltySource updated successfully"