Skip to main content
PUT
/
sources
/
{id}
Update Tenant Source by RoyaltySource ID
curl --request PUT \
  --url https://api.royalti.io/sources/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "settings": {
    "delimiter": ","
  },
  "replacements": {
    "old": "new"
  }
}
'
{
  "TenantId": 1,
  "RoyaltySourceId": "src-1",
  "isActive": true,
  "settings": {
    "delimiter": ","
  },
  "replacements": {
    "old": "new"
  },
  "royaltySource": {
    "id": "src-1",
    "name": "spotify",
    "label": "Spotify"
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

Required Permissions

  • sources:update

Important: ID Parameter

The id parameter represents the RoyaltySource ID, not the TenantSource association ID. This endpoint updates the tenant’s source association WHERE RoyaltySourceId = id AND TenantId = authenticated_tenant.

Business Rules

  • Can only update own tenant’s associations
  • Updates only settings and replacements fields

Side Effects

  • Triggers regeneration of tenant’s sales data query cache
  • Updates tenant-specific BigQuery query configurations

Code Examples

const response = await fetch('https://api.royalti.io/sources/example-id', {
  method: 'PUT',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "settings": {
      "delimiter": ","
    },
    "replacements": {
      "old": "new"
    }
  })
});

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

RoyaltySource ID (not TenantSource ID)

Example:

"src-1"

Body

application/json
settings
object

Tenant-specific settings for this source

Example:
{ "delimiter": "," }
replacements
object

Field mapping/replacement rules

Example:
{ "old": "new" }

Response

Tenant source updated successfully

Association between a tenant and a royalty source. Note: The composite key is (TenantId, RoyaltySourceId).

TenantId
integer

Tenant ID (automatically set from authenticated user)

Example:

1

RoyaltySourceId
string

Royalty source ID

Example:

"src-1"

isActive
boolean
default:true

Whether this source association is active for the tenant

Example:

true

settings
object

Tenant-specific settings for this source

Example:
{}
replacements
object

Tenant-specific field replacements/mappings

Example:
{}
royaltySource
object