Cancel an instance
POST
/sop/:name/:id/cancel
Terminates a running instance immediately. The instance moves to the cancelled state. Any pending steps are skipped. This action is irreversible.
Path parameters
- name string REQUIRED
- The process name.
- id string REQUIRED
- The instance ULID.
Response
200
application/json — Instance in
cancelled state.
Errors
404
not_found
Instance does not exist.
422
invalid_transition
Instance is already in a terminal state.
curl https://api.opensop.dev/sop/customer-onboarding/01HXYZ_ACME_001/cancel \ -X POST \ -H "X-SOP-Token: $OPENSOP_TOKEN"
await fetch(
`https://api.opensop.dev/sop/customer-onboarding/${id}/cancel`,
{
method: "POST",
headers: { "X-SOP-Token": process.env.OPENSOP_TOKEN }
}
);
requests.post(
f"https://api.opensop.dev/sop/customer-onboarding/{instance_id}/cancel",
headers={"X-SOP-Token": os.environ["OPENSOP_TOKEN"]}
)
req = Net::HTTP::Post.new("/sop/customer-onboarding/#{id}/cancel")
req["X-SOP-Token"] = ENV["OPENSOP_TOKEN"]
Net::HTTP.start("api.opensop.dev", use_ssl: true) { |h| h.request(req) }
RESPONSE
200
{
"id": "01HXYZ_ACME_001",
"state": "cancelled"
}