Assistant

Apply a pcf_import, document_rows, pcf_lines, pcf_save or net_zero_target proposal

net_zero_target (requires org.edit_dashboard, not org.write_data) saves the card's draft as the active net-zero target set through the SBTi engine; a draft that no longer passes (the baseline moved) is refused with 400 VALIDATION_ERROR and error.details.failures, as POST /net-zero/target-sets. For the kinds whose data lives server side; widgets and report are applied by the frontend and reported with POST /assistant/proposals/{proposalId}. Each apply is gated by the proposal's workflow step (409 WORKFLOW_STEP with the workflow summary when out of order) and a repeated apply of an applied proposal answers 200 without doing anything again. document_rows, pcf_lines and pcf_save require seenVersion, the version of the record the card the user confirmed showed (documentRows.analysisVersionId, pcfLines.importVersionId, pcfSave.footprintVersion). When it is missing or is not the record's current version nothing is applied and the answer is 409 CARD_REFRESHED with the current card. pcf_import enqueues a bom_import job and answers at once with jobId; productId in the body targets an existing, non-archived product of the organization ("Add to X" on a duplicate card). document_rows submits the ready rows through the review page's submit. pcf_lines applies the import, previews the footprint and returns parts (a pcf part and a pcf_save card, also appended to the thread). pcf_save saves the calculation in the same transaction as the workflow step. The pcf_import details below still apply. Re-checks org.write_data; the proposal must be the caller's and pending, and the upload the organization's. For a new product (or when product overrides are sent, which is how "create a new product instead" of a suggested duplicate is chosen) it creates the product with source upload, then a BOM import that reads and matches the file (synchronous, about 10-90 s) with the instructions the user gave in chat. The import is not applied: the user reviews its lines in the PCF calculator. mode (append or replace, default append) is recorded for that step. The proposal is marked applied with {productId, importId}. Afterwards the direct upload that only carried the chat attachment is deleted when it has no analysis and no submitted rows (the import keeps its own copy of the file). An extraction failure is not an error: the import exists with status error and the calculator offers to read it again.

post/assistant/proposals/{proposalId}/apply

Path parameters

proposalIdstring required

Request body

modestring

append (default) or replace; ignored for a new product

productIdstring

Import into this existing, non-archived product instead (the duplicate card's "Add to X").

seenVersionstring

The version of the record the card showed the user: documentRows.analysisVersionId, pcfLines.importVersionId or pcfSave.footprintVersion. Missing or not current answers 409 CARD_REFRESHED and applies nothing.

Response

The product and the import in review

Changes

Changed in 1 of the 5 revisions of this API.1