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
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://server26-dot-royalti-project.uc.r.appspot.com/sources/admin', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "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
  })
});

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

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