Skip to main content
POST
/
webhook
/
download
/
status-update
/
webhook
Download status update webhook
curl --request POST \
  --url https://api.royalti.io/webhook/download/status-update/webhook \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "d3f2c1b0-1234-5678-90ab-cdef12345678",
  "status": "done",
  "url": "https://storage.googleapis.com/downloads/export-2024-01-15.csv?signature=..."
}
'
{
  "message": "Download record status is marked as done"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

Authentication: Requires royalti-x-hash header containing HMAC signature. Workflow:
  1. Validates download record exists
  2. Updates download status and URL
  3. Sends email notification when status is ‘done’

Code Examples

const response = await fetch('https://api.royalti.io/webhook/download/status-update/webhook', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "id": "d3f2c1b0-1234-5678-90ab-cdef12345678",
    "status": "done",
    "url": "https://storage.googleapis.com/downloads/export-2024-01-15.csv?signature=..."
  })
});

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

Body

application/json
id
string<uuid>
required

Download record UUID

Example:

"d3f2c1b0-1234-5678-90ab-cdef12345678"

status
enum<string>
required

Current status of the download

Available options:
preparing,
done,
failed,
expired
Example:

"done"

url
string<uri>

Google Cloud Storage signed URL for download

Example:

"https://storage.googleapis.com/downloads/export-2024-01-15.csv?signature=..."

Response

Webhook processed successfully

message
string
Example:

"Download record status is marked as done"