# toc.markEntry

> Insert a TC (table of contents entry) field at the target paragraph.



- Member path: `doc.toc.markEntry(…)`
- Mutates document: yes
- Idempotency: `non-idempotent`
- Supports tracked mode: no
- Supports dry run: yes

## Expected result

Returns a TocEntryMutationResult with the created entry address on success.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "target": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "inline-insert"
        },
        "anchor": {
          "type": "object",
          "properties": {
            "nodeType": {
              "const": "paragraph"
            },
            "nodeId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "nodeType",
            "nodeId"
          ]
        },
        "position": {
          "enum": [
            "start",
            "end"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "anchor"
      ]
    },
    "text": {
      "type": "string"
    },
    "level": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9
    },
    "tableIdentifier": {
      "type": "string"
    },
    "omitPageNumber": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "target",
    "text"
  ]
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "entry": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "inline"
            },
            "nodeType": {
              "const": "tableOfContentsEntry"
            },
            "nodeId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "entry"
      ]
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "const": false
        },
        "failure": {
          "type": "object",
          "properties": {
            "code": {
              "enum": [
                "NO_OP",
                "INVALID_TARGET",
                "TARGET_NOT_FOUND",
                "CAPABILITY_UNAVAILABLE",
                "INVALID_INSERTION_CONTEXT",
                "INVALID_INPUT"
              ]
            },
            "message": {
              "type": "string"
            },
            "details": {}
          },
          "additionalProperties": false,
          "required": [
            "code",
            "message"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "failure"
      ]
    }
  ]
}
```

## Pre-apply throws

- `TARGET_NOT_FOUND`
- `INVALID_TARGET`
- `INVALID_INPUT`
- `CAPABILITY_UNAVAILABLE`

## Non-applied receipt codes

- `NO_OP`
- `INVALID_INSERTION_CONTEXT`

