The versioning API controls the lifecycle of reporting phases in PRMS. Each phase represents a discrete reporting window — identified by a year and sub-phase name — within which results can be created and submitted. Admins use these endpoints to open or close phases, create new ones, and trigger the replication process that carries results forward into the next cycle. All endpoints underDocumentation 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.
/api/versioning/* require a valid JWT in the auth header. Write operations (create, update, delete, replication) additionally require the Admin role (RoleEnum.ADMIN) scoped to the Application role type (RoleTypeEnum.APPLICATION). Requests that fail role checks return 403 Forbidden.
Phase object
A phase (stored in theversion table) has the following fields:
Auto-generated primary key (bigint).
Human-readable label for the phase, for example
"Reporting 2024".The four-digit reporting year this phase belongs to (MySQL
YEAR type).ISO date string marking when the phase opens for result submission.
ISO date string marking the submission deadline for this phase.
Whether the phase is currently open (
true) or closed (false). Closing a phase prevents new submissions.Foreign key referencing the phase that preceded this one. Used during rollover to determine which results are eligible for replication.
Links the phase to an application module:
1 = Reporting, 2 = IPSR.Self-referential FK pointing to the parent reporting phase. Sub-phases nest under a top-level reporting phase.
Identifier of the corresponding Theory of Change phase in the external ToC system.
Optional CLARISA portfolio this phase is associated with.
Endpoints
List phases
module=all, status=open, active=active.
Filter by application module. One of
all (default), reporting, ipsr.Filter by submission window status. One of
open (default), close, all.Filter by active state. One of
active (default), inactive, all.auth header). No special role needed.
List all phases (unfiltered)
Get version of a result
PRMS result ID.
Get result counts by status and type
Result status ID (for example
1 = Editing, 3 = Submitted).Result type ID matching
ResultTypeEnum (for example 1 = Policy Change, 6 = Knowledge Product).Create a phase
RoleEnum.ADMIN + RoleTypeEnum.APPLICATION enforced by ValidRoleGuard.
Request body:
Display name for the new phase.
Four-digit reporting year.
Phase open date (ISO date string).
Submission deadline (ISO date string).
Module association:
1 = Reporting, 2 = IPSR.ID of the phase that precedes this one. Required when rollover replication will be used.
ID of the parent reporting phase for sub-phase nesting.
Corresponding Theory of Change phase identifier.
CLARISA portfolio ID to associate with this phase.
Update a phase
RoleEnum.ADMIN + RoleTypeEnum.APPLICATION.
Phase ID to update.
New display name.
Set to
true to open the phase for submissions; false to close it.Update the predecessor phase reference.
Update the CLARISA portfolio association.
Delete a phase
RoleEnum.ADMIN + RoleTypeEnum.APPLICATION.
Phase ID to delete.
Process phase change for a result
entityId is supplied in the body.
ID of the result to roll over.
When provided, uses the v2 replication path (
versionProcessV2) which targets a specific IPSR entity. Omit for the standard v1 path.Replicate annual results (Reporting)
RoleEnum.ADMIN + RoleTypeEnum.APPLICATION.
Replicate annual innovation packages (IPSR)
RoleEnum.ADMIN + RoleTypeEnum.APPLICATION.
Update QA status for results
Update QA result links
URI versioning
The PRMS server enables URI-based API versioning (/v2/api/*). The apiVersionMiddleware reads the ?version= query parameter and writes req['apiVersion']. The phase-change process endpoint (PATCH /api/versioning/phase-change/process/result/:resultId) uses this to switch between the v1 and v2 replication paths based on whether entityId is present in the request body.
Result submitters must complete and submit their results before the phase
end_date. Once an admin sets status: false on a phase, the submission window closes and results can no longer be submitted for that cycle.