> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-nick-sd-2070-add-content-controls-namespace-to-doc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# format.apply

> Apply inline run-property patch changes to the target range with explicit set/clear semantics.

> Alpha: Document API is currently alpha and subject to breaking changes.

## Summary

Apply inline run-property patch changes to the target range with explicit set/clear semantics.

* Operation ID: `format.apply`
* API member path: `editor.doc.format.apply(...)`
* Mutates document: `yes`
* Idempotency: `conditional`
* Supports tracked mode: `yes`
* Supports dry run: `yes`
* Deterministic target resolution: `yes`

## Expected result

Returns a TextMutationReceipt confirming inline styles were applied to the target range.

## Input fields

| Field                         | Type         | Required | Description        |                         |                               |
| ----------------------------- | ------------ | -------- | ------------------ | ----------------------- | ----------------------------- |
| `inline`                      | object       | yes      |                    |                         |                               |
| `inline.bCs`                  | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.bold`                 | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.border`               | object \\    | null     | no                 | One of: object, null    |                               |
| `inline.caps`                 | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.charScale`            | number \\    | null     | no                 | One of: number, null    |                               |
| `inline.color`                | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.contextualAlternates` | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.cs`                   | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.dstrike`              | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.eastAsianLayout`      | object \\    | null     | no                 | One of: object, null    |                               |
| `inline.em`                   | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.emboss`               | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.fitText`              | object \\    | null     | no                 | One of: object, null    |                               |
| `inline.fontFamily`           | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.fontSize`             | number \\    | null     | no                 | One of: number, null    |                               |
| `inline.fontSizeCs`           | number \\    | null     | no                 | One of: number, null    |                               |
| `inline.highlight`            | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.iCs`                  | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.imprint`              | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.italic`               | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.kerning`              | number \\    | null     | no                 | One of: number, null    |                               |
| `inline.lang`                 | object \\    | null     | no                 | One of: object, null    |                               |
| `inline.letterSpacing`        | number \\    | null     | no                 | One of: number, null    |                               |
| `inline.ligatures`            | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.numForm`              | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.numSpacing`           | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.oMath`                | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.outline`              | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.position`             | number \\    | null     | no                 | One of: number, null    |                               |
| `inline.rFonts`               | object \\    | null     | no                 | One of: object, null    |                               |
| `inline.rStyle`               | string \\    | null     | no                 | One of: string, null    |                               |
| `inline.rtl`                  | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.shading`              | object \\    | null     | no                 | One of: object, null    |                               |
| `inline.shadow`               | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.smallCaps`            | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.snapToGrid`           | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.specVanish`           | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.strike`               | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.stylisticSets`        | object\[] \\ | null     | no                 | One of: object\[], null |                               |
| `inline.underline`            | boolean \\   | null \\  | object             | no                      | One of: boolean, null, object |
| `inline.vanish`               | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `inline.vertAlign`            | enum \\      | null     | no                 | One of: enum, null      |                               |
| `inline.webHidden`            | boolean \\   | null     | no                 | One of: boolean, null   |                               |
| `target`                      | TextAddress  | yes      | TextAddress        |                         |                               |
| `target.blockId`              | string       | yes      |                    |                         |                               |
| `target.kind`                 | `"text"`     | yes      | Constant: `"text"` |                         |                               |
| `target.range`                | Range        | yes      | Range              |                         |                               |
| `target.range.end`            | integer      | yes      |                    |                         |                               |
| `target.range.start`          | integer      | yes      |                    |                         |                               |

### Example request

```json theme={null}
{
  "inline": {
    "bold": true,
    "italic": true
  },
  "target": {
    "blockId": "block-abc123",
    "kind": "text",
    "range": {
      "end": 10,
      "start": 0
    }
  }
}
```

## Output fields

### Variant 1 (resolution.requestedTarget.kind="text")

| Field                                    | Type                   | Required | Description            |
| ---------------------------------------- | ---------------------- | -------- | ---------------------- |
| `inserted`                               | EntityAddress\[]       | no       |                        |
| `removed`                                | EntityAddress\[]       | no       |                        |
| `resolution`                             | TextMutationResolution | yes      | TextMutationResolution |
| `resolution.range`                       | TextMutationRange      | yes      | TextMutationRange      |
| `resolution.range.from`                  | integer                | yes      |                        |
| `resolution.range.to`                    | integer                | yes      |                        |
| `resolution.requestedTarget`             | TextAddress            | no       | TextAddress            |
| `resolution.requestedTarget.blockId`     | string                 | no       |                        |
| `resolution.requestedTarget.kind`        | `"text"`               | no       | Constant: `"text"`     |
| `resolution.requestedTarget.range`       | Range                  | no       | Range                  |
| `resolution.requestedTarget.range.end`   | integer                | no       |                        |
| `resolution.requestedTarget.range.start` | integer                | no       |                        |
| `resolution.target`                      | TextAddress            | yes      | TextAddress            |
| `resolution.target.blockId`              | string                 | yes      |                        |
| `resolution.target.kind`                 | `"text"`               | yes      | Constant: `"text"`     |
| `resolution.target.range`                | Range                  | yes      | Range                  |
| `resolution.target.range.end`            | integer                | yes      |                        |
| `resolution.target.range.start`          | integer                | yes      |                        |
| `resolution.text`                        | string                 | yes      |                        |
| `success`                                | `true`                 | yes      | Constant: `true`       |
| `updated`                                | EntityAddress\[]       | no       |                        |

### Variant 2 (resolution.requestedTarget.kind="text")

| Field                                    | Type                   | Required | Description            |
| ---------------------------------------- | ---------------------- | -------- | ---------------------- |
| `failure`                                | object                 | yes      |                        |
| `failure.code`                           | enum                   | yes      | `"INVALID_TARGET"`     |
| `failure.details`                        | any                    | no       |                        |
| `failure.message`                        | string                 | yes      |                        |
| `resolution`                             | TextMutationResolution | yes      | TextMutationResolution |
| `resolution.range`                       | TextMutationRange      | yes      | TextMutationRange      |
| `resolution.range.from`                  | integer                | yes      |                        |
| `resolution.range.to`                    | integer                | yes      |                        |
| `resolution.requestedTarget`             | TextAddress            | no       | TextAddress            |
| `resolution.requestedTarget.blockId`     | string                 | no       |                        |
| `resolution.requestedTarget.kind`        | `"text"`               | no       | Constant: `"text"`     |
| `resolution.requestedTarget.range`       | Range                  | no       | Range                  |
| `resolution.requestedTarget.range.end`   | integer                | no       |                        |
| `resolution.requestedTarget.range.start` | integer                | no       |                        |
| `resolution.target`                      | TextAddress            | yes      | TextAddress            |
| `resolution.target.blockId`              | string                 | yes      |                        |
| `resolution.target.kind`                 | `"text"`               | yes      | Constant: `"text"`     |
| `resolution.target.range`                | Range                  | yes      | Range                  |
| `resolution.target.range.end`            | integer                | yes      |                        |
| `resolution.target.range.start`          | integer                | yes      |                        |
| `resolution.text`                        | string                 | yes      |                        |
| `success`                                | `false`                | yes      | Constant: `false`      |

### Example response

```json theme={null}
{
  "inserted": [
    {
      "entityId": "entity-789",
      "entityType": "comment",
      "kind": "entity"
    }
  ],
  "resolution": {
    "range": {
      "from": 0,
      "to": 10
    },
    "requestedTarget": {
      "blockId": "block-abc123",
      "kind": "text",
      "range": {
        "end": 10,
        "start": 0
      }
    },
    "target": {
      "blockId": "block-abc123",
      "kind": "text",
      "range": {
        "end": 10,
        "start": 0
      }
    },
    "text": "Hello, world."
  },
  "success": true,
  "updated": [
    {
      "entityId": "entity-789",
      "entityType": "comment",
      "kind": "entity"
    }
  ]
}
```

## Pre-apply throws

* `TARGET_NOT_FOUND`
* `CAPABILITY_UNAVAILABLE`
* `INVALID_TARGET`
* `INVALID_INPUT`

## Non-applied failure codes

* `INVALID_TARGET`

## Raw schemas

<Accordion title="Raw input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "inline": {
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "bCs": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "bold": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "border": {
            "oneOf": [
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "color": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "space": {
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sz": {
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "val": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "caps": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "charScale": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "color": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "contextualAlternates": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "cs": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "dstrike": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "eastAsianLayout": {
            "oneOf": [
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "combine": {
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "combineBrackets": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "id": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vert": {
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vertCompress": {
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "em": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "emboss": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "fitText": {
            "oneOf": [
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "id": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "val": {
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "fontFamily": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fontSize": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "fontSizeCs": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "highlight": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "iCs": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "imprint": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "italic": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "kerning": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "lang": {
            "oneOf": [
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "bidi": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "eastAsia": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "val": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "letterSpacing": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "ligatures": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "numForm": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "numSpacing": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "oMath": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "outline": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "position": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "rFonts": {
            "oneOf": [
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "ascii": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "asciiTheme": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cs": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "csTheme": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "eastAsia": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "eastAsiaTheme": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hAnsi": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hAnsiTheme": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hint": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "rStyle": {
            "oneOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rtl": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "shading": {
            "oneOf": [
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "color": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fill": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "val": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "shadow": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "smallCaps": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "snapToGrid": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "specVanish": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "strike": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "stylisticSets": {
            "oneOf": [
              {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "val": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "type": "object"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "underline": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "color": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "style": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "themeColor": {
                    "oneOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              }
            ]
          },
          "vanish": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "vertAlign": {
            "oneOf": [
              {
                "enum": [
                  "superscript",
                  "subscript",
                  "baseline"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "webHidden": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "target": {
        "$ref": "#/$defs/TextAddress"
      }
    },
    "required": [
      "target",
      "inline"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw output schema">
  ```json theme={null}
  {
    "oneOf": [
      {
        "$ref": "#/$defs/TextMutationSuccess"
      },
      {
        "additionalProperties": false,
        "properties": {
          "failure": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "enum": [
                  "INVALID_TARGET"
                ]
              },
              "details": {},
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          },
          "resolution": {
            "$ref": "#/$defs/TextMutationResolution"
          },
          "success": {
            "const": false
          }
        },
        "required": [
          "success",
          "failure",
          "resolution"
        ],
        "type": "object"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="Raw success schema">
  ```json theme={null}
  {
    "$ref": "#/$defs/TextMutationSuccess"
  }
  ```
</Accordion>

<Accordion title="Raw failure schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "failure": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "enum": [
              "INVALID_TARGET"
            ]
          },
          "details": {},
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "resolution": {
        "$ref": "#/$defs/TextMutationResolution"
      },
      "success": {
        "const": false
      }
    },
    "required": [
      "success",
      "failure",
      "resolution"
    ],
    "type": "object"
  }
  ```
</Accordion>
