Generate a data download
POST /download/generate
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. UseGET /download/{id}/status to poll for completion.
Authorization:
- Required role:
useror higher
emails(required): At least one valid email address to notify on completionformat: 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
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
Email addresses to notify when the download is ready
1Output file formats to generate
csv, xlsx, pdf Types of data sheets to include in the download
raw, aggregates, aggregator Report type to generate
royalty, accounting, expense "royalty"
Type of period to filter by. Send empty string to omit.
accounting, sale, Start date for the report period (YYYY-MM-DD). Empty string is treated as no filter.
^\d{4}-\d{2}-\d{2}$"2024-01-01"
End date for the report period (YYYY-MM-DD). Empty string is treated as no filter.
^\d{4}-\d{2}-\d{2}$"2024-12-31"
Artist IDs to filter by. Accepts a comma-separated string or an array. Empty arrays are ignored.
User IDs to filter by. Accepts a comma-separated string or an array.
ISRC codes to filter by. Accepts a comma-separated string or an array.
UPC codes to filter by. Accepts a comma-separated string or an array.
Country codes to filter by. Accepts a comma-separated string or an array.
DSP/platform names to filter by. Accepts a comma-separated string or an array.
Aggregator/distributor names to filter by. Accepts a comma-separated string or an array.
Filter by sale type (e.g. Download, Stream, Ad-Supported). Empty string is ignored.
"Stream"
Specific BigQuery table to query. Empty string is ignored.