> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# fields.remove

> Remove a field from the document.

## Summary

Remove a field from the document.

* Operation ID: `fields.remove`
* API member path: `editor.doc.fields.remove(...)`
* Mutates document: `yes`
* Idempotency: `non-idempotent`
* Supports tracked mode: `no`
* Supports dry run: `yes`
* Deterministic target resolution: `yes`

## Expected result

Returns a FieldMutationResult indicating success or a failure.

## Input fields

| Field | Type | Required | Description |
| - | - | - | - |
| `mode` | `"raw"` | yes | Constant: `"raw"` |
| `target` | object(kind="field") | yes | |
| `target.blockId` | string | yes | |
| `target.fieldId` | string | no | |
| `target.kind` | `"field"` | yes | Constant: `"field"` |
| `target.nestingDepth` | integer | no | |
| `target.occurrenceIndex` | integer | yes | |
| `target.storyId` | string | no | |

### Example request

```json theme={null}
{
  "mode": "raw",
  "target": {
    "blockId": "block-abc123",
    "kind": "field",
    "nestingDepth": 1,
    "occurrenceIndex": 1,
    "storyId": "example"
  }
}
```

## Output fields

### Variant 1 (success=true)

| Field | Type | Required | Description |
| - | - | - | - |
| `field` | object(kind="field") | yes | |
| `field.blockId` | string | yes | |
| `field.fieldId` | string | no | |
| `field.kind` | `"field"` | yes | Constant: `"field"` |
| `field.nestingDepth` | integer | no | |
| `field.occurrenceIndex` | integer | yes | |
| `field.storyId` | string | no | |
| `success` | `true` | yes | Constant: `true` |

### Variant 2 (success=false)

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

### Example response

```json theme={null}
{
  "field": {
    "blockId": "block-abc123",
    "kind": "field",
    "nestingDepth": 1,
    "occurrenceIndex": 1,
    "storyId": "example"
  },
  "success": true
}
```

## Pre-apply throws

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

## Non-applied failure codes

* None

## Raw schemas

> [accordion] Raw input schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "mode": {
>       "const": "raw"
>     },
>     "target": {
>       "additionalProperties": false,
>       "properties": {
>         "blockId": {
>           "type": "string"
>         },
>         "fieldId": {
>           "type": "string"
>         },
>         "kind": {
>           "const": "field"
>         },
>         "nestingDepth": {
>           "type": "integer"
>         },
>         "occurrenceIndex": {
>           "type": "integer"
>         },
>         "storyId": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "kind",
>         "blockId",
>         "occurrenceIndex"
>       ],
>       "type": "object"
>     }
>   },
>   "required": [
>     "mode",
>     "target"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw output schema
>
> ```json theme={null}
> {
>   "oneOf": [
>     {
>       "additionalProperties": false,
>       "properties": {
>         "field": {
>           "additionalProperties": false,
>           "properties": {
>             "blockId": {
>               "type": "string"
>             },
>             "fieldId": {
>               "type": "string"
>             },
>             "kind": {
>               "const": "field"
>             },
>             "nestingDepth": {
>               "type": "integer"
>             },
>             "occurrenceIndex": {
>               "type": "integer"
>             },
>             "storyId": {
>               "type": "string"
>             }
>           },
>           "required": [
>             "kind",
>             "blockId",
>             "occurrenceIndex"
>           ],
>           "type": "object"
>         },
>         "success": {
>           "const": true
>         }
>       },
>       "required": [
>         "success",
>         "field"
>       ],
>       "type": "object"
>     },
>     {
>       "additionalProperties": false,
>       "properties": {
>         "failure": {
>           "additionalProperties": false,
>           "properties": {
>             "code": {
>               "type": "string"
>             },
>             "details": {},
>             "message": {
>               "type": "string"
>             }
>           },
>           "required": [
>             "code",
>             "message"
>           ],
>           "type": "object"
>         },
>         "success": {
>           "const": false
>         }
>       },
>       "required": [
>         "success",
>         "failure"
>       ],
>       "type": "object"
>     }
>   ]
> }
> ```

> [accordion] Raw success schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "field": {
>       "additionalProperties": false,
>       "properties": {
>         "blockId": {
>           "type": "string"
>         },
>         "fieldId": {
>           "type": "string"
>         },
>         "kind": {
>           "const": "field"
>         },
>         "nestingDepth": {
>           "type": "integer"
>         },
>         "occurrenceIndex": {
>           "type": "integer"
>         },
>         "storyId": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "kind",
>         "blockId",
>         "occurrenceIndex"
>       ],
>       "type": "object"
>     },
>     "success": {
>       "const": true
>     }
>   },
>   "required": [
>     "success",
>     "field"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw failure schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "failure": {
>       "additionalProperties": false,
>       "properties": {
>         "code": {
>           "type": "string"
>         },
>         "details": {},
>         "message": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "code",
>         "message"
>       ],
>       "type": "object"
>     },
>     "success": {
>       "const": false
>     }
>   },
>   "required": [
>     "success",
>     "failure"
>   ],
>   "type": "object"
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.