---
title: "Terminate Schedule Early"
method: POST
path: "/extensions/roboledger/{graph_id}/operations/terminate-schedule"
tags: ["RoboLedger: Fiscal Close"]
---

# Terminate Schedule Early

`POST /extensions/roboledger/{graph_id}/operations/terminate-schedule`

## Request

- Base URL: `https://api.robosystems.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/terminate-schedule`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

End a schedule early at a month-end cutoff without booking any entry. In one transaction: deletes forward facts past the cutoff (refusing when posted entries exist past it; stale drafts past it are deleted), voids the remaining obligation chain past the cutoff (pending and classified rows), and rewrites the SumEquals rule to prove the truncated curve. History at or before the cutoff is untouched, so open months the schedule still covers close normally. Use this when the termination's GL effect is already booked (an asset transferred via a manual entry, a prepaid refunded in the source system) or none is wanted; when the derecognition entry still needs to be booked, use create-event-block(event_type='asset_disposed') instead — the disposal handler posts it atomically with the same obligation void. Run BEFORE promote-obligations at close so terminated periods are never drafted.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

## Path parameters

- `graph_id` string, required

## Headers

- `Idempotency-Key` string, nullable

## Request body

- TerminateScheduleRequest: End a schedule early at a month-end cutoff — no entry is booked. The no-entry half of schedule retirement, for terminations whose GL effect is already booked (an asset transferred via a manual journal entry, a prepaid refunded in the source system) or where none is wanted. In one transaction: deletes forward facts past the cutoff, voids the remaining obligation chain past it (pending and classified rows), and rewrites the SumEquals rule to prove the truncated curve. History at or before the cutoff is untouched. When the derecognition entry still needs to be booked, use `create-event-block(event_type='asset_disposed')` instead — the disposal handler posts it atomically with the same obligation void.
  - `structure_id` string, required: The schedule structure to terminate.
  - `new_end_date` string, date, required: Last date the schedule covers — must be the last day of a month (schedule facts are whole-month). Facts and obligations for periods starting after this date are removed/voided.
  - `reason` string, required: Why the schedule is ending early — captured in the audit log.

## Response `200`

Successful Response

- OperationEnvelopeTerminateScheduleResponse
  - `operation` string, required: Kebab-case operation name
  - `operationId` string, required: op_-prefixed ULID for audit and SSE correlation
  - `status` 'completed' | 'pending' | 'failed', required: Operation lifecycle state
  - `result` TerminateScheduleResponse
    - `structure_id` string, required
    - `name` string, required
    - `new_end_date` string, date, required
    - `facts_deleted` integer, required
    - `obligations_voided` integer, required
    - `rule_updated` boolean, required
    - `reason` string, required
  - `at` string, required: ISO-8601 UTC timestamp
  - `createdBy` string, nullable: User ID that initiated the operation
  - `idempotentReplay` boolean: True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.

## Other responses

- `400`: Invalid request
- `401`: Authentication required
- `403`: Access denied
- `404`: Resource not found
- `409`: Idempotency-Key conflict — key reused with different body
- `422`: Validation error
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/robosystems/apis/robosystems-api.md) · [All operations](https://skmtc.dev/robosystems/apis/robosystems-api/llms.txt) · [OpenAPI document](https://skmtc.dev/robosystems/apis/robosystems-api/revisions/e661e2d5ca6a?raw)
