> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# lists.setLevelRestart

> Set the restart behavior for a specific list level.

## Summary

Set the restart behavior for a specific list level.

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

## Expected result

Returns a ListsMutateItemResult receipt.

## Input fields

| Field               | Type            | Required | Description                  |
| ------------------- | --------------- | -------- | ---------------------------- |
| `level`             | integer         | yes      |                              |
| `restartAfterLevel` | integer \| null | yes      |                              |
| `scope`             | enum            | no       | `"definition"`, `"instance"` |
| `target`            | ListItemAddress | yes      | ListItemAddress              |
| `target.kind`       | `"block"`       | yes      | Constant: `"block"`          |
| `target.nodeId`     | string          | yes      |                              |
| `target.nodeType`   | `"listItem"`    | yes      | Constant: `"listItem"`       |

### Example request

```json theme={null}
{
  "level": 1,
  "restartAfterLevel": 1,
  "scope": "definition",
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "listItem"
  }
}
```

## Output fields

### Variant 1 (success=true)

| Field           | Type            | Required | Description            |
| --------------- | --------------- | -------- | ---------------------- |
| `item`          | ListItemAddress | yes      | ListItemAddress        |
| `item.kind`     | `"block"`       | yes      | Constant: `"block"`    |
| `item.nodeId`   | string          | yes      |                        |
| `item.nodeType` | `"listItem"`    | yes      | Constant: `"listItem"` |
| `success`       | `true`          | yes      | Constant: `true`       |

### Variant 2 (success=false)

| Field             | Type    | Required | Description                                |
| ----------------- | ------- | -------- | ------------------------------------------ |
| `failure`         | object  | yes      |                                            |
| `failure.code`    | enum    | yes      | `"INVALID_TARGET"`, `"LEVEL_OUT_OF_RANGE"` |
| `failure.details` | any     | no       |                                            |
| `failure.message` | string  | yes      |                                            |
| `success`         | `false` | yes      | Constant: `false`                          |

### Example response

```json theme={null}
{
  "item": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "listItem"
  },
  "success": true
}
```

## Pre-apply throws

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

## Non-applied failure codes

* `INVALID_TARGET`
* `LEVEL_OUT_OF_RANGE`

## Raw schemas

<Accordion title="Raw input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "level": {
        "maximum": 8,
        "minimum": 0,
        "type": "integer"
      },
      "restartAfterLevel": {
        "type": [
          "integer",
          "null"
        ]
      },
      "scope": {
        "enum": [
          "definition",
          "instance"
        ]
      },
      "target": {
        "$ref": "#/$defs/ListItemAddress"
      }
    },
    "required": [
      "target",
      "level",
      "restartAfterLevel"
    ],
    "type": "object"
  }
  ```
</Accordion>

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

<Accordion title="Raw success schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "item": {
        "$ref": "#/$defs/ListItemAddress"
      },
      "success": {
        "const": true
      }
    },
    "required": [
      "success",
      "item"
    ],
    "type": "object"
  }
  ```
</Accordion>

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