Scheduling
Scheduling is how a change happens later. A plan version going live at midnight, a pause from the first of next month, a cancellation on a set date: all of them are recorded now and applied then.
Kontier holds these as changes, in one list (GET /v1/changes), so "what is
about to happen to this customer" is a question with an answer.
Why not just edit it later
Because somebody has to remember, and because the change must be visible before it happens.
A scheduled change is visible in advance: the customer's next bill can be explained before it is issued, support can see what is queued, and a mistake can be cancelled rather than reversed after the fact.
What can be scheduled
GET /v1/changes/operations lists the operations this deployment can schedule,
each with the subject kinds it acts on, the when kinds it accepts
(whens), its payload_schema and whether it is reversible. The operations are:
operation | Subject | What it does |
|---|---|---|
catalog.publish_version | plan, product, rate_table, tax_rule, price_formula (in subject_kind) | Takes the entity's working draft live as a new version. See Versioning |
subscription.transform | a subscription | From an instant on, sets or resets one line attribute (set_value, reset_value), pins or follows (set_track), or changes the exit rule (set_exit) |
subscription.apply_for_a_while | a subscription | The same rewrites, for a window: for_count + for_unit, or until |
subscription.set_default | a subscription | Changes the subscription's defaults: track, version_change, payment_terms_days |
subscription.set_status | a subscription | stop_at (a cancellation), pause or resume |
None of them is reversible: once a change has applied, undoing it is a new
change, not a rollback.
When it happens
Every change carries a when. All operations above accept two kinds:
when | Meaning |
|---|---|
now | Applied in the request. For an ungated change on one subject the response already reads status: "applied"; a gated or audience-scoped one stays planned until the engine fires it |
at | At a wall-clock time: at (sent with a Z suffix) read in the IANA time zone zone. "at": "2027-01-01T00:00:00Z", "zone": "Europe/Vienna" fires at midnight in Vienna. An offset in at is refused |
The Change object's when can name other kinds (period_end, phase_change,
term_end, after_notice). Always read an operation's whens from
GET /v1/changes/operations before offering a kind. A kind the operation does
not accept answers WHEN_NOT_ACCEPTED. GET /v1/changes/anchors?subject=subscription:…
tells you which anchored kinds one particular subject has no moment for.
Schedule one
Pause a subscription from 1 December, Berlin time
The response is the Change, status: "planned", with the instant it resolves
to in resolved_at. Its title_key and title_args say in words what will
happen, for display.
Two optional fields widen or hold a change:
"gate": "approval"holds it until a second person releases it. Releasing it happens in the dashboard; there is no API for it. You can read the approvals queue withGET /v1/approvals(see Approvals)."scope": "selector"with anaudience_idacts on everyone in a saved audience reached through the subject ("everyone in this audience who is on plan A"). The audience is resolved again when the change fires.
Two changes of the same conflict class (see conflict_class on
GET /v1/changes/operations) cannot hold the same subject at the same instant:
the second answers 409 CHANGE_CONFLICT. A gate or scope this deployment or
operation cannot carry out answers 501 (CHANGE_GATE_NOT_SUPPORTED,
CHANGE_SCOPE_NOT_SUPPORTED).
Preview before and after
| Call | Answers |
|---|---|
POST /v1/changes/preview | Takes the POST /v1/changes body and answers what that change would do, without writing anything. It refuses exactly as POST /v1/changes would |
GET /v1/changes/{id}/preview | The same answer for a change already scheduled |
Both return who is affected, who is excluded and why, what follows
downstream, and the money delta by currency.
Find what is scheduled
GET /v1/changes lists every change, newest instant first. Useful filters:
| Filter | Example |
|---|---|
| By subject | subject=subscription:8f14e45f-… (repeatable) |
| By status | status=planned,running |
| By what needs doing | bucket=overdue, upcoming or done |
| By operation | operation=catalog.publish_version |
| Needing attention | needs_attention=true |
GET /v1/changes/{id} reads one.
Status
status | Meaning |
|---|---|
planned | Waiting for its instant (or its gate). A change is planned from the moment it is created: there is no draft stage |
running | Being applied |
applied | Done. applied_at says when |
failed | The last attempt failed. failure_reason says why |
cancelled | Taken back with DELETE |
superseded | The world moved under it (the subscription was already cancelled, the plan had nothing staged) and it was retired without effect |
Change one
| To | Call |
|---|---|
| Move it to another time | PATCH /v1/changes/{id} with a new when (and at + zone) |
| Apply it now, early | PATCH /v1/changes/{id} with "when": "now". It answers applied |
| Cancel it | DELETE /v1/changes/{id} |
Move it to 1 January
Cancel it
PATCH moves only the time. To change what a change does, cancel it and
schedule a new one. Both answer 409 CHANGE_NOT_EDITABLE once a change is
running or retired.
Cancelling a publish keeps the edit
Cancelling a catalog.publish_version cancels the release, not the content:
the edit stays staged on the entity's working draft, to publish later or discard
with its DELETE …/draft.
What happened
GET /v1/changes/{id}/outcomes is the record, written when the change fires:
counts of applied, skipped and excluded, and one row per subject in
targets with its outcome and, for skipped or excluded rows, a reason. It
is empty until the change fires, because outcomes record what happened rather
than predict it. For a cohort, skipped is a success: that subject already had
the result.
Where scheduling shows up
- Plan versions publish through it.
catalog.publish_versionwithwhen: "at"is a scheduled release, listed on the plan underscheduled_versions. - Subscriptions change later through it: pause, resume or stop on a date, or a line rewrite from an instant on. Pausing or cancelling right now has its own calls on the subscription.
- Tax rules and rate tables publish dated versions the same way.
Reference
| Topic | When you need it |
|---|---|
| Versioning | Working drafts, scheduled versions and history |
| Plans | Publishing a version, and who follows it |
| Subscriptions | Revisions, pause, resume and cancel |
| Changes API | Every field of the change, preview and outcome objects |