Skip to main content
POST
/
sources
/
admin
Create Royalty Source (Admin)
curl --request POST \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/sources/admin \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Spotify",
  "label": "Spotify",
  "startDate": "2020-01-01",
  "endDate": "2025-01-01",
  "dataQuery": "SELECT * FROM ...",
  "fileNameFormat": "royalty_{date}.csv",
  "schema": {},
  "delimiter": ",",
  "type": "DSP",
  "tableNameFormat": "royalty_{tenant}",
  "format": "csv",
  "headerRows": 1,
  "public": true
}'
{
  "id": "src-3",
  "name": "Spotify",
  "label": "Spotify",
  "type": "DSP",
  "format": "csv",
  "public": true
}
Creates a new royalty source record available globally.

Required Permissions

  • sources:admin:create

Authentication

This endpoint requires authentication. Include your bearer token in the Authorization header.

Request Body

Request Schema

FieldTypeRequiredDescription
namestringāœ…
labelstringāœ…
startDatestringāŒ
endDatestringāŒ
dataQuerystringāŒ
fileNameFormatstringāŒ
schemaobjectāŒ
delimiterstringāŒ
typestringāœ…
tableNameFormatstringāŒ
formatstringāœ…
headerRowsintegerāŒ
publicbooleanāŒ

Responses

āœ… 201 - Royalty source created successfully

āš ļø 400 - undefined

āš ļø 401 - undefined

āŒ 500 - undefined

Tags

Sources

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required
Example:

"Spotify"

label
string
required
Example:

"Spotify"

type
string
required
Example:

"DSP"

format
string
required
Example:

"csv"

startDate
string<date>
Example:

"2020-01-01"

endDate
string<date>
Example:

"2025-01-01"

dataQuery
string | null
Example:

"SELECT * FROM ..."

fileNameFormat
string | null
Example:

"royalty_{date}.csv"

schema
object | null
Example:
{}
delimiter
string | null
Example:

","

tableNameFormat
string | null
Example:

"royalty_{tenant}"

headerRows
integer | null
Example:

1

public
boolean
Example:

true

Response

Royalty source created successfully

id
string
Example:

"src-1"

name
string
Example:

"Spotify"

label
string
Example:

"Spotify"

type
string
Example:

"DSP"

format
string
Example:

"csv"

public
boolean
Example:

true

startDate
string<date>
Example:

"2020-01-01"

endDate
string<date>
Example:

"2025-01-01"

dataQuery
string | null
Example:

"SELECT * FROM ..."

fileNameFormat
string | null
Example:

"royalty_{date}.csv"

schema
object | null
Example:
{}
delimiter
string | null
Example:

","

tableNameFormat
string | null
Example:

"royalty_{tenant}"

headerRows
integer | null
Example:

1

⌘I