---
title: "Rebuild Schedule In Place"
method: POST
path: "/extensions/roboledger/{graph_id}/operations/rebuild-schedule"
tags: ["RoboLedger: Fiscal Close"]
---

# Rebuild Schedule In Place

`POST /extensions/roboledger/{graph_id}/operations/rebuild-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/rebuild-schedule`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Re-run the schedule generator in place on an existing schedule. Atomic alternative to delete-then-recreate (which orphans pending obligations): preserves the structure id + element associations + taxonomy, voids the old pending obligation chain, deletes the old facts and SumEquals rules, and regenerates fresh forward facts + a fresh obligation chain from the schedule's stored definition (entry_template / schedule_metadata / monthly_amount / period bounds). The historical-vs-in-scope split is re-derived from the CURRENT fiscal calendar closed_through. Use this to pick up a fixed generator (e.g. the roll-forward direction fix) without orphaning obligations.

**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

- RebuildScheduleRequest: Re-run the schedule generator in place on an existing schedule. Atomic alternative to delete-then-recreate: the structure id and its element associations are preserved, the old pending obligation chain is voided, the old facts + rules are deleted, and a fresh set of forward facts + a fresh obligation chain are regenerated from the schedule's stored definition (entry_template / schedule_metadata / monthly_amount / period bounds on the Structure's metadata). The historical-vs-in-scope split is re-derived from the CURRENT fiscal calendar (months through its `closed_through`, or before its first month, are history), so a rebuild re-scopes the schedule to today's close state. Use this to pick up a fixed generator (e.g. the roll-forward direction fix) without orphaning obligations.
  - `structure_id` string, required: The schedule structure to regenerate in place.

## Response `200`

Successful Response

- OperationEnvelopeScheduleCreatedResponse
  - `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` ScheduleCreatedResponse
    - `structure_id` string, required
    - `name` string, required
    - `taxonomy_id` string, required
    - `total_periods` integer, required
    - `total_facts` integer, required
    - `rule_summary` object, nullable
    - `schedule_created_event_id` string, nullable
    - `pending_event_count` integer
  - `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)
