Preview Schedule
/extensions/roboledger/{graph_id}/operations/preview-schedulePart of RoboLedger: Fiscal Close.
Generate a schedule from a definition without keeping it: the same generator and guards as creating one (block_type='schedule' on create-information-block), run and rolled back. Returns the envelope create would leave (its ids provisional) and the period-by-period roll-forward: the balance the schedule carries on the account it credits (a loan's: the note), opening, the period's amount, closing, and for a loan the interest, payment, principal and current portion. Show it to the person before asking to create. A definition create would refuse (a roll-forward that climbs where it should fall, legs that do not balance) is refused here with the period that breaks. warnings names any active schedule already posting the same accounts in the same months. With replaces_structure_id, replaces says what the schedule being edited or recreated has posted, by month, and the path the change takes: rebuild (rebuild-schedule with the new definition) while nothing has posted, terminate_and_succeed after.
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.
Authentication
Authenticate in any one of these ways — not all of them:
- API key in the
X-API-Keyheader. - Bearer token in the
Authorizationheader.
Path parameters
| Name | Type | Description |
|---|---|---|
graph_idrequired | string | Graph Id Constraints: matches |
Header parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Keyoptional | string | Idempotency-Key |
Request body
Required, application/json.
| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namerequired | string | Schedule name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
entity_idoptional | string | The entity whose books the schedule belongs to, by id. Omit for the group parent. Its facts, obligations and closing entries land in that entity's books, against that entity's own accounts. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
taxonomy_idoptional | string | Taxonomy ID (auto-creates if omitted) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
element_idsrequired | string[] | CoA element ids the schedule touches (the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
period_startrequired | string (date) | First period start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
period_endrequired | string (date) | Last period end | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
monthly_amountoptional | integer | Monthly amount in cents. Required for a straight-line schedule; a custom or loan schedule takes its amounts from its curve. Default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
entry_templaterequired | EntryTemplateRequest | EntryTemplateRequest fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
schedule_metadataoptional | ScheduleMetadataRequest | ScheduleMetadataRequest fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
closed_throughoptional | string (date) | Watermark for onboarding. Facts with period_end ≤ this date are flagged 'historical' and their schedule_entry_due obligations are emitted 'voided', so the close workflow starts drafting at the first open period. Defaults to the calendar's history end: the last day of its closed_through month (calendar '2026-05' → '2026-05-31'), or the day before its first month when nothing has closed yet. An earlier date is raised to it, since an obligation there could never post; set a later one only to treat more months as already booked. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
source_transaction_idoptional | string | Free-form reference to the originating GL transaction (e.g. an import ID, ledger entry ID, or external system key). Stored in artifact_mechanics for audit; no FK constraint. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
replaces_structure_idoptional | string | The schedule this definition would replace, when editing or recreating one: the preview then says what its posted entries mean for the change. |
Example request
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/preview-schedule" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"element_ids": [
"string"
],
"period_start": "2026-01-31",
"period_end": "2026-01-31",
"entry_template": {
"debit_element_id": "string",
"credit_element_id": "string"
}
}'Responses
200 Successful Response
| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationrequired | string | Kebab-case operation name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operationIdrequired | string | op_-prefixed ULID for audit and SSE correlation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statusrequired | string | Operation lifecycle state One of: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resultoptional | PreviewScheduleResponse | Command-specific result payload PreviewScheduleResponse fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
atrequired | string | ISO-8601 UTC timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdByoptional | string | User ID that initiated the operation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
idempotentReplayoptional | boolean | True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions. Default: |
| Status | Meaning |
|---|---|
| 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 |