We can use a workflow to lock a record. By default, this lock applies in all contexts except “Web Application” and “Web Store,” meaning no updates can be made through scripts, REST, or SOAP services. If the intention is to restrict only users making direct updates in the record, then in the workflow’s context settings, only “User Interface” should be selected while all other contexts remain unchecked.
