Dynamically set a build/commit as failed or pass


I was wondering if there is a way to dynamically set a build or a commit as failed or passed using the REST API? I have pretty much built a homegrown deployment process and would like to be able to set a build or commit as failed or passed once my homegrown deployment process is finished.

I know it’s possible through Jenkins where you can setup a webhook and when you push code to Gitlab, Gitlab then triggers the Jenkins webhook and then the Jenkins webhook does its deployment process. Once the build in Jenkins completes it’ll either set the commit in Gitlab as failed or passed.

So I’m wondering if it’s possible doing something similar using the REST API? My deployment process doesn’t use any actual 3rd party software. It uses just PHP and once my PHP script does its thing, then it’s supposed to return back a JSON response with results. If there’s results, it’s a pass. If it returns an error, then it’s a fail. So was just wondering if it’s possible to use PHP to trigger the REST API to set the build or commit as failed or passed. If it’s possible, a link to the specific REST API documentation would be nice.

Never mind, I figured the answer out myself.