Handle Compare To

​

Δ and Impact for one page of the Contracts table.

The client sends the row ids it already holds and gets back the movement over the selected timeframe. These values are computed per request from two points in time, so the Δ columns cannot be sorted on the server.

A contract deleted between the page load and this call is omitted rather than reported as empty. A contract with no recorded financials at or before the period start is returned with existed=False, which Impact distinguishes from having been worth nothing.

Body·

required
application/json

A Compare to request for one page of the Contracts table.

The client sends the row ids of the page it already holds and gets back only the movement on those rows.

  • Contract IDs to compare, normally the current page. Capped so one request cannot fan out across a whole tenant.

  • Comparison timeframe. MTD, QTD and YTD follow the account's fiscal calendar; last30Days and last12Months are counted back from today.

    values
    last30Daysmtdqtdytdlast12Monthscustom
  • Start date, required when period is 'custom' and ignored otherwise

Responses

  • application/json
  • application/json
Request Example for post/compare
curl https://crm.dreamhub.ai/api/v1/contracts/compare \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "contractIds": [
    ""
  ],
  "period": "last30Days",
  "customStart": "2026-11-23"
}'
{
  "period": "string",
  "periodStart": "2026-11-23T03:49:24.991Z",
  "contracts": [
    {
      "contractId": "string",
      "existed": true,
      "previousCapturedAt": "2026-11-23T03:49:24.991Z",
      "currency": "string",
      "previousCurrency": "string",
      "metrics": {
        "additionalProperty": {
          "previous": 1,
          "current": 1,
          "delta": 1,
          "impact": "new"
        }
      }
    }
  ]
}