How can I SET a closed_lost_reason via API when setting a the Deal Stage to Lost?

I want to update the Deal Stage to Lost and set a closed_lost_reson via API as part of an automation.

We are successfully setting the Deal Stage but are not having much luck with setting the reason.

any thoughts?

@YMeadows

You should be able to do this in the same patch request as I imagine you are using to move to a new stage.

Sample body would like like this:

{
 "properties": {
 "closed_lost_reason": "they dont like cats",
 "dealstage": "2916814"
 }
}