# toc.configure

> Update the configuration switches of a table of contents.



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

## Expected result

Returns a TocMutationResult with the updated TOC address on success, or a failure code on no-op.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "target": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "block"
        },
        "nodeType": {
          "const": "tableOfContents"
        },
        "nodeId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ]
    },
    "patch": {
      "type": "object",
      "properties": {
        "outlineLevels": {
          "type": "object",
          "properties": {
            "from": {
              "type": "integer"
            },
            "to": {
              "type": "integer"
            }
          },
          "additionalProperties": false,
          "required": [
            "from",
            "to"
          ]
        },
        "useAppliedOutlineLevel": {
          "type": "boolean"
        },
        "tcFieldIdentifier": {
          "type": "string"
        },
        "tcFieldLevels": {
          "type": "object",
          "properties": {
            "from": {
              "type": "integer"
            },
            "to": {
              "type": "integer"
            }
          },
          "additionalProperties": false,
          "required": [
            "from",
            "to"
          ]
        },
        "hyperlinks": {
          "type": "boolean"
        },
        "hideInWebView": {
          "type": "boolean"
        },
        "omitPageNumberLevels": {
          "type": "object",
          "properties": {
            "from": {
              "type": "integer"
            },
            "to": {
              "type": "integer"
            }
          },
          "additionalProperties": false,
          "required": [
            "from",
            "to"
          ]
        },
        "separator": {
          "type": "string"
        },
        "includePageNumbers": {
          "type": "boolean"
        },
        "tabLeader": {
          "enum": [
            "none",
            "dot",
            "hyphen",
            "underscore",
            "middleDot"
          ]
        },
        "rightAlignPageNumbers": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "target",
    "patch"
  ]
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "toc": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "block"
            },
            "nodeType": {
              "const": "tableOfContents"
            },
            "nodeId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "toc"
      ]
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "const": false
        },
        "failure": {
          "type": "object",
          "properties": {
            "code": {
              "enum": [
                "NO_OP",
                "INVALID_TARGET",
                "TARGET_NOT_FOUND",
                "CAPABILITY_UNAVAILABLE",
                "INVALID_INSERTION_CONTEXT",
                "PAGE_NUMBERS_NOT_MATERIALIZED"
              ]
            },
            "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`

