Submit a step
POST
/sop/:name/:id/steps/:step_id/submit
Advances a step by providing its outputs. The step must be in the active state. Submitting a terminal step or a step in the wrong state returns 422 invalid_transition.
Path parameters
- name string REQUIRED
- The process name.
- id string REQUIRED
- The instance ULID.
- step_id string REQUIRED
- The step
idas declared in the process YAML.
Request body
Content-Type: application/json
- outputs object REQUIRED
- Key-value map of step outputs as declared in the process YAML.
Response
200
application/json — Updated step object.
Errors
422
invalid_transition
Step is not in the active state.
404
not_found
Instance or step not found.
curl https://api.opensop.dev/sop/customer-onboarding/01HXYZ_ACME_001/steps/review-application/submit \
-X POST \
-H "X-SOP-Token: $OPENSOP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"outputs":{"decision":"approved","reason":"Documents verified"}}'
await fetch(
`https://api.opensop.dev/sop/customer-onboarding/${id}/steps/review-application/submit`,
{
method: "POST",
headers: {
"X-SOP-Token": process.env.OPENSOP_TOKEN,
"Content-Type": "application/json"
},
body: JSON.stringify({ outputs: { decision: "approved" } })
}
);
requests.post(
f"https://api.opensop.dev/sop/customer-onboarding/{id}/steps/review-application/submit",
json={"outputs": {"decision": "approved"}},
headers={"X-SOP-Token": os.environ["OPENSOP_TOKEN"]}
)
req = Net::HTTP::Post.new("/sop/customer-onboarding/#{id}/steps/review-application/submit")
req["X-SOP-Token"] = ENV["OPENSOP_TOKEN"]
req["Content-Type"] = "application/json"
req.body = { outputs: { decision: "approved" } }.to_json
Net::HTTP.start("api.opensop.dev", use_ssl: true) { |h| h.request(req) }
RESPONSE
200
{
"id": "review-application",
"state": "completed",
"outputs": { "decision": "approved" }
}