Push RTMP stream immediately after starting streams in cloud

I’m working with the Wowza cloud API. My workflow needs to have the wowza streams started and start pushing video then, just after the streams become avilable. I’m calling to:

https://api.cloud.wowza.com/api/v1/live_streams/1234abcd/start/

Then checking that the stream is started by waiting to the “started” response from:

https://api.cloud.wowza.com/api/v1/live_streams/1234abcd/state/

However, if I push the rtmp after getting the latest response, it happens that sometimes the RTMP session can’t be established. It works if I retry after a few more seconds but it looks like the API calls doesn’t allow to synchronize the flow based on the streams state. Need a way to synchronize the video pushing after the stream startup.