Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cf0.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Reports API provides read and write access to the research reports generated by cf0’s Lab. Reports are identified by a report_id and scoped to your organisation. All Reports endpoints are prefixed with /api/reports.
All reports endpoints require organisation membership. Requests without a valid org_id in the token return HTTP 403.

List reports

GET /api/reports
Returns the authenticated user’s reports, paginated.

Query parameters

limit
integer
Maximum number of reports to return. Default: 50.
offset
integer
Number of reports to skip. Default: 0.

Response

reports
array
Array of report metadata objects.
count
integer
Number of reports in this response.
curl "https://api.cf0.ai/api/reports?limit=20&offset=0" \
  -H "Authorization: Bearer <your-token>"

Get report metadata

GET /api/reports/{report_id}
Returns metadata for a single report.
curl https://api.cf0.ai/api/reports/rpt_abc123 \
  -H "Authorization: Bearer <your-token>"

Get report PDF URL

GET /api/reports/{report_id}/pdf
Returns a short-lived download URL for the report PDF. The URL expires after 5 minutes.
url
string
Temporary download URL. Valid for 5 minutes.
curl https://api.cf0.ai/api/reports/rpt_abc123/pdf \
  -H "Authorization: Bearer <your-token>"
Example response:
{
  "url": "https://..."
}

Get report data

GET /api/reports/{report_id}/data
Returns the structured report content. Use this to read section content for programmatic editing. The response includes a sections array. Each section has:
title
string
Section title.
narrative
string
Section prose text.

Get reports for a thread

GET /api/reports/thread/{thread_id}
Returns all reports linked to a research thread.
reports
array
Array of report metadata objects associated with the thread.

Get version chain

GET /api/reports/lineage/{lineage_id}
Returns all versions of a report across its edit history.
versions
array
Ordered array of report versions, oldest to newest.

Edit a section

PATCH /api/reports/{report_id}/sections/{section_idx}
Edits a section’s title or narrative, recompiles the PDF, and saves the result as a new version.
Rate limit: 6 requests per minute per user.

Path parameters

report_id
string
required
The report to edit.
section_idx
integer
required
Zero-based index of the section to edit.

Request body

narrative
string
Updated prose content for the section.
title
string
Updated section title.
change_summary
string
Optional description of what changed, stored in the activity log.
At least one of narrative or title must be provided.
curl -X PATCH https://api.cf0.ai/api/reports/rpt_abc123/sections/0 \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "narrative": "Revenue grew 122% year-over-year, driven by data center demand.",
    "change_summary": "Updated revenue narrative with Q4 actuals"
  }'

Preview a section rewrite

POST /api/reports/{report_id}/sections/{section_idx}/rewrite
Uses an LLM to rewrite a section according to your instruction. Does not persist — returns the rewritten text for review before you apply it with PATCH.
Rate limit: 10 requests per minute per user.

Request body

instruction
string
required
Plain-language instruction for how to rewrite the section. Maximum 2000 characters.

Response

rewritten_narrative
string
The rewritten section text. Apply it using the section edit endpoint.
curl -X POST https://api.cf0.ai/api/reports/rpt_abc123/sections/0/rewrite \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{ "instruction": "Make it more concise and remove the forward-looking language." }'

Get activity log

GET /api/reports/{report_id}/activity
Returns the edit activity log for a report.
activity
array
Array of activity log entries, each describing a change event.

Delete report

DELETE /api/reports/{report_id}
Permanently deletes a report and all associated files (PDF, data, artifacts).
deleted
boolean
true if the report was deleted successfully.
curl -X DELETE https://api.cf0.ai/api/reports/rpt_abc123 \
  -H "Authorization: Bearer <your-token>"
Returns { "deleted": true } on success, or HTTP 404 if the report was not found.