Home / Help centre / Reports & exports
Reports & exports
How do I download a scan report through the API?
Call GET /api/scans/:id/report.pdf with your Bearer API token and add a mode of open, all or fixed-only to choose what the PDF holds. This route returns a file, not JSON, and it needs the scan:read_report permission. Save the response body as a PDF.
Steps
- Get a personal API token. An admin issues it from Administration → Users. The token carries its owner's permissions.
- Find the scan ID.
GET /api/scanslists recent scans, newest first, and needsscan:read. - Pick a mode, either
open,allorfixed-only, and remember that the table below maps each one to a menu option you may already know. - Send
GET /api/scans/<scan-id>/report.pdf?mode=allfrom any HTTP client. Add the headerAuthorization: Bearer <your-token>. Use your Cyberlop address as the host. - Write the response body to disk using a name that ends in
.pdf.
Good to know
| mode value | Same as this menu option |
|---|---|
| open | Open issues only |
| all | Include fixed & accepted |
| fixed-only | Fixed issues only |
The API Reference page in the app lists every route with its permission, and its filter box lets you type report to find this one quickly. Look for the word "file" beside the path, which marks a route that returns a document, not JSON. Always pass the mode yourself so the result never surprises you.
Authentication is by session cookie or Bearer API token, and for scripts the token is the better choice. A role without scan:read_report cannot fetch the PDF, even if the same role is allowed to list scans.
Treat the token like a password. Store it in your pipeline secret store and never paste it into a ticket or a chat.
This pairs well with CI. A pipeline step can launch a scan, wait for the result and then fetch the report. See how to authenticate API requests and the API reference tutorial. If a call fails, contact us.
Related questions
- How do I authenticate requests to the Cyberlop API?
- How do I get a personal API token?
- How do I find the endpoint I need and the permission it requires?
- How do I download a PDF report for a scan?
- Why does my API call return a permission error?
Cyberlop API reference: authentication, permissions and the OpenAPI spec
Step-by-step, with annotated screenshots.
Updated · Back to the help centre
Still stuck?
Tell us what you see on screen and an engineer will help you sort it out.