Using the REST API, add a read-only custom filed with a default value

We are trying to create a read-only custom filed in JIRA with a default value. How can I achieve that?
From JIRA UI, we can’t add a default value to a read only text field. Is it possible from the REST API? If possible, can someone please guide me with a sample request?

Or is it possible to get it viewed in the resolved screen, even that field doens’t have a value?