Manage schedule override reasons through the API
Read and replace the organization's list of reasons for overriding a schedule conflict, its default reason and the default per situation, and send a reason with an override.
A schedule write that clashes with existing work answers 409 with
requires_override: true. Send it again with override: true, an
override_reason_code and, when asked, an override_reason. The codes come
from the organization's own list at /v1/schedule/override-reasons.
Read the list
GET /v1/schedule/override-reasons needs schedule.settings.read,
schedule.settings.write, org.settings.read or org.settings.write. It
returns every reason, hidden ones included, in the order people see them:
{
"version": 3,
"customized": true,
"reasons": [
{"code": "scheduling_change", "label": "Fixing a schedule mistake", "builtin": true,
"nova_label": "Scheduling correction", "hidden": false, "requires_note": false,
"note_required_by_nova": false},
{"code": "custom_4f1c2a9b7d3e", "label": "Crew swap approved", "builtin": false,
"nova_label": null, "hidden": false, "requires_note": true, "note_required_by_nova": false}
],
"default_code": null,
"situations": [
{"key": "move", "label": "Moving or changing", "default_code": "scheduling_change",
"effective_default_code": "scheduling_change", "nova_default_code": "scheduling_change",
"description": "Moving, resizing, rescheduling or reassigning something that is already on the Schedule."},
{"key": "create", "label": "Adding", "default_code": null, "effective_default_code": null,
"nova_default_code": null, "description": "Adding something new to the Schedule."}
],
"max_reasons": 40,
"max_label_length": 80
}
A code never changes meaning. Nova's six codes (customer_request,
emergency_dispatch, resource_substitution, availability_exception,
scheduling_change, other) always exist. An organization that never saved
the list has version: 0 and Nova's list.
Replace the list
PUT /v1/schedule/override-reasons needs schedule.settings.write or
org.settings.write. Send the whole list in order with the version you read
as expected_version:
{
"expected_version": 3,
"reasons": [
{"code": "scheduling_change", "label": "Fixing a schedule mistake", "hidden": false, "requires_note": false},
{"code": null, "label": "Weather delay", "hidden": false, "requires_note": false}
],
"default_code": null,
"situation_defaults": {"move": "scheduling_change", "create": null}
}
The real request lists every reason; the example is shortened. A new reason
takes code: null (or a custom_ code you mint) and the response names its
code. In situation_defaults, null means "use default_code". The answer
is the list as saved, with version one higher.
Refusals, each a 422 with the code shown, save nothing:
override_reason_builtin_missing (one of Nova's reasons was left out),
override_reason_removed (one of your saved reasons was left out: hide it
instead), override_reasons_all_hidden, override_reason_default_hidden,
override_reason_default_unknown, override_reason_label_duplicate,
override_reason_label_required, override_reason_unknown. A stale
expected_version answers 409 override_reasons_changed.
Send a reason with an override
POST /v1/governance/reasons/requirements:resolve with
{"action_keys": ["schedule.conflict.override"]} returns the reasons on offer
(reason_options, hidden ones left out), default_reason_code and
situation_default_codes, plus how much the caller must give
(capture_level). A hidden or unknown override_reason_code answers 422
reason_category_invalid with the current options in details; nothing is
changed. The audit event of an accepted override records reason_code and
the reason_label it had at that moment.
Preview a move
POST /api/schedule/items/{entry_uid}/preflight checks the proposed time or
assignee and leaves the Schedule item where it is. Omit the times to preview
an assignment change at the item's current time. For a machine credential,
Nova applies the same working hours, daily action limit, and approval policy
for schedule.edit as it does to other POST requests. These checks can hold
the preview even when the item would fit the proposed slot.