Replace property allocations and re-evaluate the invoice (ANALYST+)
const url = 'https://api.invogi.com/v1/property-management/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/context';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"allocations":[{"operating_context_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","spend_commitment_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","is_primary":true,"allocation_amount":"example","service_period_start":"2026-04-15","service_period_end":"2026-04-15","work_order_reference":"example","recovery_treatment":"RECOVERABLE"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.invogi.com/v1/property-management/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/context \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "allocations": [ { "operating_context_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "spend_commitment_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "is_primary": true, "allocation_amount": "example", "service_period_start": "2026-04-15", "service_period_end": "2026-04-15", "work_order_reference": "example", "recovery_treatment": "RECOVERABLE" } ] }'Exactly one allocation must be primary when the list is non-empty. A multi-property split requires a positive-magnitude amount for every allocation, and the amounts must equal the absolute invoice gross. Positive allocation magnitudes on supplier credits reduce commitment usage. Every allocation is evaluated independently. ACTIVE profiles append an auditable analysis decision; SHADOW profiles return preview findings without changing the decision. An identical commitment-free replacement is an explicit no-op when its invoice, policy, and profile inputs are also current; it returns unchanged: true without appending an analysis run or dispatching webhooks. Allocations with commitments always re-check live usage and status; saving also queues peer invoices on every commitment left or joined. Clearing a commitment mismatch or overrun needs an Admin or Owner (403), and a change that would clear a CONFIRMED finding is refused (409). On a bill the ledger reported as settled at import, the allocation is stored and decides nothing until the invoice is corrected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Responses
Section titled “Responses”Context saved and evaluation returned
object
object
object
object
object
object
object
object
object
Example
{ "status": "SHADOW", "previewFindings": [ { "type": "EXACT_DUPLICATE", "severity": "INFO", "policyAction": "REVIEW" } ], "unchanged": true}Invalid request
API key lacks required scope/role
Resource not found
Conflicting idempotency key or resource processing state