Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AllianceBioversityCIAT/onecgiar_pr/llms.txt

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

The Platform Report API (/api/platform-report/*) is a headless, read-only payload surface that produces per-result and IPSR report documents for platform-level consumers. Like the Bilateral API, it is excluded from JWT enforcement in PRMS and is instead protected at the infrastructure perimeter. Unlike the Bilateral API, platform-report endpoints are subject to the global rate throttle (100 requests per 60 seconds).
/api/platform-report/* endpoints do not require a JWT. Authentication and access control are enforced at the infrastructure perimeter (API Gateway / IP allowlist), not inside NestJS. Rate throttling does apply to this surface — plan for the 100 req / 60 s limit.
This surface is read-only. All writes — creating, editing, or submitting results — go through the authenticated /api/* endpoints, which require a valid auth: <JWT> header.

How platform-report differs from bilateral

The two JWT-excluded surfaces serve different consumers and different data shapes:
/api/bilateral/*/api/platform-report/*
Primary outputTyped result summary objects (JSON arrays)Per-result and IPSR PDF report documents
ConsumerBilateral funders, discovery tools, BI dashboardsPMU reporting pipelines, platform narrative generation
Rate throttlingExempt (ThrottlerExcludeBilateralGuard)Applies (100 req / 60 s global limit)
Response formatRaw JSON array{ pdf: string, fileName: string }
Phase-awareVia phase_year query paramVia phase query param
IPSR supportInline via ipsr_pathway_summary on each resultDedicated /ipsr/:code endpoint

Endpoints

All platform-report routes are mounted under /api/platform-report/.

Full result report

GET /api/platform-report/result/:code
Generates a full PDF report for a single result, identified by its public-facing result_code. Returns the rendered PDF as a base64-encoded string alongside a suggested filename. Path parameters
ParameterTypeDescription
codestringThe result’s public result_code (e.g. 28738).
Query parameters
ParameterTypeDescription
phasestringReporting phase identifier. Required for phase-scoped rendering.
downloadablebooleanWhen true, the response is optimized for direct download.
Response
{ pdf: string; fileName: string }
pdf
string
Base64-encoded PDF document for the result.
fileName
string
Suggested file name for the generated PDF.

Full IPSR report

GET /api/platform-report/ipsr/:code
Generates a full PDF report for an Innovation Package and Scaling Readiness (IPSR) result. Uses the IPSR-specific PDF template rather than the standard result template. Path parameters
ParameterTypeDescription
codestringThe result code of the innovation package result.
Query parameters
ParameterTypeDescription
phasestringReporting phase identifier for IPSR rendering.
downloadablebooleanWhen true, the response is optimized for direct download.
Response Same shape as the result report endpoint: { pdf: string, fileName: string }.

PDF template routing

The platform-report service routes PDF generation to the appropriate template based on the portfolio and result type:
PortfolioResult typeTemplate
P25Standard resultsresults_p25 (600 × 1000 px)
P25Bilateral results (non-SGP-02)results_bilaterals_p25 (600 × 1000 px)
P25Innovation package / complementary (type ids 10, 11)ipsr_p25 (600 × 1000 px)
Legacy (P22)All typesLegacy pdf.generate flow
Portfolio P25 uses the pdf.generateUrl RabbitMQ event pattern with an explicit templateName and paper dimensions. Legacy portfolios use the pdf.generate flow. The routing is automatic based on the portfolio acronym stored with the result’s reporting phase.

How PMU uses this surface

Platform-level reporting in PRMS works as follows:
  1. PMU leads access result data through the authenticated PRMS UI, which writes results through /api/results/*.
  2. For consolidated exports and narrative generation, the platform-report API generates per-result PDF views on demand.
  3. These PDFs can be embedded in platform-level dashboards or collected into narrative packages per phase.
  4. IPSR innovation packages have a dedicated endpoint (/ipsr/:code) that uses the IPSR-specific template, reflecting the four-step pathway structure (core innovation, complementary innovations, scaling readiness, investments).

Rate limits

The platform-report surface uses the global NestJS throttler:
  • Limit: 100 requests per 60 seconds (per IP / client identity as configured at the gateway).
  • Bilateral comparison: the Bilateral API (/api/bilateral/*) is fully exempt from this throttle via ThrottlerExcludeBilateralGuard; platform-report is not.
If your integration needs to generate large batches of PDFs, implement request queuing or backoff on the caller side.
Generating PDFs for many results in a tight loop will hit the throttle limit. Spread requests across time or implement a queue with backoff. The throttle is enforced per NestJS instance — API Gateway may impose additional limits.

Error responses

On failure (invalid result code, missing phase, generation error), the endpoint returns a returnErrorDto structure. Handle non-2xx HTTP status codes and check the response body for an error or message field.

Integration notes

  • Phase scoping: always supply the phase query parameter. Results in PRMS are phase-versioned; omitting the phase may return data from the wrong reporting cycle or cause an error.
  • No writes: this surface does not accept POST, PUT, or DELETE. All result data mutations go through /api/results/* with a valid auth JWT header.
  • Authentication header: because this surface is JWT-excluded, do not send an auth header. If your client sends it automatically, it is ignored but does not cause a rejection.
  • Content type: the pdf field contains a base64-encoded binary. Decode it before writing to disk or streaming to a browser download.

Build docs developers (and LLMs) love