> ## 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.

# headerFooters.parts.create

> Create a new independent header/footer part, optionally cloned from an existing part.

## Summary

Create a new independent header/footer part, optionally cloned from an existing part.

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

## Expected result

Returns a HeaderFooterPartsMutationResult with the new refId/partPath on success, INVALID\_TARGET failure when sourceRefId is invalid or mismatched.

## Input fields

| Field | Type | Required | Description |
| - | - | - | - |
| `kind` | enum | yes | `"header"`, `"footer"` |
| `sourceRefId` | string | no | |

### Example request

```json theme={null}
{
  "kind": "header",
  "sourceRefId": "example"
}
```

## Output fields

### Variant 1 (success=true)

| Field | Type | Required | Description |
| - | - | - | - |
| `partPath` | string | yes | |
| `refId` | string | yes | |
| `success` | `true` | yes | Constant: `true` |

### Variant 2 (success=false)

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

### Example response

```json theme={null}
{
  "partPath": "example",
  "refId": "example",
  "success": true
}
```

## Pre-apply throws

* `INVALID_TARGET`
* `INVALID_INPUT`
* `CAPABILITY_UNAVAILABLE`
* `INTERNAL_ERROR`

## Non-applied failure codes

* `INVALID_TARGET`

## Raw schemas

> [accordion] Raw input schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "kind": {
>       "enum": [
>         "header",
>         "footer"
>       ]
>     },
>     "sourceRefId": {
>       "minLength": 1,
>       "type": "string"
>     }
>   },
>   "required": [
>     "kind"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw output schema
>
> ```json theme={null}
> {
>   "oneOf": [
>     {
>       "additionalProperties": false,
>       "properties": {
>         "partPath": {
>           "type": "string"
>         },
>         "refId": {
>           "type": "string"
>         },
>         "success": {
>           "const": true
>         }
>       },
>       "required": [
>         "success",
>         "refId",
>         "partPath"
>       ],
>       "type": "object"
>     },
>     {
>       "additionalProperties": false,
>       "properties": {
>         "failure": {
>           "additionalProperties": false,
>           "properties": {
>             "code": {
>               "enum": [
>                 "INVALID_TARGET"
>               ]
>             },
>             "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": {
>     "partPath": {
>       "type": "string"
>     },
>     "refId": {
>       "type": "string"
>     },
>     "success": {
>       "const": true
>     }
>   },
>   "required": [
>     "success",
>     "refId",
>     "partPath"
>   ],
>   "type": "object"
> }
> ```

> [accordion] 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"
>     },
>     "success": {
>       "const": false
>     }
>   },
>   "required": [
>     "success",
>     "failure"
>   ],
>   "type": "object"
> }
> ```


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