Skip to main content
POST
/
catalog
/
export
curl --request POST \
  --url https://api.royalti.io/catalog/export \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "template": "assets"
}
'
"<string>"
{
"status": "success",
"message": "Export request accepted and is being processed",
"data": {
"downloadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"rowEstimate": 123
}
}
{
"status": "error",
"message": "template is required"
}
{
"status": "error",
"message": "<string>",
"code": "<string>",
"details": {}
}
{
"status": "error",
"message": "Export template \"not-a-real-template\" not found"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /catalog/export Description: Resolves template from the registry, validates options against that template’s own schema, and either:
  • streams the rendered file directly (row estimate ≤ 5000, the common case for most tenants) with a Content-Disposition attachment header, or
  • creates a Download record and queues an async render job, responding 202 with a downloadId to poll via the existing GET /download/{id}/status endpoint (row estimate > 5000).
Catalog exports share the Download model with royalty/accounting reports (type: report, tagged metadata.exportKind: catalog), so they also appear in GET /download/list. Authorization:
  • Required role: admin or higher
Method: POST

Code Examples

const response = await fetch('https://api.royalti.io/catalog/export', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "ref": "#/components/schemas/CatalogExportRequest"
  })
});

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

response = requests.post(
  'https://api.royalti.io/catalog/export',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"ref":"#/components/schemas/CatalogExportRequest"}
)

data = response.json()
print(data)
curl -X POST https://api.royalti.io/catalog/export \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ref":"#/components/schemas/CatalogExportRequest"}'

Authorizations

Authorization
string
header
required

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

Body

application/json
template
string
required

Registered export template id (see GET /catalog/export/templates)

Example:

"assets"

options
object

Per-template options — unknown/irrelevant keys are ignored by the resolved template's own options schema.

Response

Rendered file streamed synchronously (row estimate at or below the sync threshold)

The response is of type file.