Skip to content

Conditionally undo an applied plan; a later edit wins and reports as a conflict

POST
/api/v1/admin/kg/annotations/{planId}/undo
curl --request POST \
--url http://localhost:11044/api/v1/admin/kg/annotations/example/undo \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'
planId
required
string

The planId of an applied plan, looked up in the acting user’s annotation audit journal for this world rather than the plan store, so it works after the plan is consumed or expired; 409 when nothing under it is left to undo

username
string

Optional, and never needed: the call always acts as the signed-in principal. Naming the principal changes nothing; naming anyone else is refused with 403.

The outcome: what the undo reverted

Media typeapplication/json

The result of applying or undoing a frozen plan.

object
applied
required

Targets written: set to the planned value on apply, restored to their prior value on undo.

integer format: int32
conflicted
required

Targets that still exist but moved since the plan froze. Skipped, not forced.

integer format: int32
disappearedOrUnauthorized
required

Targets that could not be re-bound in scope: deleted, re-owned or re-labeled. Deliberately ONE bucket — separating them would leak whether another tenant’s data exists.

integer format: int32
planId
required

The plan applied or undone, echoed from the path.

string
postImages
required

One committed post-image per target written.

Array<object>

One committed post-image, read back inside the write transaction.

object
auditId
required

Audit record id for this individual write.

string
identity

The written node’s identity property value. Type depends on the label’s identity property.

property
required

The property that was written.

string
value

The property’s value as committed, read back after the write; null when the write cleared it.

selected
required

Targets considered: the frozen plan’s selection on apply, the plan’s audited writes on undo. applied, conflicted and disappearedOrUnauthorized add up to it.

integer format: int32

Example generated

{
"applied": 1,
"conflicted": 1,
"disappearedOrUnauthorized": 1,
"planId": "example",
"postImages": [
{
"auditId": "example",
"identity": "example",
"property": "example",
"value": "example"
}
],
"selected": 1
}

No authenticated principal

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}

Annotation writes disabled by feature flag, or username names someone other than the signed-in principal

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}

Plan rejected, expired, or frozen for another user

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}