Changes, corrections and rescinds
Every write to a dated field is one of three things. Pick the one that matches what happened in the real world:
| Mode | Use it when | What it does |
|---|---|---|
change (the default) |
Something new happens from a date: a raise, a transfer, a leaver. | Adds a version from that date. The version before it ends the day before. |
correction |
A value that was recorded is wrong. | Replaces the values of the version in force on a date, for that version’s whole period. Or moves a version to a new start date. |
rescind |
A change should never have happened, for example a transfer that was cancelled. | Removes the version. The version before it runs on until the next one. |
You send the mode with the values, in an effective object. The examples on this page use the API. The same calls exist as MCP tools and CLI commands: see As-of parameters.
A change from a date
Section titled “A change from a date”Send the new values and the date they apply from:
curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":90000},"effective":{"from":"2027-01-01","reason":"merit"}}'{ "record": { "name": "Priya Raman", "salary": 84000, "pay_grade": "P3", "…": "…" }, "effective": [ { "group": "comp", "mode": "change", "version": { "id": "a69587f4-91a8-4de5-bf38-d650137a66c1", "from": "2027-01-01", "to": "infinity", "seq": 0, "status": "scheduled" }, "propagated": [], "warnings": [], "periods": [{ "from": "2027-01-01", "to": "infinity", "fields": ["salary"] }], "past": false } ]}record always shows today’s values, so the salary is still 84,000. effective lists one entry per group the write touched: the new version, its status, and the periods whose values changed.
Future dates: scheduled, then applied on the day
Section titled “Future dates: scheduled, then applied on the day”A change dated after today has the status scheduled. Ligament stores it at once and applies it from midnight on its date, in your workspace’s time zone. Nobody has to come back and make the change on the day.
- Reads with an
asOfdate are exact from midnight, because they read the versions directly. - Reads without
asOfshow today’s stored values. These catch up with a scheduled change within about a minute of midnight.
Writes with no date
Section titled “Writes with no date”A write to a dated field without effective is a change from today. That’s how forms, imports and older integrations keep working on a dated entity. Only the dated values that actually differ from today’s are recorded.
You can send the values at the top level ({"salary": 95000}) or inside values ({"values": {"salary": 95000}}); both are the same change from today. Don’t mix the two: values next to other fields is refused, because it isn’t clear which values you meant:
{ "error": "Send the field values either at the top level or inside \"values\", not both.", "code": "effective_values_envelope", "path": "values", "message": "Send the field values either at the top level or inside \"values\", not both.", "fix": "Use { \"values\": { \"salary\": 66000 }, \"effective\": { \"from\": \"2027-03-01\", \"reason\": \"merit\" } } for a dated change, or { \"salary\": 66000 } for a change from today."}If the group requires an effective date, a write without one is refused:
{ "code": "effective_date_required", "path": "effective.from", "message": "Pay changes need an effective date", "fix": "Send effective.from (YYYY-MM-DD)."}New records
Section titled “New records”When you create a record, effective.from is the date it starts. Before that date the record isn’t in as-of lists or reports, so someone hired from 4 January doesn’t count in December’s headcount. Without effective.from the record starts today.
A change in the past
Section titled “A change in the past”A change can also be back-dated. If it changes today’s value, record shows the new value straight away. Back-dating has limits:
- Each group says how far back a change may reach. Beyond that, you need the
effective.retrocapability (owners and admins have it). Without it, the write fails witheffective_backdate_needs_capability. - A change into a locked period needs
effective.retroand a reason.
When a change rewrites later ones
Section titled “When a change rewrites later ones”A change applies from its date until the next version that sets the same field. If a later version didn’t set that field, it now carries the new value too, and the response warns you.
In this example a raise to 90,000 was already scheduled for 1 January. Then a promotion to grade P4 from 1 September is recorded:
{ "group": "comp", "mode": "change", "version": { "from": "2026-09-01", "to": "2027-01-01", "status": "in_force" }, "propagated": [{ "from": "2027-01-01", "fields": ["pay_grade"] }], "warnings": ["The change of 2027-01-01 now carries pay_grade from this one."], "periods": [ { "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary", "pay_grade"] }, { "from": "2027-01-01", "to": "infinity", "fields": ["pay_grade"] } ], "past": true, "retroPeriod": ["2026-09-01", "2026-12-02"]}The 1 January raise still sets the salary to 90,000, but it now carries grade P4 instead of P3. The salary didn’t move forward, because the 1 January version set the salary itself.
past is true when the change touched a date before today, and retroPeriod gives the part of the change that lies in the past.
Two changes on the same day
Section titled “Two changes on the same day”A second change to the same group on the same date applies after the first, and you get a warning:
"warnings": ["Another job change already starts on 2027-02-01: this one applies after it."]Both stay in the history. The earlier one shows the status same_day.
A correction
Section titled “A correction”A correction fixes a version’s values for its whole period, without adding a new change. Name the date the wrong version was in force on, and give a reason:
curl -s -X PATCH "https://app.ligament.ai/api/records/employee/cmx6ai0dx007r6x6stm9adjh5" \ -H "authorization: Bearer $LIGAMENT_API_KEY" -H 'content-type: application/json' \ -d '{"values":{"salary":88000},"effective":{"from":"2026-09-01","mode":"correction","reason":"Promotion salary keyed as 86,000; the offer letter says 88,000"}}'{ "group": "comp", "mode": "correction", "version": { "from": "2026-09-01", "to": "2027-01-01", "seq": 0, "status": "in_force" }, "warnings": [], "periods": [{ "from": "2026-09-01", "to": "2027-01-01", "fields": ["salary"] }], "past": true}The version from 1 September now holds 88,000. The wrong value isn’t deleted: the history keeps it as a superseded version, and people with records.as_recorded can still read what was recorded before the fix (see Reading as of a date).
Like a change, a correction carries forward into later versions that didn’t set the same field.
Correction or new change
Section titled “Correction or new change”Ask whether the old value was ever true.
- The salary really was 86,000 until it went up: that’s a new change from the date it went up. The history then shows both values, each for its own period.
- The salary was always meant to be 88,000 and someone typed it wrong: that’s a correction. Reports for the past now show 88,000, and the history marks the fix.
Moving a version to another date
Section titled “Moving a version to another date”To move a version’s start date, send mode: correction with the version’s id (from the record’s history) and the new from:
{ "effective": { "mode": "correction", "version": "41aad206-135e-48b0-9c4f-b7292fc5e8a8", "from": "2027-03-01", "reason": "Adjustment moved to the March pay cycle" } }{ "group": "comp", "mode": "correction", "version": { "from": "2027-03-01", "to": "infinity", "status": "scheduled" }, "periods": [{ "from": "2027-02-01", "to": "2027-03-01", "fields": ["salary"] }]}periods shows that February’s salary changed: it now keeps the value from before the adjustment. A version can’t be moved past the next version of its group, or onto a day that already has another change (effective_retime_conflict).
A rescind
Section titled “A rescind”A rescind removes a version. Name it by id (version) or by a date it’s in force on (from plus group), and give a reason:
{ "effective": { "mode": "rescind", "from": "2027-02-01", "group": "job", "reason": "Transfer to Engineering cancelled" } }{ "group": "job", "mode": "rescind", "version": null, "rescinded": { "id": "b48894f9-7add-4e24-b27d-a5b9f2dfcc92", "from": "2027-02-01", "to": "infinity" }, "periods": [{ "from": "2027-02-01", "to": "infinity", "fields": ["location"] }]}The version before it now runs on. If the date has several changes, a rescind by date removes the last one of that day, so repeat it to remove the others. Later versions that inherited values from the rescinded one get the earlier values back.
The first version of a record can’t be rescinded (effective_rescind_first): correct it instead.
Reasons
Section titled “Reasons”Each group can list the reasons it accepts, for example hire, merit, promotion and market_adjustment for pay. correction is always accepted.
- Corrections and rescinds always need a reason. It can be any text, such as “Typo in promotion salary”.
- A change needs a reason if the group requires one, and it must be one of the group’s reasons:
{ "code": "effective_reason", "path": "effective.reason", "message": "\"bonus\" isn't a Pay reason: hire, merit, promotion, market_adjustment, correction", "details": { "reasons": ["hire", "merit", "promotion", "market_adjustment", "correction"] }}The reason is stored on the version and shown in the history.
Several records in one change
Section titled “Several records in one change”Some events change several records at once, such as a team moving office. Send them together to POST /api/records/batch: either every item is written or none is.
{ "items": [ { "entity": "employee", "id": "cmx6ai5om007w6x6s2p6fuefi", "values": { "location": "Chiang Mai" }, "effective": { "from": "2027-03-01", "reason": "transfer" } }, { "entity": "employee", "id": "cmx6ai0dx007r6x6stm9adjh5", "values": { "location": "Chiang Mai" }, "effective": { "from": "2027-03-01", "reason": "transfer" } } ]}A batch takes only dated fields. Write other fields with a normal update (effective_batch_plain otherwise). A batch holds up to 200 items.
Errors you may see
Section titled “Errors you may see”| Code | Meaning |
|---|---|
effective_reason_required |
The change needs a reason (always for corrections and rescinds). |
effective_reason |
The reason isn’t one of the group’s reasons. |
effective_date_required |
The group requires effective.from. |
effective_future_too_far |
The date is further ahead than the group allows (730 days unless set otherwise). |
effective_backdate_needs_capability |
The change reaches further back than the group allows without effective.retro. |
effective_locked |
The change touches a locked period. |
effective_no_version |
Nothing is in force on that date: the record starts later. |
effective_rescind_first |
The first version can’t be rescinded. |
effective_conflict (409) |
The version you named changed in the meantime. Reload the history and try again. |
The full list, with status codes, is on As-of parameters.