I think that "TextFormatRun" with spreadsheets.batchUpdate in Sheets API can be achieved your goal.
As the sample situation, it supposes that the cell "A1" on the Spreadsheet has the value of hi i'm bold - and I'm not
and you want to do the bold type hi i'm bold
of hi i'm bold - and I'm not
.
In this case, the following endpoint and request body can achieve this.
Endpoint:
https://sheets.googleapis.com/v4/spreadsheets/###spreadsheetId###:batchUpdate
Request body:
{"requests": [
{"updateCells": {
"range": {"sheetId": "###sheetId###", "startRowIndex": 0, "endRowIndex": 1, "startColumnIndex": 0, "endColumnIndex": 1},
"rows": [{"values": [{"textFormatRuns":[
{"format": {"bold": true}, "startIndex": 0},
{"format": {"bold": false}, "startIndex": 11}
]}]}],
"fields": "textFormatRuns.format.bold"
}}
]}
- When you use this, please set the Spreadsheet ID and sheet ID.
References:
If I misunderstood your question and this was not the direction you want, I apologize.