How to set all the form field read only except some?

How to set all the form field read only except some, even via API to he should not edit that?

For example:
only status field can be editable and saved?