Remove Resource
Remove a resource from the graph.
Only available for DRAFT, WAITING, and FAILED resources that never provisioned anything. Everything else, including a resource whose provisioned infrastructure outlived an upstream deactivation, must use deactivate first. Resources it owns alone are removed with it.
Removal is a lifecycle phase, not an erasure: the resource comes back with
lifecycle_state: "deleted" and its name stays taken while it holds that
state. Once its retention window passes the record is archived, and reading
it then answers 404: there is no such resource in Pragmatiks any more.
The response lists the resources the removal reaches and what happens to
each. That list is the closure the validated pre-flight walk computed, so
it is a prediction rather than a record: the walk and the changes it
authorises are not one transaction, and on a real call a write landing in
between can still divert an individual resource. Pass dry_run=true to
read the list without changing anything; a removal that would be refused is
refused the same way in a dry run.
Sensitive fields are masked by default in the response.
Returns: The resource in its deleted state with the removal’s predicted impact list. A dry run returns the resource unchanged.
Raises: HTTPException: 404 if resource not found.
Path Parameters
Query Parameters
Reveal sensitive field values
Preview the removal without changing anything
Provider name
Resource type
Resource name
Response
Successful Response
A deactivated or removed resource, with everything the teardown reaches.
Attributes: impact: Resources the teardown's pre-flight walk predicted it reaches. dry_run: Whether the call only previewed the teardown.
Resources the teardown reaches, the requested one first, with the action taken on each. This is the prediction the validated pre-flight walk computed, not a record of what happened: the walk and the changes it authorises are not one transaction, so on a real call another write landing in between can still divert an individual resource. A dry run returns the same list without changing anything.
Whether the call only previewed the teardown, leaving everything untouched.
External resource ID for API responses: provider/resource/name.
Lifecycle states for resources.
draft, waiting, pending, processing, ready, failed, deleting, deleted healthy, degraded