Skip to content

Delete instance.

DELETE
/api/workspace/entity/{entityIdOrKey}/instances/{instanceId}
curl --request DELETE \
--url https://example.com/api/workspace/entity/example/instances/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "OperationKey": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "EntityDefinitionKey": "example", "EntityInstanceId": "example", "RowVersion": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "Reason": "example" }'

Permanently deletes one archived entity instance. Active rows must be archived before permanent deletion. Returns HTTP 409 with moltaro.instances.delete.referenced when a Reference field configured with Restrict still points to this record, or when a module that depends on this record vetoes the deletion through the pre-commit dependency check; the veto reasons are returned before the canonical code. Hard delete removes child-table rows and assignment rows and writes the final audit snapshot when audit is enabled. The trimmed Reason is stored in the same transaction as lifecycle audit evidence without former field values. After deletion, only workspace Owner or Admin can read it through the workspace audit log.

entityIdOrKey
required
string

Entity definition identifier or normalized entity key.

instanceId
required
string

Entity instance identifier.

access_token
string

Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.

Expected runtime row version for optimistic concurrency.

Identifies one concurrency-protected Entity lifecycle command.

object
OperationKey
required

Caller-generated UUID reused only for an exact retry of the same logical operation.

string format: uuid
EntityDefinitionKey
required

Entity definition identifier or normalized key; it must match the route.

string
EntityInstanceId
required

Target Entity record identifier; it must match the route.

string
RowVersion
required

Current target row version expected by the caller.

string format: uuid
Reason
required

Required audit reason for archive, restore, and permanent delete. Must contain 1–1000 characters after trimming leading and trailing whitespace.

string
Examplegenerated
{
"OperationKey": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"EntityDefinitionKey": "example",
"EntityInstanceId": "example",
"RowVersion": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"Reason": "example"
}

OK

Media typeapplication/json
object
Data
One of: discriminator: Kind

Receipt of a committed Entity record mutation whose post-state the caller cannot read now.

object
OperationKey
required

Operation key of the committed operation.

string format: uuid
CompletedAt
required

Completion instant of the committed operation. A receipt built when a replay can no longer show its stored result carries the instant the replayed command committed.

string format: date-time
AuditCorrelationId
required

Audit correlation of the committed operation. A receipt built when a replay can no longer show its stored result carries the correlation of the replaying call instead.

string
IsIdempotentReplay
required

Whether this answer repeats an earlier committed operation without another write.

boolean
Success
required
boolean
CanViewResult
required
boolean
CallerKnownIdentity
required

Entity record identity carried by a receipt: only values the caller already knew.

object
EntityDefinitionId
required

Entity definition identifier.

string
EntityInstanceId
required

Entity record identifier.

string
ResponsibilityCode

Responsibility key a bulk assignment or removal item sent; left out for record mutations.

string
nullable
Kind
required
string
Allowed values: Receipt
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Kind": "Receipt"
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Bad Request

Media typeapplication/json
object
Data
One of: discriminator: Kind

Receipt of a committed Entity record mutation whose post-state the caller cannot read now.

object
OperationKey
required

Operation key of the committed operation.

string format: uuid
CompletedAt
required

Completion instant of the committed operation. A receipt built when a replay can no longer show its stored result carries the instant the replayed command committed.

string format: date-time
AuditCorrelationId
required

Audit correlation of the committed operation. A receipt built when a replay can no longer show its stored result carries the correlation of the replaying call instead.

string
IsIdempotentReplay
required

Whether this answer repeats an earlier committed operation without another write.

boolean
Success
required
boolean
CanViewResult
required
boolean
CallerKnownIdentity
required

Entity record identity carried by a receipt: only values the caller already knew.

object
EntityDefinitionId
required

Entity definition identifier.

string
EntityInstanceId
required

Entity record identifier.

string
ResponsibilityCode

Responsibility key a bulk assignment or removal item sent; left out for record mutations.

string
nullable
Kind
required
string
Allowed values: Receipt
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Kind": "Receipt"
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Forbidden

Media typeapplication/json
object
Data
One of: discriminator: Kind

Receipt of a committed Entity record mutation whose post-state the caller cannot read now.

object
OperationKey
required

Operation key of the committed operation.

string format: uuid
CompletedAt
required

Completion instant of the committed operation. A receipt built when a replay can no longer show its stored result carries the instant the replayed command committed.

string format: date-time
AuditCorrelationId
required

Audit correlation of the committed operation. A receipt built when a replay can no longer show its stored result carries the correlation of the replaying call instead.

string
IsIdempotentReplay
required

Whether this answer repeats an earlier committed operation without another write.

boolean
Success
required
boolean
CanViewResult
required
boolean
CallerKnownIdentity
required

Entity record identity carried by a receipt: only values the caller already knew.

object
EntityDefinitionId
required

Entity definition identifier.

string
EntityInstanceId
required

Entity record identifier.

string
ResponsibilityCode

Responsibility key a bulk assignment or removal item sent; left out for record mutations.

string
nullable
Kind
required
string
Allowed values: Receipt
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Kind": "Receipt"
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Not Found

Media typeapplication/json
object
Data
One of: discriminator: Kind

Receipt of a committed Entity record mutation whose post-state the caller cannot read now.

object
OperationKey
required

Operation key of the committed operation.

string format: uuid
CompletedAt
required

Completion instant of the committed operation. A receipt built when a replay can no longer show its stored result carries the instant the replayed command committed.

string format: date-time
AuditCorrelationId
required

Audit correlation of the committed operation. A receipt built when a replay can no longer show its stored result carries the correlation of the replaying call instead.

string
IsIdempotentReplay
required

Whether this answer repeats an earlier committed operation without another write.

boolean
Success
required
boolean
CanViewResult
required
boolean
CallerKnownIdentity
required

Entity record identity carried by a receipt: only values the caller already knew.

object
EntityDefinitionId
required

Entity definition identifier.

string
EntityInstanceId
required

Entity record identifier.

string
ResponsibilityCode

Responsibility key a bulk assignment or removal item sent; left out for record mutations.

string
nullable
Kind
required
string
Allowed values: Receipt
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Kind": "Receipt"
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Conflict

Media typeapplication/json
object
Data
One of: discriminator: Kind

Receipt of a committed Entity record mutation whose post-state the caller cannot read now.

object
OperationKey
required

Operation key of the committed operation.

string format: uuid
CompletedAt
required

Completion instant of the committed operation. A receipt built when a replay can no longer show its stored result carries the instant the replayed command committed.

string format: date-time
AuditCorrelationId
required

Audit correlation of the committed operation. A receipt built when a replay can no longer show its stored result carries the correlation of the replaying call instead.

string
IsIdempotentReplay
required

Whether this answer repeats an earlier committed operation without another write.

boolean
Success
required
boolean
CanViewResult
required
boolean
CallerKnownIdentity
required

Entity record identity carried by a receipt: only values the caller already knew.

object
EntityDefinitionId
required

Entity definition identifier.

string
EntityInstanceId
required

Entity record identifier.

string
ResponsibilityCode

Responsibility key a bulk assignment or removal item sent; left out for record mutations.

string
nullable
Kind
required
string
Allowed values: Receipt
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Kind": "Receipt"
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}