I'm assuming you're already able to retrieve the job through the API. If not, see here for sample code for doing that.
Once you have the job, set the Held property to True or False and then save the job.
Beginning in 3.0.6 there are HoldJob and ReleaseJob methods that change Held and do the save for you. If a user has Hold/Release permission for the job but not Modify permission, you have to use HoldJob/ReleaseJob, because Save will fail with a permission error.