Skip to main content
POST
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /download/generate Description: Submits a download generation request. The server validates the input, generates BigQuery queries for the requested data, creates a Download record, and queues a background job. Returns immediately with a 202 Accepted response containing the download and job identifiers. Use GET /download/{id}/status to poll for completion. Authorization:
  • Required role: user or higher
Method: POST Request Body:
  • emails (required): At least one valid email address to notify on completion
  • format: Output formats (csv, xlsx, pdf). Defaults to xlsx.
  • include: Data sheets to include (raw, aggregates, aggregator). Defaults to aggregates.
  • type: Report type (royalty, accounting, expense). Defaults to royalty.
  • saleType: Filter by sale type (e.g. Download, Stream).
  • Filter fields (artists, user, isrc, upc, country, dsp, aggregator) accept either a comma-separated string or an array of strings. Empty arrays and empty strings are ignored.

Code Examples

Authorizations

Authorization
string
header
required

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

Body

application/json
emails
string<email>[]
required

Email addresses to notify when the download is ready

Minimum array length: 1
Example:
format
enum<string>[]

Output file formats to generate

Available options:
csv,
xlsx,
pdf
Example:
include
enum<string>[]

Types of data sheets to include in the download

Available options:
raw,
aggregates,
aggregator
Example:
type
enum<string>
default:royalty

Report type to generate

Available options:
royalty,
accounting,
expense
Example:

"royalty"

periodFilterType
enum<string>

Type of period to filter by. Send empty string to omit.

Available options:
accounting,
sale,
start
string

Start date for the report period (YYYY-MM-DD). Empty string is treated as no filter.

Pattern: ^\d{4}-\d{2}-\d{2}$
Example:

"2024-01-01"

end
string

End date for the report period (YYYY-MM-DD). Empty string is treated as no filter.

Pattern: ^\d{4}-\d{2}-\d{2}$
Example:

"2024-12-31"

artists

Artist IDs to filter by. Accepts a comma-separated string or an array. Empty arrays are ignored.

Example:
user

User IDs to filter by. Accepts a comma-separated string or an array.

isrc

ISRC codes to filter by. Accepts a comma-separated string or an array.

upc

UPC codes to filter by. Accepts a comma-separated string or an array.

country

Country codes to filter by. Accepts a comma-separated string or an array.

Example:
dsp

DSP/platform names to filter by. Accepts a comma-separated string or an array.

Example:
aggregator

Aggregator/distributor names to filter by. Accepts a comma-separated string or an array.

saleType
string

Filter by sale type (e.g. Download, Stream, Ad-Supported). Empty string is ignored.

Example:

"Stream"

table_name
string

Specific BigQuery table to query. Empty string is ignored.

Response

Download request accepted

status
string
Example:

"success"

message
string
Example:

"Download request accepted and is being processed"

data
object