HTTP API

Download Generated Reports

HTTP API to download a generated document using its renderId

Download the generated report

/render/{renderId}

Download a generated document using a unique renderId. This renderId is obtained from a successful call to the POST /render/{templateId-or-versionId} endpoint. The retrieved document is provided as a file stream, which can be directly downloaded or viewed.

The command downloads the generated report into the file "FILENAME.pdf".

If an error occurs (status 4XX or 5XX), the error is also saved into the file. Each renderId can be downloaded only one time.

curl  --location --request GET 'https://api.carbone.io/render/{renderId}' \
      --header 'carbone-version: 5' \
      --output 'FILENAME.pdf'

Response header

The Content-Disposition can be changed to attachment; if the query parameter ?download=true is added when calling the endpoint. The Authorization and Carbone-Version headers are not required for this API endpoint.

{
  // mime-type
  "Content-Type"         : "application/pdf",
  // Content-disposition with filename
  "Content-Disposition"  : "inline; filename="url-encoded-report-name.docx""
}

Response body

The document is deleted immediately after retrieval, ensuring privacy and reducing server storage usage. Subsequent calls with the same renderId will result in a 404 error, as the document is no longer available.

On success, the file is returned.
On error, a JSON is returned with details of the problem.

Status Code Body
200 File stream
400 { "success" : false, "error" : "Invalid renderId"}
404 { "success" : false, "error" : "File not found"}