API Help

What is the API construct for making a decision?? Like the IF keyword in most languages.

And where is it documented??

you cant do contidionals in json api.

thanks