Executes a user-supplied SQL SELECT query and exports the result as a downloadable file in the requested format (PDF or CSV). This does not require a previously saved report — the SQL query and report name are provided directly in the request body.
post /dcapi/reports/queryReports/export
https://{server-hostname}:8383/dcapi/reports/queryReports/export
QueryReport.CREATECopied!
Authorization: d92d4xxxxxxxxxxxxx15f52
Name for the exported report file. Used as the download file name. Allows word characters, hyphens, spaces, and non-Basic-Latin Unicode characters. Min 1, max 100 characters
SQL SELECT query to execute for export. Only SELECT statements are allowed; DML, DDL, system catalog access (pg_, sys.), and injection patterns (xp_cmdshell, EXEC, WAITFOR, sp_) are blocked. Max 500,000 characters
curl --request POST \
--url https://appdomain/dcapi/reports/queryReports/export \
--header 'Accept: application/octet-stream' \
--header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \
--header 'Content-Type: application/queryReport.v1+json' \
--data '{"reportName":"All Technician report","query":"select * from Table"}'Export a SELECT query result on the given table as a downloadable file
{
"reportName": "All Technician report",
"query": "select * from Table"
}
Error code for invalid export request. INVALID_QUERY = the SQL query is syntactically invalid, fails construction, or the requested export format is not supported (only pdf and csv are allowed)
Human-readable message describing why the export request failed. Examples: Un-Supported format, Invalid query syntax
Error code for server-side failure. INTERNAL_ERROR = an unexpected error occurred during query execution or file generation (e.g., SQLException)
Human-readable message describing the internal server error encountered during the ad-hoc export process
200 OKExport format is not pdf or csv
{
"errorMessage": "Un-Supported format",
"errorCode": "INVALID_QUERY"
}
SQL query is syntactically invalid or fails construction
{
"errorMessage": "Invalid query syntax or unsupported statement",
"errorCode": "INVALID_QUERY"
}
Unexpected error during query execution or file generation
{
"errorMessage": "An internal server error occurred while exporting the query report",
"errorCode": "INTERNAL_ERROR"
}
![]()
Duration: 1 minute | Threshold: 30 | Lock period: 5 minutes
Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.
© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.
© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.